Re: pg_dump insert column GENERATED

2021-11-22 Thread Дмитрий Иванов
Thank you, there is a clear logic to it. -- Regards, Dmitry! пн, 22 нояб. 2021 г. в 21:11, Adrian Klaver : > On 11/22/21 03:32, Дмитрий Иванов wrote: > > Got it. > > > > > > >You are going need to provide more information about the above: > > >1) Define regular results. > > >2) Th

Re: pg_dump insert column GENERATED

2021-11-22 Thread Adrian Klaver
On 11/22/21 03:32, Дмитрий Иванов wrote: Got it. >You are going need to provide more information about the above: >1) Define regular results. >2) The query used. >3) The outcome vs what you expected. I will continue to experiment. The question is which option is better (th

Re: pg_dump insert column GENERATED

2021-11-22 Thread Дмитрий Иванов
It seems to me that you are right all round (I gave up COPY because of problems with the MONEY type): sudo /usr/lib/postgresql/14/bin/pg_dump --file "/home/dismay/uchet/object.sql" --host "server" --port "5999" --username "back" --no-password --verbose --format=p --quote-all-identifiers --encoding

Re: pg_dump insert column GENERATED

2021-11-22 Thread Дмитрий Иванов
Рад помочь! -- С уважением, Дмитрий! пн, 22 нояб. 2021 г. в 19:55, Tom Lane : > =?UTF-8?B?0JTQvNC40YLRgNC40Lkg0JjQstCw0L3QvtCy?= > writes: > > Uchet=# select attname, attgenerated from pg_attribute > > Uchet-# where attrelid = 'bpd.object'::regclass and attnum > 0; > > attname

Re: pg_dump insert column GENERATED

2021-11-22 Thread Tom Lane
=?UTF-8?B?0JTQvNC40YLRgNC40Lkg0JjQstCw0L3QvtCy?= writes: > Uchet=# select attname, attgenerated from pg_attribute > Uchet-# where attrelid = 'bpd.object'::regclass and attnum > 0; > attname| attgenerated > ---+-- > id

Re: pg_dump insert column GENERATED

2021-11-22 Thread Дмитрий Иванов
Got it. > > >You are going need to provide more information about the above: > >1) Define regular results. > >2) The query used. > >3) The outcome vs what you expected. > > I will continue to experiment. The question is which option is better (this would reduce the number of options): pd_dump is t

Re: pg_dump insert column GENERATED

2021-11-21 Thread Дмитрий Иванов
Ok, I'll take a look. I recreated the is_inside column yesterday, but it didn't make any difference. Uchet=# select attname, attgenerated from pg_attribute Uchet-# where attrelid = 'bpd.object'::regclass and attnum > 0; attname| attgenerated ---+-

Re: pg_dump insert column GENERATED

2021-11-21 Thread Adrian Klaver
On 11/21/21 07:23, Дмитрий Иванов wrote: Yes and yes. I don't get regular results in my experiments. I filled in some of the tables this morning, but now I can't do it again. > INSERT INTO bpd.plan_calendar (create in version 12) > OK I can't do it again. You are going need to provide more

Re: pg_dump insert column GENERATED

2021-11-21 Thread Tom Lane
=?UTF-8?B?0JTQvNC40YLRgNC40Lkg0JjQstCw0L3QvtCy?= writes: >> So did you do an ALTER TABLE ... GENERATED ALWAYS AS on bpg.object in >> the Postgres 12 version of the database? > I think you're right, I added later. Hmm, that's suggestive, but I tried making a table that way and still did not see a

Re: pg_dump insert column GENERATED

2021-11-21 Thread Дмитрий Иванов
Yes and yes. I don't get regular results in my experiments. I filled in some of the tables this morning, but now I can't do it again. > INSERT INTO bpd.plan_calendar (create in version 12) > OK I can't do it again. >If I am following the bpg.object table was originally created in >Postgres 10, cor

Re: pg_dump insert column GENERATED

2021-11-20 Thread Adrian Klaver
On 11/20/21 20:39, Дмитрий Иванов wrote: Yes and yes. I filled some tables with GENERATED fields as follows: "C:\Program Files\PostgreSQL\12\bin\pg_dump" --file "D:\UPLoad\-=PG-Uchet=-\Base\bpd.sql" --host "127.0.0.1" --port "5999" --username "back" --no-password --verbose --format=p --quote-a

Re: pg_dump insert column GENERATED

2021-11-20 Thread Дмитрий Иванов
Yes and yes. I filled some tables with GENERATED fields as follows: "C:\Program Files\PostgreSQL\12\bin\pg_dump" --file "D:\UPLoad\-=PG-Uchet=-\Base\bpd.sql" --host "127.0.0.1" --port "5999" --username "back" --no-password --verbose --format=p --quote-all-identifiers --column-inserts --inserts --en

Re: pg_dump insert column GENERATED

2021-11-20 Thread Adrian Klaver
On 11/20/21 17:11, Дмитрий Иванов wrote: 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-identifie

Re: pg_dump insert column GENERATED

2021-11-20 Thread Дмитрий Иванов
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 --creat

Re: pg_dump insert column GENERATED

2021-11-20 Thread Adrian Klaver
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 --dis

Re: pg_dump insert column GENERATED

2021-11-20 Thread Дмитрий Иванов
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

Re: pg_dump insert column GENERATED

2021-11-20 Thread Дмитрий Иванов
Ok, I see. This is actually an interesting question. I don't understand which approach to use. I am using pd_dump and pg_restore of the receiving server. It might make sense to use pg_dump source, pg_restore sink сб, 20 нояб. 2021 г. в 22:33, Tom Lane : > Adrian Klaver writes: > > On 11/20/21 0

Re: pg_dump insert column GENERATED

2021-11-20 Thread Tom Lane
Adrian Klaver writes: > On 11/20/21 04:27, Дмитрий Иванов wrote: >> Why does pg_dump generate an insertion script in the generated columns? > Actually I think it should be DEFAULT. It should be, and it is when I try this example. I get output like -- -- Data for Name: object; Type: TABLE DATA

Re: pg_dump insert column GENERATED

2021-11-20 Thread Adrian Klaver
On 11/20/21 04:27, Дмитрий Иванов wrote: Good afternoon. Why does pg_dump generate an insertion script in the generated columns? This causes insertion errors. 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 is_inside -

pg_dump insert column GENERATED

2021-11-20 Thread Дмитрий Иванов
Good afternoon. Why does pg_dump generate an insertion script in the generated columns? This causes insertion errors. 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 is_inside - column should be excluded how to do it? INSE