Re: BUG #5630: CREATE INDEX does not use schema search path - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #5630: CREATE INDEX does not use schema search path
Date
Msg-id 3253.1282933548@sss.pgh.pa.us
Whole thread Raw
In response to BUG #5630: CREATE INDEX does not use schema search path  ("tbz" <tbb@vollbio.de>)
List pgsql-bugs
"tbz" <tbb@vollbio.de> writes:
> CREATE TABLE pg_user (
>  login_name VARCHAR(50) NOT NULL
> );
> CREATE UNIQUE INDEX ak1_login_name ON pg_user(login_name);
> [fails]

This is expected, given the default search_path settings in which
pg_catalog is implicitly at the front of the path.  When you create
pg_user, it's created in whichever schema is the creation target schema
(ie, the first schema listed explicitly in search_path, perhaps
"public").  However, that's still behind pg_catalog, so the unqualified
reference to pg_user in the CREATE INDEX command resolves as
pg_catalog.pg_user.  See
http://www.postgresql.org/docs/8.3/static/ddl-schemas.html#DDL-SCHEMAS-CATALOG

            regards, tom lane

pgsql-bugs by date:

Previous
From: "tbz"
Date:
Subject: BUG #5630: CREATE INDEX does not use schema search path
Next
From: "David Kensiski"
Date:
Subject: BUG #5631: psql dumps core during command editing