pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Adrian Klaver <adrian.klaver@aklaver.com>
To: Олег Самойлов <splarv@ya.ru>
To: pgsql-general@lists.postgresql.org
Subject: Re: pg_dump and public schema
Date: Wed, 4 Mar 2020 08:19:41 -0800
Message-ID: <48b7a7a0-0d1a-7412-5f33-37a2a746dbc0@aklaver.com> (raw)
In-Reply-To: <D6222EE7-B4EE-4529-BE85-745BD4A0EF53@ya.ru>
References: <D6222EE7-B4EE-4529-BE85-745BD4A0EF53@ya.ru>

On 3/4/20 5:42 AM, Олег Самойлов wrote:
> Hi all. PostgresQL 12.1. Strange behaviour with pg_dump and absent public schema.
> 
> I droped public schema and I work under "username" schema.
> 
> => \dn
> List of schemas
>   Name  | Owner
> -------+-------
>   olleg | olleg
> (1 row)
> 
> Dump now
> 
> pg_dump -U postgres -C olleg >dump.sql
> 
> --
> -- PostgreSQL database dump
> --
> 
> -- Dumped from database version 12.1
> -- Dumped by pg_dump version 12.1
> 
> SET statement_timeout = 0;
> SET lock_timeout = 0;
> SET idle_in_transaction_session_timeout = 0;
> SET client_encoding = 'UTF8';
> SET standard_conforming_strings = on;
> SELECT pg_catalog.set_config('search_path', '', false);
> SET check_function_bodies = false;
> SET xmloption = content;
> SET client_min_messages = warning;
> SET row_security = off;
> 
> --
> -- Name: olleg; Type: DATABASE; Schema: -; Owner: olleg
> --
> 
> CREATE DATABASE olleg WITH TEMPLATE = template0 ENCODING = 'UTF8' LC_COLLATE = 'ru_RU.UTF-8' LC_CTYPE = 'ru_RU.UTF-8';
> 
> 
> ALTER DATABASE olleg OWNER TO olleg;
> 
> \connect olleg
> 
> SET statement_timeout = 0;
> SET lock_timeout = 0;
> SET idle_in_transaction_session_timeout = 0;
> SET client_encoding = 'UTF8';
> SET standard_conforming_strings = on;
> SELECT pg_catalog.set_config('search_path', '', false);
> SET check_function_bodies = false;
> SET xmloption = content;
> SET client_min_messages = warning;
> SET row_security = off;
> 
> --
> -- Name: olleg; Type: SCHEMA; Schema: -; Owner: olleg
> --
> 
> CREATE SCHEMA olleg;
> 
> 
> ALTER SCHEMA olleg OWNER TO olleg;
> 
> --
> -- PostgreSQL database dump complete
> --
> 
> recreate DB from the dump:
> 
> psql postgres postgres -f dump.sql
> 
> And now I see public schema, which must be absent.
> 
> psql olleg olleg
> 
> => \dn
>    List of schemas
>    Name  |  Owner
> --------+----------
>   olleg  | olleg
>   public | postgres
> (2 rows)
> 

I believe this is the latest information on public schema handling:

https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=5955d934194c3888f30318209ade71b53d297...

-- 
Adrian Klaver
adrian.klaver@aklaver.com





view thread (5+ messages)  latest in thread

Message-ID: <48b7a7a0-0d1a-7412-5f33-37a2a746dbc0@aklaver.com>
Permalink:  ../48b7a7a0-0d1a-7412-5f33-37a2a746dbc0@aklaver.com/
Also on:    postgresql.org/message-id/48b7a7a0-0d1a-7412-5f33-37a2a746dbc0@aklaver.com

 · 

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-general@postgresql.org
  Cc: adrian.klaver@aklaver.com, splarv@ya.ru
  Subject: Re: pg_dump and public schema
  In-Reply-To: <48b7a7a0-0d1a-7412-5f33-37a2a746dbc0@aklaver.com>
  References: <D6222EE7-B4EE-4529-BE85-745BD4A0EF53@ya.ru> <48b7a7a0-0d1a-7412-5f33-37a2a746dbc0@aklaver.com>

* 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