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 1kBbg7-0004x2-53 for pgsql-novice@arkaria.postgresql.org; Fri, 28 Aug 2020 10:32:15 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kBbg4-0003Pl-Og for pgsql-novice@arkaria.postgresql.org; Fri, 28 Aug 2020 10:32:12 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kBbg4-0003Pe-I5 for pgsql-novice@lists.postgresql.org; Fri, 28 Aug 2020 10:32:12 +0000 Received: from gw.citecs.de ([212.9.189.66]) by makus.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kBbfx-0007hu-OI for pgsql-novice@lists.postgresql.org; Fri, 28 Aug 2020 10:32:11 +0000 Received: from app.citecs ([10.0.0.50]) by gw.citecs.de with esmtp (Exim 3.35 #1 (Debian)) id 1kBbfu-0005dj-00; Fri, 28 Aug 2020 12:32:02 +0200 Received: from chris by app.citecs proof01 vhtuuhmu with local (Exim 4.80) id 1kBbfu-0002EF-OQ; Fri, 28 Aug 2020 12:32:02 +0200 Date: Fri, 28 Aug 2020 12:32:02 +0200 From: psql-contact@citecs.de To: pgsql-novice@lists.postgresql.org Cc: psql-contact@citecs.de Subject: can't create table on new db/schema/user Message-ID: <20200828103202.GA6864@app.citecs> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline X-pgp-fingerprint: 4096R/3B7D0DF2 / B865 A021 AC93 B61F 4476 32A6 04A6 FBDD 3B7D 0DF2 X-pgp-key-url: http://www.citecs.de/pgpkey.chris.asc X-PGP-Key: http://www.citecs.de/pgpkey.chris.asc Organization: private User-Agent: Mutt/1.5.21 (2010-09-15) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk What I have: debian 10 postgresql 11.7-0+deb10u1 What I did: sudo -s mkdir /var/lib/postgresql/11/ts_chris chown postgres: /var/lib/postgresql/11/ts_chris chmod 700 /var/lib/postgresql/11/ts_chris su - postgres -c psql create user "chris" with login password '***' connection limit -1; create tablespace "ts_chris" owner chris location '/var/lib/postgresql/11/ts_chris'; alter tablespace ts_chris owner to chris; create database db_chris owner = automicuser template = template0 encoding = "UTF-8" tablespace = ts_chris lc_collate = "C" lc_ctype = "C" connection limit = -1 ; create schema s_chris authorization "chris"; alter role chris in database db_chris set search_path to s_chris; grant usage on schema s_chris to chris; grant create on schema s_chris to chris; What I tried: psql -h lxc05 db_chris chris db_chris=> create table t1 (i int); ERROR: no schema has been selected to create in LINE 1: create table t1 (i int); ^ Debugging attempts: 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? Kind regards, Chris