Re: Schema search path - Mailing list pgsql-general

From Yaroslav Tykhiy
Subject Re: Schema search path
Date
Msg-id EE1418DB-4004-4334-8D56-93ACD014F624@barnet.com.au
Whole thread Raw
In response to Re: Schema search path  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
On 14/09/2010, at 8:56 AM, Tom Lane wrote:

> Bruce Momjian <bruce@momjian.us> writes:
>> Yaroslav Tykhiy wrote:
>>> SELECT * FROM foo.bar WHERE bar.a=1;
>>>                            ^^^ this means foo.bar
>
>>> Do you think it's a feature or a bug? :-)
>
>> Feature, and SQL-standard behavior.
>
> It might be worth pointing out that this has nothing to do with
> search_path; rather, the key is that the FROM clause establishes
> a table alias "bar" for the query.

Sure, that makes sense because it just extends the well-known aliasing
for unqualified column names, as in "SELECT a FROM foo", to table
names as well.  But a remark on this feature in the SCHEMA related
documentation pages can be a good idea IMHO.

Thanks!

Yar

pgsql-general by date:

Previous
From: Vlad Romascanu
Date:
Subject: Any plans to expose publicly (via stored proc) relation_needs_vacanalyze, or some flavour of do_autovacuum?
Next
From: Yaroslav Tykhiy
Date:
Subject: Re: Query plan choice issue