Thread: Updates failing yet saying they succeeded.

Updates failing yet saying they succeeded.

From
Oliver Jones
Date:
I've been having a few problems with PgSQL not updateing data correctly.  Here is some evidence:

autosupply_co_jp=> update vehicle set fob_price =420000 where chassis_number
autosupply_co_jp-> = 'RA2-1002998';
UPDATE 1
autosupply_co_jp=> select fob_price from vehicle where chassis_number = 'RA2-1042998';
fob_price
-----------
    430000
(1 row)

autosupply_co_jp=> update vehicle set fob_price = 420000 where chassis_number = 'RA2-1042998';
UPDATE 1
autosupply_co_jp=> select fob_price from vehicle where chassis_number = 'RA2-1042998';
fob_price
-----------
    420000
(1 row)

WTF is up with that?

[oliver] hostility:~$ rpm -qa |grep post
postgresql-7.1.3-1PGDG
postgresql-server-7.1.3-1PGDG
postgresql-docs-7.1.3-1PGDG
postgresql-jdbc-7.1.3-1PGDG
postgresql-libs-7.1.3-1PGDG
postgresql-devel-7.1.3-1PGDG
postgresql-odbc-7.1.3-1PGDG
postgresql-perl-7.1.3-1PGDG
postgresql-tk-7.1.3-1PGDG
postgresql-tcl-7.1.3-1PGDG

Regards
--
Oliver Jones > Software Engineer > Deeper Design Limited.
oliver@deeper.co.nz  > www.deeperdesign.com
Attachment

Re: Updates failing yet saying they succeeded.

From
Gregory Seidman
Date:
It looks like it's doing exactly what you are asking. Observe:

Oliver Jones sez:
} I've been having a few problems with PgSQL not updateing data
} correctly.  Here is some evidence:
}
} autosupply_co_jp=> update vehicle set fob_price =420000 where
} chassis_number
} autosupply_co_jp-> = 'RA2-1002998';
} UPDATE 1

Okay, updating RA2-1002998...

} autosupply_co_jp=> select fob_price from vehicle where chassis_number =
} 'RA2-1042998';
}  fob_price
} -----------
}     430000
} (1 row)

...but selecting on RA2-1042998.

} autosupply_co_jp=> update vehicle set fob_price = 420000 where
} chassis_number = 'RA2-1042998';
} UPDATE 1

This time, updating on RA2-1042998...

} autosupply_co_jp=> select fob_price from vehicle where chassis_number =
} 'RA2-1042998';
}  fob_price
} -----------
}     420000
} (1 row)

...and selecting on the same, RA2-1042998.

} WTF is up with that?

It didn't work the first time because you were not selecting the same thing
you'd updated. Pilot error.

[...]
} Oliver Jones > Software Engineer >
--Greg


Re: Updates failing yet saying they succeeded.

From
Tom Lane
Date:
Oliver Jones <oliver@deeper.co.nz> writes:
> I've been having a few problems with PgSQL not updateing data
> correctly.

This is a tad hard to believe.  Can you supply a complete example that
would let someone else reproduce the problem?  (No, I don't think that
any random update/select sequence will act that way.)

            regards, tom lane

Re: Updates failing yet saying they succeeded.

From
Oliver Jones
Date:
I'm sorry.  My bad.  It appears I just made a typo...  Nevermind.

Later

On Tue, 2002-06-04 at 17:22, Tom Lane wrote:
Oliver Jones <oliver@deeper.co.nz> writes:
> I've been having a few problems with PgSQL not updateing data
> correctly.

This is a tad hard to believe.  Can you supply a complete example that
would let someone else reproduce the problem?  (No, I don't think that
any random update/select sequence will act that way.)

			regards, tom lane
--
Oliver Jones > Software Engineer > Deeper Design Limited.
oliver@deeper.co.nz  > www.deeperdesign.com
Attachment

Re: Updates failing yet saying they succeeded.

From
Stephan Szabo
Date:
On 4 Jun 2002, Oliver Jones wrote:

> I've been having a few problems with PgSQL not updateing data
> correctly.  Here is some evidence:
>
> autosupply_co_jp=> update vehicle set fob_price =420000 where
> chassis_number
> autosupply_co_jp-> = 'RA2-1002998';
> UPDATE 1
> autosupply_co_jp=> select fob_price from vehicle where chassis_number =
> 'RA2-1042998';
>  fob_price
> -----------
>     430000
> (1 row)
>
> autosupply_co_jp=> update vehicle set fob_price = 420000 where
> chassis_number = 'RA2-1042998';
> UPDATE 1
> autosupply_co_jp=> select fob_price from vehicle where chassis_number =
> 'RA2-1042998';
>  fob_price
> -----------
>     420000
> (1 row)
>
> WTF is up with that?

