Re: How to watch for schema changes

2018-09-17 Thread Igor Korot
Hi, On Mon, Sep 17, 2018 at 9:19 PM Christophe Pettus wrote: > > > > On Sep 17, 2018, at 07:09, Igor Korot wrote: > > > > Is there a way to query a server for a place where the log file is? > > SHOW log_directory; > > It's either relative to the PGDATA directory, or an absolute path. And I

Re: How to watch for schema changes

2018-09-17 Thread Christophe Pettus
> On Sep 17, 2018, at 07:09, Igor Korot wrote: > > Is there a way to query a server for a place where the log file is? SHOW log_directory; It's either relative to the PGDATA directory, or an absolute path. -- -- Christophe Pettus x...@thebuild.com

Re: How to watch for schema changes

2018-09-17 Thread Igor Korot
Hi, Melvin, On Tue, Jul 3, 2018 at 2:00 PM Melvin Davidson wrote: > > > > >Unfortunately I'm stuck with 9.1. > > Have you thought about just setting log_statement = 'ddl' in postgresql.conf > and just greping the log for CREATE and ALTER? Is there a way to query a server for a place where the

Re: scram-sha-256 authentication broken in FIPS mode

2018-09-17 Thread Michael Paquier
On Mon, Sep 17, 2018 at 02:55:55PM +, Alessandro Gherardi wrote: > Therefore, I believe the best option, at least for now, is calling > FIPS_mode_set(1) in the application. I am not so sure about that. As you rightly mention, CentOS and RedHat patch OpenSSL to allow FIPS to work. Per my

Re: Too many BitmapAnds in the wild

2018-09-17 Thread Tom Lane
Seamus Abshere writes: > hey, > We see a fair number of incorrectly chosen BitmapAnd plans in the wild at > Faraday... enough that googling the problem ends up at our old posts to this > mailing list 😀. An attractive solution was proposed by Jeff Janes [1] > - *cost += 0.1 *

Re: Logical locking beyond pg_advisory

2018-09-17 Thread marcelo
On 17/09/2018 14:27 , Chris Travers wrote: On Mon, Sep 17, 2018 at 6:04 PM marcelo > wrote: I´m using an ORM (Devart´s) to access the database, so, I cannot "select ... FOR UPDATE". The application paradigm is that a user have a list of

Too many BitmapAnds in the wild

2018-09-17 Thread Seamus Abshere
hey, We see a fair number of incorrectly chosen BitmapAnd plans in the wild at Faraday... enough that googling the problem ends up at our old posts to this mailing list . An attractive solution was proposed by Jeff Janes [1] - *cost += 0.1 * cpu_operator_cost * path->rows; + *cost += 6 *

Re: Why is JSONB field automatically cast as TEXT?

2018-09-17 Thread David G. Johnston
On Monday, September 17, 2018, Ben Uphoff wrote: > > SELECT (((mytable.ajsonbcolumn -> ‘somedata’::text) -> ‘nested’::text) ->> > ‘first_name’::text) AS fname FROM mytable > > It’s casting the untyped literal constants (somedata, neated, first_name) to text because everything must be typed. It

Why is JSONB field automatically cast as TEXT?

2018-09-17 Thread Ben Uphoff
First post here at PostgreSQL; please forgive any etiquette mistakes… I have a query that extracts a field from a JSONB column, e.g.: SELECT (((mytable.ajsonbcolumn -> ‘somedata’) -> ‘nested’) ->> ‘first_name’) AS fname FROM mytable When I save it into a view, PostgreSQL transforms it thusly:

Re: Logical locking beyond pg_advisory

2018-09-17 Thread Chris Travers
On Mon, Sep 17, 2018 at 6:04 PM marcelo wrote: > > > I´m using an ORM (Devart´s) to access the database, so, I cannot "select > ... FOR UPDATE". The application paradigm is that a user have a list of > records (after a query) and she could update or delete any of them as the > business rules

Re: Code of Conduct plan

2018-09-17 Thread Dimitri Maziuk
On 09/17/2018 10:39 AM, Chris Travers wrote: > On Mon, Sep 17, 2018 at 5:28 PM Joshua D. Drake > wrote: ... >> My feedback is that those two sentences provide an overarching authority >> that .Org does not have the right to enforce ... > Fascinating that this would, on its face, not apply to a

