Yes - in the postgresql.conf there is an "add_missing_from" option - change
that to false. I think by default it is on, and in future versions they are
planning to set that to false.
From: Steve Tucknott [mailto:steve(at)retsol(dot)co(dot)uk]
Sent: Thursday, June 30, 2005 2:55 AM
Subject: [NOVICE] Aliased table names ...oddity?
I don't know whether this is a 'bug' (it seems like designed behaviour)
- but if you do:
FROM markUp AS mark
JOIN clientBranch AS clntB
ON mark.foreignRecNo = clntB.clientRecNo
AND clntB.recNo = 2
WHERE mark.serviceCoBranchRecNo = 2
AND mark.foreignTableName = 'client'
So the table has an ALIAS that is ignored in the SELECT clause, then the
WHERE clause is 'ignored' and all rows from the table are returned.
Obviously its a typo in the original SQL - (but one that's very difficult to
pick up unless the data returned is obviously outside limits). Running the
SQL in PSQL, it seems that a FROM clause is automatically appended for the
missing 'markUp' table - so it does seem that this is intentional. Is there
a way to have this 'rejected' as an error - ie selecting from a table not
included in the query?
DDI 01903 828769
Yahoo! Messenger - NEW crystal clear PC to PC calling worldwide with
---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo(at)postgresql(dot)org so that your
message can get through to the mailing list cleanly
pgsql-novice by date
|Next:||From: Tom Lane||Date: 2005-06-30 13:16:40|
|Subject: Re: Aliased table names ...oddity? |
|Previous:||From: Cima||Date: 2005-06-30 09:02:52|
|Subject: capring postgresql and mysql|