Is that a copy/paste error that the chassis numbers don't match in those
first statements?


Re: Updates failing yet saying they succeeded.

From
Ron Snyder
Date:
I trust that you did a direct copy-n-paste, and that your first example is intended to show an update that _says_ it updated (but didn't), and your second example is to show an updated that did succeed?
 
If my assumptions are correct, then it looks like you don't really have any problems (with postgres). You updated one chassis_number, but did a select for a different chassis_number in your first query.
 
-ron
-----Original Message-----
From: Oliver Jones [mailto:oliver@deeper.co.nz]
Sent: Monday, June 03, 2002 10:12 PM
To: pgsql-general@postgresql.org
Subject: [GENERAL] Updates failing yet saying they succeeded.

I've been having a few problems with PgSQL not updateing data correctly.  Here is some evidence:

autosupply_co_jp=> update vehicle set fob_price =420000 where chassis_number
autosupply_co_jp-> = 'RA2-1002998';
UPDATE 1
autosupply_co_jp=> select fob_price from vehicle where chassis_number = 'RA2-1042998';
fob_price
-----------
    430000   
  (1 row)

autosupply_co_jp=> update vehicle set fob_price = 420000 where chassis_number = 'RA2-1042998';
UPDATE 1
autosupply_co_jp=> select fob_price from vehicle where chassis_number = 'RA2-1042998';
fob_price
-----------
    420000
(1 row)

WTF is up with that?

[oliver] hostility:~$ rpm -qa |grep post
postgresql-7.1.3-1PGDG
postgresql-server-7.1.3-1PGDG
postgresql-docs-7.1.3-1PGDG
postgresql-jdbc-7.1.3-1PGDG
postgresql-libs-7.1.3-1PGDG
postgresql-devel-7.1.3-1PGDG
postgresql-odbc-7.1.3-1PGDG
postgresql-perl-7.1.3-1PGDG
postgresql-tk-7.1.3-1PGDG
postgresql-tcl-7.1.3-1PGDG

Regards
--
Oliver Jones > Software Engineer > Deeper Design Limited.
oliver@deeper.co.nz  > www.deeperdesign.com
Attachment

Re: Updates failing yet saying they succeeded.

From
Oliver Jones
Date:
Thanks to everyone who answered my email so quickly.  Yet more proof that OpenSource/Free Software support is better than commercial software.

T'was my bad not PgSQL's fault.  I'm the fool who can't type correctly and entered incorrect chassis numbers confusing myself and accusing PgSQL of doing something wrong.

Regards

On Tue, 2002-06-04 at 17:33, Ron Snyder wrote:
I trust that you did a direct copy-n-paste, and that your first example is intended to show an update that _says_ it updated (but didn't), and your second example is to show an updated that did succeed?
 
If my assumptions are correct, then it looks like you don't really have any problems (with postgres). You updated one chassis_number, but did a select for a different chassis_number in your first query.
 
-ron
-----Original Message-----
From: Oliver Jones [mailto:oliver@deeper.co.nz]
Sent: Monday, June 03, 2002 10:12 PM
To: pgsql-general@postgresql.org
Subject: [GENERAL] Updates failing yet saying they succeeded.


I've been having a few problems with PgSQL not updateing data correctly.  Here is some evidence:

autosupply_co_jp=> update vehicle set fob_price =420000 where chassis_number
autosupply_co_jp-> = 'RA2-1002998';
UPDATE 1
autosupply_co_jp=> select fob_price from vehicle where chassis_number = 'RA2-1042998';
fob_price
-----------
    430000   
  (1 row)

autosupply_co_jp=> update vehicle set fob_price = 420000 where chassis_number = 'RA2-1042998';
UPDATE 1
autosupply_co_jp=> select fob_price from vehicle where chassis_number = 'RA2-1042998';
fob_price
-----------
    420000
(1 row)

WTF is up with that?

[oliver] hostility:~$ rpm -qa |grep post
postgresql-7.1.3-1PGDG
postgresql-server-7.1.3-1PGDG
postgresql-docs-7.1.3-1PGDG
postgresql-jdbc-7.1.3-1PGDG
postgresql-libs-7.1.3-1PGDG
postgresql-devel-7.1.3-1PGDG
postgresql-odbc-7.1.3-1PGDG
postgresql-perl-7.1.3-1PGDG
postgresql-tk-7.1.3-1PGDG
postgresql-tcl-7.1.3-1PGDG

Regards
--
Oliver Jones > Software Engineer > Deeper Design Limited.
oliver@deeper.co.nz  > www.deeperdesign.com
--
Oliver Jones > Software Engineer > Deeper Design Limited.
oliver@deeper.co.nz  > www.deeperdesign.com
Attachment