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

Re: BUG #5630: CREATE INDEX does not use schema search path

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "tbz" <tbb(at)vollbio(dot)de>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #5630: CREATE INDEX does not use schema search path
Date: 2010-08-27 18:25:48
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-bugs
"tbz" <tbb(at)vollbio(dot)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

			regards, tom lane

In response to

pgsql-bugs by date

Next:From: David KensiskiDate: 2010-08-27 18:55:56
Subject: BUG #5631: psql dumps core during command editing
Previous:From: Tom LaneDate: 2010-08-27 15:11:29
Subject: Re: BUG #5629: ALTER SEQUENCE foo START execute a RESTART

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