Skip site navigation (1) Skip section navigation (2)

Re: Aliased table names ...oddity?

From: Michael Glaesemann <grzm(at)myrealbox(dot)com>
To: Steve Tucknott <steve(at)retsol(dot)co(dot)uk>
Cc: PostgreSQL Novice <pgsql-novice(at)postgresql(dot)org>
Subject: Re: Aliased table names ...oddity?
Date: 2005-06-30 07:16:44
Message-ID: D275E83A-6C09-4B7F-B954-095ACBC79EF4@myrealbox.com (view raw or flat)
Thread:
Lists: pgsql-novice
On Jun 30, 2005, at 3:54 PM, Steve Tucknott wrote:

> PostgreSQL-7.4.5

<snip />

> 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?

Yes, there is/was designed behavior, and there is a way to shut it  
off in postgresql.conf. It's still there for backwards compatibility,  
but more recent versions display a notice when a FROM clause is added.

test=# select foo.foo_id, bar_name from foo f join bar using (foo_id);
NOTICE:  adding missing FROM-clause entry for table "foo"

Here are some references:
http://www.postgresql.org/docs/7.4/interactive/runtime-config.html
http://sql-info.de/postgresql/postgres-gotchas.html#1_5

Hope this helps.

Michael Glaesemann
grzm myrealbox com



In response to

Responses

pgsql-novice by date

Next:From: Steve TucknottDate: 2005-06-30 07:34:03
Subject: Re: Aliased table names ...oddity?
Previous:From: Steve TucknottDate: 2005-06-30 06:54:57
Subject: Aliased table names ...oddity?

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group