Aliased table names ...oddity?

Поиск
Список
Период
Сортировка
От Steve Tucknott
Тема Aliased table names ...oddity?
Дата
Msg-id 1120114498.2643.26.camel@retsol1
обсуждение исходный текст
Ответы Re: Aliased table names ...oddity?  (Michael Glaesemann <grzm@myrealbox.com>)
Re: Aliased table names ...oddity?  (Steve Tucknott <steve@retsol.co.uk>)
Список pgsql-novice
PostgreSQL-7.4.5

I don't know whether this is a 'bug' (it seems like designed behaviour)
- but if you do:
SELECT markUp.*
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?


--


Regards,

Steve Tucknott
ReTSol Ltd

DDI    01903 828769
MOBILE    07736715772





___________________________________________________________
Yahoo! Messenger - NEW crystal clear PC to PC calling worldwide with voicemail http://uk.messenger.yahoo.com

В списке pgsql-novice по дате отправления:

Предыдущее
От: Michael Glaesemann
Дата:
Сообщение: Re: [despammed] capring postgresql and mysql
Следующее
От: Michael Glaesemann
Дата:
Сообщение: Re: Aliased table names ...oddity?