Re: Errors with schema migration and logical replication — expected?

2018-12-12 Thread Mike Lissner
Thanks Adrian for all the help. I filed this as bug #15549. I hope this all helps get logical replication into the "Running" stage. On Wed, Dec 12, 2018 at 5:06 PM Adrian Klaver wrote: > On 12/12/18 3:19 PM, Mike Lissner wrote: > > This sounds *very* plausible. So I think there are a few

Re: Errors with schema migration and logical replication — expected?

2018-12-12 Thread Adrian Klaver
On 12/12/18 3:19 PM, Mike Lissner wrote: This sounds *very* plausible. So I think there are a few takeaways: 1. Should the docs mention that additive changes with NOT NULL constraints are bad? It's not the NOT NULL it's the lack of a DEFAULT. In general a column with a NOT NULL and no

Re: explain analyze cost

2018-12-12 Thread Ravi Krishna
> Please do not hijack other threads by replying to a message and > changing> the subject. Just send a new mail to > pgsql-general@lists.postgresql.org, or whatever list you want > to send an> email to. > I am truly sorry and this will not be repeated. I was just lazy. I guess this would break

Re: postgresql10-server RPM unpacking of archive failed

2018-12-12 Thread Chris Mair
on a CentOS 7.5 machine with PostgreSQL 10.3 installed from the PGDG yum repo, I have a strange error when trying to update to 10.6. A simple "yum update" updated everything except postgresql10-server.x86_64! That package gives (repeatedly) the error message: Error unpacking rpm package

Re: psql output in Japanese Code Page

2018-12-12 Thread Tatsuo Ishii
> Hi, > > While under Code Page 932 (=Japanese) the old PSQL 9.5.5 - used to talk plain > English, like in \d > > This behavior has changed in PSQL 10. We are now forced to run "chcp 1252" > before any PSQL activity. > > Does anyone know about it? Any suggestions? > > I tried \encoding

Re: Errors with schema migration and logical replication — expected?

2018-12-12 Thread Mike Lissner
This sounds *very* plausible. So I think there are a few takeaways: 1. Should the docs mention that additive changes with NOT NULL constraints are bad? 2. Is there a way this could work without completely breaking replication? For example, should Postgresql realize replication can't work in this

Re: explain analyze cost

2018-12-12 Thread Andres Freund
On 2018-12-12 17:37:47 -0500, Ravi Krishna wrote: > I am running explain analyze cost on a SQL which reads from two large > tables (122mil and 37 mil). The query is an UPDATE SQL where we use > derives table in the from clause and then join it back to the table > being updated. > The explain

Re: explain analyze cost

2018-12-12 Thread Ron
On 12/12/2018 04:37 PM, Ravi Krishna wrote: I am running explain analyze cost on a SQL which reads from two large tables (122mil and 37 mil).  The query is an UPDATE SQL where we use derives table in the from clause and then join it back to the table being updated. The explain analyze cost

explain analyze cost

2018-12-12 Thread Ravi Krishna
I am running explain analyze cost on a SQL which reads from two large tables (122mil and 37 mil). The query is an UPDATE SQL where we use derives table in the from clause and then join it back to the table being updated. The explain analyze cost itself is taking forever to run. It is running for

Re: Does PostgreSQL use atomic file creation of FS?

2018-12-12 Thread Thomas Munro
On Wed, Dec 12, 2018 at 11:52 PM Dmitry Lazurkin wrote: > Thank you. But I have read this. I said about network file system only > for example. I would like to known how PostgreSQL handles this specific > case (of course if someone knowns a answer): > > fd = open(file, "w"); > write(fd, data); >

Re: Does PostgreSQL use atomic file creation of FS?

2018-12-12 Thread Laurenz Albe
Dmitry Lazurkin wrote: > Does PostgreSQL use atomic file creation on FS? How does PostgreSQL > catch situation when system crashes between open call and write call? I > am interesting in this because I would like use PostgreSQL on network > file system. If there is a crash, the file would be left