Re: Code of Conduct plan

2018-09-17 Thread Chris Travers
On Mon, Sep 17, 2018 at 6:08 PM Steve Litt wrote: > On Mon, 17 Sep 2018 17:39:20 +0200 > Chris Travers wrote: > > > > Exactly. And actually the first sentence is not new. The second one > > is a real problem though. I am going to try one last time at an > > additional alternative. > > > > "

Determine last LSN before promotion?

2018-09-17 Thread Jeremy Finzel
Is there any easy way to determine what the last LSN was prior to promotion, except for (as I understand it), using pg_xlogdump on the .partial WAL file after promotion and find the last LSN? Am I missing something obvious? The question I am trying to answer has to do with replication slots and

Re: Code of Conduct plan

2018-09-17 Thread Steve Atkins
> On Sep 17, 2018, at 4:57 PM, Steve Litt wrote: > > On Mon, 17 Sep 2018 08:27:48 -0700 > "Joshua D. Drake" wrote: > >> >> At this point it is important to accept that the CoC is happening. We >> aren't going to stop that. The goal now is to insure a CoC that is >> equitable for all

Re: Pgbouncer and postgres

2018-09-17 Thread Adrian Klaver
On 9/17/18 9:09 AM, Nicola Contu wrote: Yes I can connect to port 5432 without any problem. The thing is that I am not seeing anything on the postgres log when connecting to 6543. Pretty sure you won't as 6543 is controlled by pgbouncer and pgbouncer seems to be failing before it gets

Re: postgresql api

2018-09-17 Thread Raymond O'Donnell
On 17/09/18 13:31, vyshu Ysh wrote: Hi, I wanted to query from my c# application. Am using npgsql, is there any parameter or api ? select * from pg_stat_replication; Ray. -- Raymond O'Donnell :: Galway :: Ireland r...@iol.ie

Re: Pgbouncer and postgres

2018-09-17 Thread Nicola Contu
Yes I can connect to port 5432 without any problem. The thing is that I am not seeing anything on the postgres log when connecting to 6543. Sure, thanks for your help. I will create an issue there. Il giorno lun 17 set 2018 alle ore 18:07 Adrian Klaver < adrian.kla...@aklaver.com> ha scritto:

Re: Code of Conduct plan

2018-09-17 Thread Steve Litt
On Mon, 17 Sep 2018 17:39:20 +0200 Chris Travers wrote: > Exactly. And actually the first sentence is not new. The second one > is a real problem though. I am going to try one last time at an > additional alternative. > > " To that end, we have established this Code of Conduct for community

Re: Pgbouncer and postgres

2018-09-17 Thread Adrian Klaver
On 9/17/18 8:59 AM, Nicola Contu wrote: Yeah, I replaced the IP of the machine with the word IP_ADDR. On the pgbouncer log I get this while trying to connect via psql: 2018-09-17 15:56:49.452 67611 WARNING tune_socket(16) failed: Operation not supported 2018-09-17 15:56:49.452 67611 NOISE

Re: Logical locking beyond pg_advisory

2018-09-17 Thread marcelo
On 17/09/2018 12:21 , Chris Travers wrote: On Mon, Sep 17, 2018 at 5:09 PM Merlin Moncure > wrote: On Sun, Sep 16, 2018 at 3:53 PM marcelo mailto:marcelo.nico...@gmail.com>> wrote: > > I need a mechanism of "logical locking" more ductile than the

Re: Pgbouncer and postgres

2018-09-17 Thread Nicola Contu
Yeah, I replaced the IP of the machine with the word IP_ADDR. On the pgbouncer log I get this while trying to connect via psql: 2018-09-17 15:56:49.452 67611 WARNING tune_socket(16) failed: Operation not supported 2018-09-17 15:56:49.452 67611 NOISE safe_close(16) = 0 2018-09-17 15:56:49.452

Re: Code of Conduct plan

