Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 3CCF9476D00 for ; Thu, 2 Jan 2003 17:37:14 -0500 (EST) Received: from candle.pha.pa.us (momjian.navpoint.com [207.106.42.251]) by postgresql.org (Postfix) with ESMTP id 3A314476CC5 for ; Thu, 2 Jan 2003 17:36:57 -0500 (EST) Received: (from pgman@localhost) by candle.pha.pa.us (8.11.6/8.10.1) id h02MaTP10061; Thu, 2 Jan 2003 17:36:29 -0500 (EST) From: Bruce Momjian Message-Id: <200301022236.h02MaTP10061@candle.pha.pa.us> Subject: Re: ODBC - adding missing FROM clause entry In-Reply-To: <81132473206F3A46A72BD6116E1A06AE1B14B9@black.aprote.com> To: Tambet Matiisen Date: Thu, 2 Jan 2003 17:36:29 -0500 (EST) Cc: Martin_Hurst@dom.com, pgsql-odbc@postgresql.org X-Mailer: ELM [version 2.4ME+ PL99 (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200301/11 X-Sequence-Number: 2510 Tambet Matiisen wrote: > > This is quite odd feature in PostgreSQL. Try this: > > select pg_database.datname from pg_user; > > You will get all database names, each repeated by number of > users and a note: > > NOTICE: Adding missing FROM-clause entry for table "pg_database" > > You see, in SELECT you referred a table that is not in FROM > clause and PostgreSQL is adding it automatically! Seems pretty > confusing to me, but I didn't dig any further, why is it needed > or when it this was included. This feature came from the Berkeley days, so we have had it for a long time. In fact, the ODBC code was using it for a few queries which I just fixed. -- Bruce Momjian | http://candle.pha.pa.us pgman@candle.pha.pa.us | (610) 359-1001 + If your life is a hard drive, | 13 Roberts Road + Christ can be your backup. | Newtown Square, Pennsylvania 19073