X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 5DA17D1B4ED for ; Thu, 16 Oct 2003 17:30:26 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 49649-08 for ; Thu, 16 Oct 2003 14:29:56 -0300 (ADT) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by svr1.postgresql.org (Postfix) with ESMTP id 40297D1B508 for ; Thu, 16 Oct 2003 14:29:55 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.12.10/8.12.10) with ESMTP id h9GHTruo011939; Thu, 16 Oct 2003 13:29:53 -0400 (EDT) To: frank.messie@osix.nl Cc: pgsql-admin@postgresql.org Subject: Re: user name doesn't seem to resolve to $user in search_path In-reply-to: References: Comments: In-reply-to frank.messie@osix.nl message dated "Thu, 16 Oct 2003 11:10:30 +0200" Date: Thu, 16 Oct 2003 13:29:53 -0400 Message-ID: <11938.1066325393@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200310/186 X-Sequence-Number: 10747 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