2018-09-17 Thread Steve Litt
On Mon, 17 Sep 2018 08:27:48 -0700 "Joshua D. Drake" wrote: > On 09/17/2018 08:11 AM, Dmitri Maziuk wrote: > > On Sun, 16 Sep 2018 12:52:34 + > > Martin Mueller wrote: > > > >> ... The overreach is dubious on both practical and theoretical > >> grounds. "Stick to your knitting " or the

Re: Pgbouncer and postgres

2018-09-17 Thread Adrian Klaver
On 9/17/18 8:39 AM, Nicola Contu wrote: Please reply to list also. Ccing list. No wait, IP_ADDR has been modified by me, but there is the IP of the machine 10.151.x. To be clear in your posts you are replacing the actual IP with IP_ADDR, correct? Here is the psql command .

Re: Code of Conduct plan

2018-09-17 Thread Chris Travers
On Mon, Sep 17, 2018 at 5:28 PM Joshua D. Drake wrote: > On 09/17/2018 08:11 AM, Dmitri Maziuk wrote: > > On Sun, 16 Sep 2018 12:52:34 + > Martin Mueller > wrote: > > > ... The overreach is dubious on both practical and theoretical grounds. > "Stick to your knitting " or the KISS

Re: Pgbouncer and postgres

2018-09-17 Thread Adrian Klaver
On 9/17/18 7:26 AM, Nicola Contu wrote: [Mon Sep 17 10:24:59.041589 2018] [php7:notice] [pid 63893:tid 140586929567488] [client 10.160.41.3:51764 ] PHP WARNING: pg_connect(): Unable to connect to PostgreSQL server: could not connect to server: Connection refused\n\tIs

Re: Code of Conduct plan

2018-09-17 Thread Joshua D. Drake
On 09/17/2018 08:11 AM, Dmitri Maziuk wrote: On Sun, 16 Sep 2018 12:52:34 + Martin Mueller wrote: ... The overreach is dubious on both practical and theoretical grounds. "Stick to your knitting " or the KISS principle seem good advice in this context. Moderated mailing lists ain't been

Re: Logical locking beyond pg_advisory

2018-09-17 Thread Chris Travers
On Mon, Sep 17, 2018 at 5:09 PM Merlin Moncure wrote: > On Sun, Sep 16, 2018 at 3:53 PM marcelo wrote: > > > > I need a mechanism of "logical locking" more ductile than the > pg_advisory family. > > I'm thinking of a table ("lock_table") that would be part of the > database, with columns > > *

Re: Code of Conduct plan

2018-09-17 Thread Dmitri Maziuk
On Sun, 16 Sep 2018 12:52:34 + Martin Mueller wrote: > ... The overreach is dubious on both practical and theoretical grounds. > "Stick to your knitting " or the KISS principle seem good advice in this > context. Moderated mailing lists ain't been broken all these years, therefore they

Re: Logical locking beyond pg_advisory

2018-09-17 Thread Merlin Moncure
On Sun, Sep 16, 2018 at 3:53 PM marcelo wrote: > > I need a mechanism of "logical locking" more ductile than the pg_advisory > family. > I'm thinking of a table ("lock_table") that would be part of the database, > with columns > * tablename varchar - name of the table "locked" > * rowid

Re: scram-sha-256 authentication broken in FIPS mode

2018-09-17 Thread Alessandro Gherardi
Here's a patch for enabling FIPS in OpenSSL - by calling FIPS_mode_set(1) - on Windows if the FIPS registry entry HKLM\System\CurrentControlSet\Control\Lsa\FipsAlgorithmPolicy\Enabled is set to 1. That's the entry that the .NET crypto libraries look at to decide whether or not to operate in

Re: Pgbouncer and postgres

2018-09-17 Thread Nicola Contu
The log is from pgbouncer. I installed updates after this problem, but they did not resolve anything. I compiled 1.9.0 from source on the same path of the previous one. Then back to 1.8.1 on the same path. I also tried changing the listening port on pgbouncer, but that does not change too much.

Re: Pgbouncer and postgres

2018-09-17 Thread Nicola Contu
[Mon Sep 17 10:24:59.041589 2018] [php7:notice] [pid 63893:tid 140586929567488] [client 10.160.41.3:51764] PHP WARNING: pg_connect(): Unable to connect to PostgreSQL server: could not connect to server: Connection refused\n\tIs the server running on host IP_ADDR and accepting\n\tTCP/IP connections

