Re: [HACKERS] Erratic error message "ERROR: column "id_compte" does

2005-03-16 Thread David Pradier
Ok then, if it's per spec, nothing to say. Thanks to everybody, Richard and Tom, for your time. PS : well yes, i think it is reasonably weird. I sure don't want to try and imagine the case you're proposing. Brain's too precious to burn. I'm confident in you to be assured it's weirder and weirdest

Re: [HACKERS] Erratic error message "ERROR: column "id_compte" does

2005-03-16 Thread Tom Lane
David Pradier <[EMAIL PROTECTED]> writes: > One can access the columns of the main query from the subquery, > therefore in my own query the column "id_compte" is found, > therefore there is no error message. > Doesn't this count as a bug ? No; it's required behavior per the SQL specification. Th

Re: [HACKERS] Erratic error message "ERROR: column "id_compte" does

2005-03-16 Thread Richard Huxton
David Pradier wrote: Ok, understood. One can access the columns of the main query from the subquery, therefore in my own query the column "id_compte" is found, therefore there is no error message. Doesn't this count as a bug ? Tricky, you could have something like: SELECT a.* FROM a WHERE (a1,a2)

Re: [HACKERS] Erratic error message "ERROR: column "id_compte" does

2005-03-16 Thread David Pradier
Ok, understood. One can access the columns of the main query from the subquery, therefore in my own query the column "id_compte" is found, therefore there is no error message. Doesn't this count as a bug ? On Wed, Mar 16, 2005 at 02:24:48PM +, Richard Huxton wrote: > David Pradier wrote: > >A

Re: [HACKERS] Erratic error message "ERROR: column "id_compte" does

2005-03-16 Thread Richard Huxton
David Pradier wrote: Actually, the column "id_compte" is the primary key of the table "compte". The column "id_compte" doesn't exist in the table "operation". But i still don't understand why there is no error message, could you explain a little more ? I think it's intended for use in the WHERE cla

Re: [HACKERS] Erratic error message "ERROR: column "id_compte" does

2005-03-16 Thread David Pradier
Actually, the column "id_compte" is the primary key of the table "compte". The column "id_compte" doesn't exist in the table "operation". But i still don't understand why there is no error message, could you explain a little more ? David On Wed, Mar 16, 2005 at 11:49:28AM +, Richard Huxton w

Re: [HACKERS] Erratic error message "ERROR: column "id_compte" does

2005-03-16 Thread Richard Huxton
David Pradier wrote: But when i put this query inside another query, i don't have anymore the error message : select distinct id_operation from compte where id_compte in (select id_compte from operation where not compta_g5); No error message. It looks like it's binding to the outer query - where yo

[HACKERS] Erratic error message "ERROR: column "id_compte" does not exist"

2005-03-16 Thread David Pradier
Hi everybody, I've just run into a seemingly strange behaviour of postgresql and I'd like to know if it's normal or what. I've got a table "operation" in which there _isn't_ any column "id_compte". So when i do : "select id_compte from operation where not compta_g5;" I have : "ERROR: column "id_