psql output in Japanese Code Page

2018-12-12 Thread Abraham, Danny
Hi, While under Code Page 932 (=Japanese) the old PSQL 9.5.5 - used to talk plain English, like in \d This behavior has changed in PSQL 10. We are now forced to run "chcp 1252" before any PSQL activity. Does anyone know about it? Any suggestions? I tried \encoding WIN1252. Did not work.

Re: Idle connections / sessions

2018-12-12 Thread Thomas Poty
Sorry but i don't know (i am not familiar with aws) Maybe this will help: If you want pg_terminator can run on postgresql server. Regards Thomas Le mer. 12 déc. 2018 à 12:20, Oygun Josef a écrit : > Hi, > > > > Sorry for that! > > > > Thank you for the answers, this is good but do you

Re: Code for getting particular day of week number from month

2018-12-12 Thread Andrew Gierth
> "Mike" == Mike Martin writes: Mike> Hi Mike> For a particular sequence I needed to do (schedule 2nd monday in Mike> month for coming year) I created the following query That doesn't look like the best way - you're generating and discarding a lot of rows. "second monday in month X"

Stack Builder for pgAgent on Production

2018-12-12 Thread Srinivas
Hello, I am working towards creating scheduled jobs in PostgreSQL database server. During the process of creating jobs, i need to install pgAgent and for this i am using Stack Builder to install the pgAgent component My concern/question here is *Can we use stack builder for pgAgent on

Re: REVOKE to an user that doesn't exist

2018-12-12 Thread Moreno Andreo
Il 12/12/2018 16:01, Tom Lane ha scritto: Moreno Andreo writes: I'm trying to pg_upgrade a cluster from 9.1 to 10 (Windows 10, but I don't think it matters). At a certain point an error is thrown while parsing a trigger: could not execute query: ERROR:  role "1067431" does not exist command

Re: Errors with schema migration and logical replication — expected?

2018-12-12 Thread Adrian Klaver
On 12/12/18 12:15 AM, Mike Lissner wrote: On Tue, Dec 11, 2018 at 3:10 PM Adrian Klaver > wrote: >     Well, I was able to fix this by briefly allowing nulls on the >     subscriber, letting it catch up with the publisher, setting all >     

Re: REVOKE to an user that doesn't exist

2018-12-12 Thread Moreno Andreo
Il 12/12/2018 15:39, Adrian Klaver ha scritto: On 12/12/18 5:11 AM, Moreno Andreo wrote: Hi all, I'm trying to pg_upgrade a cluster from 9.1 to 10 (Windows 10, but I don't think it matters). At a certain point an error is thrown while parsing a trigger: could not execute query: ERROR: 

Re: REVOKE to an user that doesn't exist

2018-12-12 Thread Tom Lane
Moreno Andreo writes: > I'm trying to pg_upgrade a cluster from 9.1 to 10 (Windows 10, but I > don't think it matters). > At a certain point an error is thrown while parsing a trigger: > could not execute query: ERROR:  role "1067431" does not exist > command was: REVOKE ALL ON FUNCTION "x"()

Re: Debian : No echo after pg_dump | psql

2018-12-12 Thread Adrian Klaver
On 12/12/18 4:51 AM, Moreno Andreo wrote: Adrian, Andrew, thanks and apologies for the late reply Il 30/11/2018 05:08, Andrew Gierth ha scritto: "Moreno" == Moreno Andreo writes:   Moreno> The command I'm using is   Moreno> root@x:~# pg_dump -v -C -h -p 6543 -U postgres   Moreno> |

Re: REVOKE to an user that doesn't exist

2018-12-12 Thread Adrian Klaver
On 12/12/18 5:11 AM, Moreno Andreo wrote: Hi all, I'm trying to pg_upgrade a cluster from 9.1 to 10 (Windows 10, but I don't think it matters). At a certain point an error is thrown while parsing a trigger: could not execute query: ERROR:  role "1067431" does not exist command was: REVOKE

why would postgres be throttling a streaming replication slot's sending?

