Strange Update-Bug in postgres (is it a feature?) ?!

Started by Tarabasabout 24 years ago2 messagesgeneral
Jump to latest
#1Tarabas
tarabas@tarabas.de

Hi!

Is this a bug or a feature:

When I try an update like this
"update mail set mail.mailread=1 where mail.mail_id=123" I get the Error
"Error while executing query parse error near '.'"

Then I try

"update mail set mailread=1 where mail.mail_id=123" and it works fine ...

On MS-SQL both work fine ... since I use finals for the tablefields in my
java-program to build the queries/updates from, it's kinda bad if I remove
the table in front of the field (because they could be used in updates as
well as joined-selects where i would need them!) ... So it would be great if
both versions would work as they do on other DB-Systems ... why is that
different ... does that serve a certain purpose ?!

Any chance to change that behaviour ?!

Regards ... Manuel ...

#2Stephan Szabo
sszabo@megazone23.bigpanda.com
In reply to: Tarabas (#1)
Re: Strange Update-Bug in postgres (is it a feature?) ?!

On Mon, 15 Apr 2002, Tarabas wrote:

Is this a bug or a feature:

When I try an update like this
"update mail set mail.mailread=1 where mail.mail_id=123" I get the Error
"Error while executing query parse error near '.'"

Then I try

"update mail set mailread=1 where mail.mail_id=123" and it works fine ...

I believe this is what the SQL92 standard asks for. It seems to want
<column name> = <update source> rather than something like
<column reference> = <update source>

My memory is rather flaky but I vaguely remember a recent discussion on
something similar (maybe column names in insert lists?) that made it sound
like it might be possible to convince a change, but it would probably have
to properly error on cases where the names didn't match properly.