Re: Pgbouncer and postgres

2018-09-17 Thread Adrian Klaver
On 9/17/18 7:19 AM, Nicola Contu wrote: I'm not aware of any update installed. There were like 600+ updates in fact. These are the logs when connecting via telnet : How about those from when Apache tries to connect and pgbouncer crashes? Connection closed by foreign host. -- Adrian

Re: postgresql api

2018-09-17 Thread vyshu Ysh
Hi, I wanted to query from my c# application. Am using npgsql, is there any parameter or api ? On Mon, 17 Sep 2018, 5:22 pm Enrico Pirozzi, wrote: > Hi, > > Have you tried to query the pg_stat_replication? > > > Enrico > > > Il lun 17 set 2018, 11:52 vyshu Ysh ha scritto: > >> Hi Team, >> >>

Re: Pgbouncer and postgres

2018-09-17 Thread Nicola Contu
I'm not aware of any update installed. There were like 600+ updates in fact. These are the logs when connecting via telnet : 2018-09-17 14:18:18.933 65617 NOISE safe_accept(11) = 14 (10.151.2.145:39478 ) 2018-09-17 14:18:18.933 65617 NOISE new fd from accept=14 2018-09-17 14:18:18.933 65617

Re: Pgbouncer and postgres

2018-09-17 Thread Adrian Klaver
On 9/17/18 7:05 AM, Nicola Contu wrote: The log is from pgbouncer. I installed updates after this problem, but they did not resolve anything. I was thinking more of updates that where done between the last time it worked and the time it started failing. Along that line, when was the last

Re: Pgbouncer and postgres

2018-09-17 Thread Adrian Klaver
On 9/17/18 5:33 AM, Nicola Contu wrote: Hello, I'm trying to get pgbouncer working but I'm getting this error : What is generating the log below? To me it looks like everything is on track until this: 2018-09-17 12:21:48.917 88424 WARNING tune_socket(13) failed: Operation not supported

Pgbouncer and postgres

2018-09-17 Thread Nicola Contu
Hello, I'm trying to get pgbouncer working but I'm getting this error : 2018-09-17 12:20:15.304 87772 NOISE safe_accept(12) = Resource temporarily unavailable 2018-09-17 12:20:36.183 87772 NOISE safe_accept(11) = 13 (127.0.0.1:59100) 2018-09-17 12:20:36.183 87772 NOISE new fd from accept=13

Pgbouncer and postgres

2018-09-17 Thread Nicola Contu
Hello, I'm trying to get pgbouncer working but I'm getting this error : 2018-09-17 12:20:15.304 87772 NOISE safe_accept(12) = Resource temporarily unavailable 2018-09-17 12:20:36.183 87772 NOISE safe_accept(11) = 13 (127.0.0.1:59100) 2018-09-17 12:20:36.183 87772 NOISE new fd from accept=13

Re: postgresql api

2018-09-17 Thread Enrico Pirozzi
Hi, Have you tried to query the pg_stat_replication? Enrico Il lun 17 set 2018, 11:52 vyshu Ysh ha scritto: > Hi Team, > > Is there any postgresql API which tells when the master/standby server is > down ? > > Thanks, > Sudha >

Re: Logical locking beyond pg_advisory

2018-09-17 Thread marcelo
/Would be nice if you explain more about what kind of problem you want to solve./ There are two main questions "to solve" a) generally speaking, I like to get some form of "exclusive access" to the row before updating or deleting. None of the optimistic / pesimistic automatic variants of

postgresql api

2018-09-17 Thread vyshu Ysh
Hi Team, Is there any postgresql API which tells when the master/standby server is down ? Thanks, Sudha

Re: Logical locking beyond pg_advisory

2018-09-17 Thread Fabrízio de Royes Mello
Em dom, 16 de set de 2018 às 17:53, marcelo escreveu: > > I need a mechanism of "logical locking" more ductile than the pg_advisory family. > I'm thinking of a table ("lock_table") that would be part of the database, with columns > * tablename varchar - name of the table "locked" > * rowid