Partitioning an existing table - pg10.6

2019-07-03 Thread Ayub M
Hello, I am using postgres 10.6 and have a huge table with ~30m recs which needs to be partitioned. Whats the best strategy for it with minimal downtime? 1. Rename existing table and create new partitioned tables with orig name and keep inserting data from the old renamed to new table. This will i

Re: multiple nodes in FDW create server statement

2019-07-03 Thread Laurenz Albe
Vijaykumar Jain wrote: > We are glad that we have this feature that allows us to load balance reads. > that has helped us a lot. > https://paquier.xyz/postgresql-2/postgres-10-multi-host-connstr/ > > I would like to know if it is possible to request a similar enhancement to > FDWs too? > https://

Re: [External] Re: multiple nodes in FDW create server statement

2019-07-03 Thread Vijaykumar Jain
awesomeness. Thanks Laurenz. Regards, Vijay On Wed, Jul 3, 2019 at 12:48 PM Laurenz Albe wrote: > Vijaykumar Jain wrote: > > We are glad that we have this feature that allows us to load balance > reads. > > that has helped us a lot. > > https://paquier.xyz/postgresql-2/postgres-10-multi-host-c

refresh materialized view concurrently alternatives

2019-07-03 Thread Zsolt Ero
Hi, I'm using refresh materialized view concurrently at the moment. I have a few problems with it: 1. It requires adding a unique index, even if it's never actually used. This can just create wasted space and bad cache utilization. 2. It locks the table so that two refresh commands cannot be run

Re: Partitioning an existing table - pg10.6

2019-07-03 Thread Achilleas Mantzios
On 3/7/19 10:01 π.μ., Ayub M wrote: Hello, I am using postgres 10.6 and have a huge table with ~30m recs which needs to be partitioned. Whats the best strategy for it with minimal downtime? 1. Rename existing table and create new partitioned tables with orig name and keep inserting data from t

Re: Partitioning an existing table - pg10.6

2019-07-03 Thread legrand legrand
Hello, I didn’t test it myself but maybe using logical réplication could help ... See https://www.postgresql.org/docs/10/logical-replication.html Operations - create parttable - Feed it using réplication - when sync : stop app, stop réplication, rename tables - maybe you can réplicate from part

Too short field

2019-07-03 Thread Karl Martin Skoldebrand
Hi, We solved the problem of yesterday where I was looking at sequences. It eventually turned that sequence was irrelevant (at least in the PostgreSQL sense) to the problem. Now, we have a bug in another application that prevents an automatic tool to enter certain users in the database. The org

Re: Too short field

