dbTalk Databases Forums  

Re: [BUGS] FW: [pgadmin-support] Column name validation in embedded query.

mailing.database.pgsql-bugs mailing.database.pgsql-bugs


Discuss Re: [BUGS] FW: [pgadmin-support] Column name validation in embedded query. in the mailing.database.pgsql-bugs forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Tom Lane
 
Posts: n/a

Default Re: [BUGS] FW: [pgadmin-support] Column name validation in embedded query. - 11-08-2005 , 08:45 AM






"Lori Pate" <lpate (AT) opushealthcare (DOT) com> writes:
Quote:
However, when the query with the incorrect column name (Query A) is
embedded in a where clause, column validation does not happen, no error
is displayed, and PGAdmin apparently ignores the where clause all
together, resulting in complete data deletion, as if there were no where
clause:

Begin;
Delete from testorder where patientorder_key in
(Select patientorder_key from patientorder where visit_key = 250314 and
provider_key = 301);
End;
Unfortunately for you, that IS a valid SQL command.

In a subselect like that, unqualified column names are supposed to be
sought first in the subselect (ie, table patientorder) and then in the
outer query (table testorder). So patientorder_key will be found as an
outer reference to testorder. The fact that this renders the query a
bit silly does not change the fact that it's valid per spec.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.