Re: How to restore to empty database

2020-01-30 Thread Andrus
Hi! These days 37 GB is relatively small, so you maybe getting into the realm of premature optimization. Do the 24 databases represent an entire cluster you are trying to transfer? Basically yes. Cluster contains also small test database which actually does not need transferred but I can de

Re: How to restore to empty database

2020-01-30 Thread Adrian Klaver
On 1/30/20 3:08 PM, Andrus wrote: Hi! You need to connect to a database that exists with --dbname, for instance --dbname=postgres. Postgres will then use that connection to create the new database, in your case mydb. Thank you, this seems work. There are total 24 databases, .backup files tot

Re: How to restore to empty database

2020-01-30 Thread Andrus
Hi! You need to connect to a database that exists with --dbname, for instance --dbname=postgres. Postgres will then use that connection to create the new database, in your case mydb. Thank you, this seems work. There are total 24 databases, .backup files total size in 37GB , aprox 60 % from t

Re: ERROR: too many dynamic shared memory segments

2020-01-30 Thread Thomas Munro
On Wed, Jan 29, 2020 at 11:53 PM Thomas Munro wrote: > On Wed, Jan 29, 2020 at 10:37 PM Nicola Contu wrote: > > This is the error on postgres log of the segmentation fault : > > > > 2020-01-21 14:20:29 GMT [] [4]: [108-1] db=,user= LOG: server process > > (PID 2042) was terminated by signal

Re: How to restore to empty database

2020-01-30 Thread Adrian Klaver
On 1/30/20 2:23 PM, Andrus wrote: Hi! I want to restore to new empty database using pg_restore . pg_restore should create new empty database and restore into it. If database exists, pg_restore should clean all data from it or drop and create new empty database before restore. According to pg_

How to restore to empty database

2020-01-30 Thread Andrus
Hi! I want to restore to new empty database using pg_restore . pg_restore should create new empty database and restore into it. If database exists, pg_restore should clean all data from it or drop and create new empty database before restore. According to pg_restore doc, switches --clean --cre

Re: Exclude constraint on ranges : commutative containment : allow only complete containment

2020-01-30 Thread Adrian Klaver
On 1/30/20 9:03 AM, Achilleas Mantzios wrote: Um, that makes my head hurt:) Questions: 1) Are the basic complete budgets and the sub-budgets and super budgets existing in the same table? 2) Depending on answer to 1, to prevent overlap could you not use a form of the example here?: https:

Re: Options for Postgres FDW

2020-01-30 Thread Adrian Klaver
On 1/30/20 1:59 PM, PegoraroF10 wrote: I´m trying to insert/update some tables using FDW. I´m having problems when I want to use default values and triggers. For columns with default values, if I drop that column on foreign table definition is fine for inserts but I cannot use that column for up

Re: Options for Postgres FDW

2020-01-30 Thread Adrian Klaver
On 1/30/20 2:01 PM, PegoraroF10 wrote: Additionally, there is a list of all options for create foreign server and create foreign table ? That is going to depend on the FDW. Options that make sense for connecting to a database make not make sense for a file based FDW. For postgres-fdw see: h

Re: Options for Postgres FDW

2020-01-30 Thread PegoraroF10
Additionally, there is a list of all options for create foreign server and create foreign table ? -- Sent from: https://www.postgresql-archive.org/PostgreSQL-general-f1843780.html

Options for Postgres FDW

2020-01-30 Thread PegoraroF10
I´m trying to insert/update some tables using FDW. I´m having problems when I want to use default values and triggers. For columns with default values, if I drop that column on foreign table definition is fine for inserts but I cannot use that column for updates/selects because it doesn´t exist o

Re: Exclude constraint on ranges : commutative containment : allow only complete containment

2020-01-30 Thread Achilleas Mantzios
On 30/1/20 6:49 μ.μ., Adrian Klaver wrote: On 1/30/20 3:46 AM, Achilleas Mantzios wrote: On 29/1/20 8:32 μ.μ., Adrian Klaver wrote: On 1/29/20 8:12 AM, Achilleas Mantzios wrote: Hello Dear Postgresql ppl, I have a table with date ranges and need to express the following constraint : allow ove

Re: Exclude constraint on ranges : commutative containment : allow only complete containment

2020-01-30 Thread Adrian Klaver
On 1/30/20 3:46 AM, Achilleas Mantzios wrote: On 29/1/20 8:32 μ.μ., Adrian Klaver wrote: On 1/29/20 8:12 AM, Achilleas Mantzios wrote: Hello Dear Postgresql ppl, I have a table with date ranges and need to express the following constraint : allow overlaps only if there is complete containment,

Re: Add column with default value in big table - splitting of updates can help?

2020-01-30 Thread hubert depesz lubaczewski
On Thu, Jan 30, 2020 at 04:51:02PM +0100, Durumdara wrote: > Is there any advance when I split updates? I'm in one transaction. In this case - no. The benefit of split updates is when you're not in single transaction. Why would you want to have it all done in single transaction? Best regards, d

Re: Add column with default value in big table - splitting of updates can help?

2020-01-30 Thread Adrian Klaver
On 1/30/20 7:51 AM, Durumdara wrote: Dear Members! I've read this article, but I need your experience in this theme. https://leopard.in.ua/2016/09/20/safe-and-unsafe-operations-postgresql#.XjL3fcqYXDc alter table tk   add colum field1 default 'MUCH'; The table tk have 200 million rows. The a

Add column with default value in big table - splitting of updates can help?

2020-01-30 Thread Durumdara
Dear Members! I've read this article, but I need your experience in this theme. https://leopard.in.ua/2016/09/20/safe-and-unsafe-operations-postgresql#.XjL3fcqYXDc alter table tk add colum field1 default 'MUCH'; The table tk have 200 million rows. The autovacuum is no problem, only the long u

Re: Exclude constraint on ranges : commutative containment : allow only complete containment

2020-01-30 Thread Achilleas Mantzios
On 29/1/20 8:32 μ.μ., Adrian Klaver wrote: On 1/29/20 8:12 AM, Achilleas Mantzios wrote: Hello Dear Postgresql ppl, I have a table with date ranges and need to express the following constraint : allow overlaps only if there is complete containment, e.g. allow values in rows like : [2020-01-01,2