pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: George Weaver <gweaver@shaw.ca>
To: pgsql-general@lists.postgresql.org <pgsql-general@lists.postgresql.org>
Subject: Restoring Database on Version 11 does not restore database comment
Date: Fri, 20 Nov 2020 16:57:59 -0600
Message-ID: <b486a10f-6a9f-9844-18f6-4708b3b54872@cleartagsoftware.com> (raw)
In-Reply-To: <dd1083bb-c44e-3da9-8cc7-efddd2dec020@cleartagsoftware.com>
References: <dd1083bb-c44e-3da9-8cc7-efddd2dec020@cleartagsoftware.com>

Good afternoon,

If I backup a PostgreSQL 10.14 database using pg_dump from Version 
11.10, and restore to Version 11, the comment for the database is lost.

I haven't encountered this before when upgrading between major versions.

Test case:

C:\Program Files\PostgreSQL\10\bin>psql
psql (10.14)

postgres=# CREATE DATABASE test_comment TEMPLATE = template0;
CREATE DATABASE
postgres=# COMMENT ON DATABASE test_comment IS 'Test Comment Database';
COMMENT
postgres=# SELECT pg_catalog.shobj_description(d.oid, 'pg_database') as 
"Version"
postgres-# FROM pg_catalog.pg_database d
postgres-#   where d.datname = 'test_comment';
         Version
-----------------------
  Test Comment Database
(1 row)

C:\Program Files\PostgreSQL\11\bin>pg_dump -h localhost -p 5433 -U 
postgres -f "G:\test_comment.bak" -Fc -O test_comment

C:\Program Files\PostgreSQL\11\bin>psql -p 5435
psql (11.10)

postgres=# CREATE DATABASE test_comment TEMPLATE = template0;
CREATE DATABASE
postgres=# \q

C:\Program Files\PostgreSQL\11\bin>pg_Restore -p 5435  -U postgres -d 
test_comment "G:\test_comment.bak"

C:\Program Files\PostgreSQL\11\bin>psql -p 5435
psql (11.10)

postgres=# SELECT pg_catalog.shobj_description(d.oid, 'pg_database') as 
"Version"
postgres-# FROM pg_catalog.pg_database d
postgres-#   where d.datname = 'test_comment';
  Version
---------

(1 row)

What am I missing?

Thanks,
George







view thread (4+ messages)  latest in thread

Message-ID: <b486a10f-6a9f-9844-18f6-4708b3b54872@cleartagsoftware.com>
Permalink:  ../b486a10f-6a9f-9844-18f6-4708b3b54872@cleartagsoftware.com/
Also on:    postgresql.org/message-id/b486a10f-6a9f-9844-18f6-4708b3b54872@cleartagsoftware.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: gweaver@shaw.ca
  Subject: Re: Restoring Database on Version 11 does not restore database comment
  In-Reply-To: <b486a10f-6a9f-9844-18f6-4708b3b54872@cleartagsoftware.com>
  References: <dd1083bb-c44e-3da9-8cc7-efddd2dec020@cleartagsoftware.com> <b486a10f-6a9f-9844-18f6-4708b3b54872@cleartagsoftware.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