Re: Schema search path

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Yaroslav Tykhiy <yar(at)barnet(dot)com(dot)au>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Schema search path
Date: 2010-09-13 21:58:13
Message-ID: 201009132158.o8DLwD107270@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Yaroslav Tykhiy wrote:
> Hi there,
>
> Sorry but I've got yet another issue to discuss today, this time that
> on schema search path. In fact it may not be a bug, but it may be
> worth a note in the documentation.
>
> It seems that if the table in SELECT FROM has an explicit schema
> specifier, further references to the same table name will implicitly
> inherit it. E.g., this query will be valid because the second
> reference will be to foo.bar not public.bar:
>
> SELECT * FROM foo.bar WHERE bar.a=1;
> ^^^ this means foo.bar

No one has ever complained about this before.

> As just shown, this can be even more confusing with nested queries.
>
> Do you think it's a feature or a bug? :-)

Feature, and SQL-standard behavior.

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ It's impossible for everything to be true. +

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Vlad Romascanu 2010-09-13 22:55:02 Any plans to expose publicly (via stored proc) relation_needs_vacanalyze, or some flavour of do_autovacuum?
Previous Message Scott Marlowe 2010-09-13 19:15:36 Re: Post Install / Secure PostgreSQL