2018-12-12 Thread Chris Withers
On 11/12/2018 14:48, Achilleas Mantzios wrote: On 11/12/18 4:00 μ.μ., Chris Withers wrote: I'm looking after a multi-tenant PG 9.4 cluster, and we've started getting alerts for the number of WALs on the server. It'd be great to understand what's generating all that WAL and what's likely to

REVOKE to an user that doesn't exist

2018-12-12 Thread Moreno Andreo
Hi all, I'm trying to pg_upgrade a cluster from 9.1 to 10 (Windows 10, but I don't think it matters). At a certain point an error is thrown while parsing a trigger: could not execute query: ERROR:  role "1067431" does not exist command was: REVOKE ALL ON FUNCTION "x"() FROM PUBLIC; GRANT

Re: Debian : No echo after pg_dump | psql

2018-12-12 Thread Moreno Andreo
Adrian, Andrew, thanks and apologies for the late reply Il 30/11/2018 05:08, Andrew Gierth ha scritto: "Moreno" == Moreno Andreo writes: Moreno> The command I'm using is Moreno> root@x:~# pg_dump -v -C -h -p 6543 -U postgres Moreno> | psql -h localhost -p 6543 -U postgres

Re: Does PostgreSQL use atomic file creation of FS?

2018-12-12 Thread Dmitry Lazurkin
Thank you. But I have read this. I said about network file system only for example. I would like to known how PostgreSQL handles this specific case (of course if someone knowns a answer): fd = open(file, "w"); write(fd, data); // crash and now I have empty file which isn't correct fsync(fd); PS.

Re: Does PostgreSQL use atomic file creation of FS?

2018-12-12 Thread Karsten Hilbert
On Wed, Dec 12, 2018 at 02:48:12PM +0300, Dmitry Lazurkin wrote: > Does PostgreSQL use atomic file creation on FS? How does PostgreSQL > catch situation when system crashes between open call and write call? I > am interesting in this because I would like use PostgreSQL on network > file system.

Does PostgreSQL use atomic file creation of FS?

2018-12-12 Thread Dmitry Lazurkin
Hello. Does PostgreSQL use atomic file creation on FS? How does PostgreSQL catch situation when system crashes between open call and write call? I am interesting in this because I would like use PostgreSQL on network file system. Thank you.

SV: Idle connections / sessions

2018-12-12 Thread Oygun Josef
Hi, Sorry for that! Thank you for the answers, this is good but do you know if there is a way do to it through AWS console with some kind of configuration instead? Reason for that is the we use terraform scripts to create and keep state of our instances so pg_terminator would require me to

Re: Idle connections / sessions

2018-12-12 Thread Thomas Poty
Hi Josef, pg_terminator may help you. thomas Le mer. 12 déc. 2018 à 11:02, Fabio Pardi a écrit : > Hi Josef, > > please avoid cross posting to multiple lists. > > I m not a developer, but I think that if you do not want idle connections, > you should terminate them on the side they have been

Re: Idle connections / sessions

2018-12-12 Thread Fabio Pardi
Hi Josef, please avoid cross posting to multiple lists. I m not a developer, but I think that if you do not want idle connections, you should terminate them on the side they have been created. If your application leaves the connection open, then you will notice idle connections on Postgres

Idle connections / sessions

2018-12-12 Thread Oygun Josef
Hi, Is it possible to terminate idle connections/sessions automatically through a timeout in AWS or do I need to run a periodical cron job for this? Postgres version: 9.6.6 Instance: db.t2.micro RAM : 1GB We are running a microservice architecture using docker with kubernetes and I can see

Re: Errors with schema migration and logical replication — expected?

2018-12-12 Thread Mike Lissner
On Tue, Dec 11, 2018 at 3:10 PM Adrian Klaver wrote: > > > Well, I was able to fix this by briefly allowing nulls on the > > subscriber, letting it catch up with the publisher, setting all > > nulls to empty strings (a Django convention), and then disallowing > > nulls again.