pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: frank.messie@osix.nl
Cc: pgsql-admin@postgresql.org
Subject: Re: user name doesn't seem to resolve to $user in search_path
Date: Thu, 16 Oct 2003 13:29:53 -0400
Message-ID: <11938.1066325393@sss.pgh.pa.us> (raw)
In-Reply-To: <OFBE9D44D7.E982DC46-ONC1256DC1.0031135C-C1256DC1.002BD7D1@osix.com>
References: <OFBE9D44D7.E982DC46-ONC1256DC1.0031135C-C1256DC1.002BD7D1@osix.com>

frank.messie@osix.nl writes:
> I have a problem with the following. 
> I start psql as user "testusr" in database "testdb"
> In the database I have created a schema with the name of a user 
> CREATE SCHEMA testusr ;
> The search_path is the default               $user,public
> Then I create a table
> CREATE TABLE test (name char(8)) ;
> Now I get the error message "No namespace have been selected to create 
> in".

This sounds like the search path didn't get recomputed when you created
the new schema, but I cannot reproduce any such problem:

regression=# create user tstuser;
CREATE USER
regression=# grant create on database regression to tstuser;
GRANT
regression=# \c - tstuser
You are now connected as new user "tstuser".
regression=> select current_schemas(true);
   current_schemas
---------------------
 {pg_catalog,public}
(1 row)

regression=> create schema tstuser;
CREATE SCHEMA
regression=> CREATE TABLE test (name char(8)) ;
CREATE TABLE
regression=> \dt test
        List of relations
 Schema  | Name | Type  |  Owner
---------+------+-------+---------
 tstuser | test | table | tstuser
(1 row)

regression=> select current_schemas(true);
       current_schemas
-----------------------------
 {pg_catalog,tstuser,public}
(1 row)

Are you sure you spelled the schema name the same as the user name?

			regards, tom lane



view thread (4+ messages)  latest in thread

Message-ID: <11938.1066325393@sss.pgh.pa.us>
Permalink:  ../11938.1066325393@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/11938.1066325393@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-admin@postgresql.org
  Cc: tgl@sss.pgh.pa.us, frank.messie@osix.nl
  Subject: Re: user name doesn't seem to resolve to $user in search_path
  In-Reply-To: <11938.1066325393@sss.pgh.pa.us>
  References: <OFBE9D44D7.E982DC46-ONC1256DC1.0031135C-C1256DC1.002BD7D1@osix.com> <11938.1066325393@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox