public inbox for [email protected]  
help / color / mirror / Atom feed
From: hubert depesz lubaczewski <[email protected]>
To: [email protected]
Cc: [email protected]
Subject: Re: can't create table on new db/schema/user
Date: Fri, 28 Aug 2020 12:56:12 +0200
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
References: <[email protected]>

On Fri, Aug 28, 2020 at 12:32:02PM +0200, [email protected] 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






view thread (6+ messages)  latest in thread

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 using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected]
  Subject: Re: can't create table on new db/schema/user
  In-Reply-To: <[email protected]>

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

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