2019-07-03 Thread Thomas Kellerer
Karl Martin Skoldebrand schrieb am 03.07.2019 um 13:30: > Now, we have a bug in another application that prevents an automatic > tool to enter certain users in the database. The organisational field > is varchar(60) while the actual Organisation “abbreviation” may be as > long as 70 characters (don

RE: Too short field

2019-07-03 Thread Karl Martin Skoldebrand
Thanks. That is what I thought - good to have a confirmation. Best regards, Martin S Disclaimer: This message and the information contained herein is proprietary and c

Re: Too short field

2019-07-03 Thread Karsten Hilbert
On Wed, Jul 03, 2019 at 01:56:03PM +0200, Thomas Kellerer wrote: > Karl Martin Skoldebrand schrieb am 03.07.2019 um 13:30: > > Now, we have a bug in another application that prevents an automatic > > tool to enter certain users in the database. The organisational field > > is varchar(60) while the

Re: Too short field

2019-07-03 Thread Karsten Hilbert
On Wed, Jul 03, 2019 at 02:10:55PM +0200, Karsten Hilbert wrote: > > Karl Martin Skoldebrand schrieb am 03.07.2019 um 13:30: > > > Now, we have a bug in another application that prevents an automatic > > > tool to enter certain users in the database. The organisational field > > > is varchar(60) w

RE: Too short field

2019-07-03 Thread Karl Martin Skoldebrand
Valid point. I've added that to the report. Best regards, Martin Skjoldebrand Disclaimer: This message and the information contained herein is proprietary and confide

Error updating column of type text as boolean type

2019-07-03 Thread Marllius
Hi guys, I was looking datatype bugs for postgresql 10.6 but i not found anything. I am trying to update the column of type text column but i get an error for boolean type. In other tables the behavior of the text type column is normal. Has anyone had this problem before? accounting@accounting=>

Re: Error updating column of type text as boolean type

2019-07-03 Thread John McKown
On Wed, Jul 3, 2019 at 10:09 AM Marllius wrote: > Hi guys, I was looking datatype bugs for postgresql 10.6 but i not found > anything. > > I am trying to update the column of type text column but i get an error > for boolean type. In other tables the behavior of the text type column is > normal.

Re: Error updating column of type text as boolean type

2019-07-03 Thread Marllius
Tank you Mckown. Em qua, 3 de jul de 2019 às 12:15, John McKown escreveu: > On Wed, Jul 3, 2019 at 10:09 AM Marllius wrote: > >> Hi guys, I was looking datatype bugs for postgresql 10.6 but i not found >> anything. >> >> I am trying to update the column of type text column but i get an error >>

Re: postgres 11 issue?

2019-07-03 Thread Steve Rogerson
> It seems a bug to me. Can you share an anonymized/simplified definition > of that table that reproduces the problem? > Ok See attached sql set up. I guess you need to to a createdb first. so : testdb=# \i db.sql DROP TRIGGER DROP TABLE ... testdb=# select * from user_passwords ;  name | times

Re: postgres 11 issue?

2019-07-03 Thread Adrian Klaver
On 7/3/19 9:42 AM, Steve Rogerson wrote: It seems a bug to me. Can you share an anonymized/simplified definition of that table that reproduces the problem? Ok See attached sql set up. I guess you need to to a createdb first. so : testdb=# \i db.sql DROP TRIGGER DROP TABLE ... testdb=# sele

Re: postgres 11 issue?

2019-07-03 Thread Tom Lane
Steve Rogerson writes: >> It seems a bug to me. Can you share an anonymized/simplified definition >> of that table that reproduces the problem? > Ok See attached sql set up. I guess you need to to a createdb first. It looks like what's happening is that the result of my_from_local() is being sto

Allocating shared memory in Postgres

2019-07-03 Thread Souvik Bhattacherjee
Hi, I need to allocate shared memory in Postgres 11.0 outside the initialization phase. In order to achieve this I have done the following: - increased the amount of shared memory by increasing the value of size in CreateSharedMemoryAndSemaphores (int port) in ipci.c. I have made sure that the am

Re: Allocating shared memory in Postgres

2019-07-03 Thread Tom Lane
Souvik Bhattacherjee writes: > I need to allocate shared memory in Postgres 11.0 outside the > initialization phase. In order to achieve this I have done the following: > - during a particular query, where I need to allocate shared memory (which > is a function of the sizes of the tables in the qu

Re: postgres 11 issue?

2019-07-03 Thread Tom Lane
I wrote: > It looks like what's happening is that the result of my_from_local() > is being stored into the table as an anonymous record value rather > than a value of type my_timestamp. (The originating session can figure > out what the anonymous record type is, but no other session can.) I pushe

Re: Too short field

2019-07-03 Thread Gavin Flower
On 03/07/2019 23:30, Karl Martin Skoldebrand wrote: Hi, We solved the problem of yesterday where I was looking at sequences. It eventually turned that sequence was irrelevant (at least in the PostgreSQL sense) to the problem. Now, we have a bug in another application that prevents an automa

Re: Allocating shared memory in Postgres

2019-07-03 Thread Souvik Bhattacherjee
For starters, what happens if two backends do this concurrently? > I'm assuming here that a single backend process handles all queries from a given client. In case of parallel queries, the master process will be responsible for allocating the shared memory and not the workers. Please let me know i