Re: pg_dump insert column GENERATED

From: Дмитрий Иванов <firstdismay(at)gmail(dot)com>
To: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
Cc: pgsql-general <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: pg_dump insert column GENERATED
Date: 2021-11-21 01:11:20
Message-ID: CAPL5KHqpj+MZKS6hC-i0T3DynTEJf00J4oPFgKw+KSO9axz9jg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Yes and yes.
I ended up using the pg_dump of the receiving server.

sudo /usr/lib/postgresql/14/bin/pg_dump --file
"/home/dismay/uchet/Uchet.backup" --host "server" --port "5999" --username
"back" --no-password --verbose --format=c --quote-all-identifiers --blobs
--column-inserts --inserts --create --disable-triggers --encoding="UTF8"
"Uchet"

sudo /usr/lib/postgresql/14/bin/pg_restore --host "127.0.0.1" --port "5432"
--username "back" --no-password --dbname "Uchet" --disable-triggers
--format=c --create --verbose "/home/dismay/uchet/Uchet.backup"

sudo /usr/lib/postgresql/14/bin/pg_restore --host "127.0.0.1" --port "5432"
--username "back" --no-password --dbname "Uchet" --disable-triggers
--table="bpd.object" --format=c --verbose "/home/dismay/uchet/Uchet.backup"

Receiving server:
PostgreSQL 14.1 (Debian 14.1-1.pgdg110+1) on x86_64-pc-linux-gnu, compiled
by gcc (Debian 10.2.1-6) 10.2.1 20210110, 64-bit

Server source:
PostgreSQL 12.9, compiled by Visual C++ build 1914, 64-bit
EDB assembly installed from "Application Stack Builder"

вс, 21 нояб. 2021 г. в 00:06, Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>:

> On 11/20/21 10:33, Дмитрий Иванов wrote:
> > I don't know.
> > sudo /usr/lib/postgresql/14/bin/pg_dump --file
> > "/home/dismay/uchet/Uchet.backup" --host "server" --port "5999"
> > --username "back" --no-password --verbose --format=c
> > --quote-all-identifiers --blobs --column-inserts --inserts --create
> > --disable-triggers --encoding="UTF8" "Uchet"
> > I used the pg_dump version of the receiving server, but the pg_dump of
> > the source server initially gave almost the same result, a COPY error of
> > the empty table
> > PostgreSQL 12.9, compiled by Visual C++ build 1914, 64-bit
> > to
> > PostgreSQL 14.1 (Debian 14.1-1.pgdg110+1) on x86_64-pc-linux-gnu,
> > compiled by gcc (Debian 10.2.1-6) 10.2.1 20210110, 64-bit
>
> To be clear you used the Postgres 14 version of pg_dump to dump from a
> Postgres 12 version database, correct?
>
> What version of pg_restore did you use to restore to the Postgres 14
> database?
>
> Where did you install the Postgres 12.9 version package from?
>
> --
> Adrian Klaver
> adrian(dot)klaver(at)aklaver(dot)com
>

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2021-11-21 01:38:44 Re: pg_dump insert column GENERATED
Previous Message Tom Lane 2021-11-20 20:25:47 Re: pg_restore depending on user functions