Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kBc3U-0005m1-Fs for pgsql-novice@arkaria.postgresql.org; Fri, 28 Aug 2020 10:56:24 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kBc3S-0003Ka-A2 for pgsql-novice@arkaria.postgresql.org; Fri, 28 Aug 2020 10:56:22 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kBc3S-0003KT-0e for pgsql-novice@lists.postgresql.org; Fri, 28 Aug 2020 10:56:22 +0000 Received: from lana.depesz.com ([88.198.49.178] helo=depesz.com) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kBc3L-0001ay-Cb for pgsql-novice@lists.postgresql.org; Fri, 28 Aug 2020 10:56:21 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=depesz.com; s=20170201; h=In-Reply-To:Content-Type:MIME-Version:References:Reply-To: Message-ID:Subject:Cc:To:Sender:From:Date:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=1Ox/4qQ4YpnnPTlOWWx2MEDSyFO1xlXWZyCKZNWcxIQ=; b=CLD8x7/+PtaIr8NaIHdCPtRUUG Rk0wtpuqwj1NF+kJSjAvU6S5CRvnhI1z4eBudAlllWUNdOZFEWaG7weshc2vGgEmBJeS/iwZxWft6 xxw4s3fMQiQyIwNhMBIcBAEeni85vESgUqRAGlQmTw2k1BnbNh19oQgbebm5GXhBvId0=; Received: from lana.depesz.com ([88.198.49.178] helo=depesz.com) by depesz.com with esmtpa (Exim 4.92) (envelope-from ) id 1kBc3I-0004Ks-5t; Fri, 28 Aug 2020 12:56:12 +0200 Date: Fri, 28 Aug 2020 12:56:12 +0200 From: hubert depesz lubaczewski Sender: depesz@depesz.com To: psql-contact@citecs.de Cc: pgsql-novice@lists.postgresql.org Subject: Re: can't create table on new db/schema/user Message-ID: <20200828105612.GB7316@depesz.com> Reply-To: depesz@depesz.com References: <20200828103202.GA6864@app.citecs> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20200828103202.GA6864@app.citecs> User-Agent: Mutt/1.10.1 (2018-07-13) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Fri, Aug 28, 2020 at 12:32:02PM +0200, psql-contact@citecs.de wrote: > postgres=# \dn+ > List of schemas > Name | Owner | Access privileges | Description > ---------+-------------+----------------------------+------------------------ > public | postgres | postgres=UC/postgres +| standard public schema > | | =UC/postgres | > s_chris | chris | chris=UC/chris | > (3 rows) > > postgres=# \dg+ > List of roles > Role name | Attributes | Member of | Description > -------------+------------------------------------------------------------+-----------+------------- > chris | | {} | > postgres | Superuser, Create role, Create DB, Replication, Bypass RLS | {} | > > db_chris=> create table t1 (i int); > ERROR: no schema has been selected to create in > LINE 1: create table t1 (i int); > ^ > db_chris=> \dn+ > List of schemas > Name | Owner | Access privileges | Description > --------+----------+----------------------+------------------------ > public | postgres | postgres=UC/postgres+| standard public schema > | | =UC/postgres | > (1 row) > > db_chris=> \dg+ > List of roles > Role name | Attributes | Member of | Description > -------------+------------------------------------------------------------+-----------+------------- > chris | | {} | > postgres | Superuser, Create role, Create DB, Replication, Bypass RLS | {} | > > db_chris=> show search_path; > search_path > ------------- > s_chris > (1 row) > So, what did I miss? Schema s_chris is in database "postgres", but you try to make the table in "db_chris". So you have to make the schema in db_chris database. Best regards, depesz