Re: Missing rows after migrating from postgres 11 to 12 with logical replication

2020-12-23 Thread Lars Vonk
The full setup is: **Before: 11 primary -> 11 hotstandby binary **During migration 11 primary -> 11 hotstandby binary | -> 12 new instance via logical |-> 12 new replica via binary **After migration 12 primary |-> 12 replica via binary On Tue, Dec 22, 2020 at 7:16 PM Adrian Klaver

SV: SV: SV: SV: Problem with ssl and psql in Postgresql 13

2020-12-23 Thread Gustavsson Mikael
Hi, I did a final test before logging out for Christmas because i found a thread in hackers discussing some issue with GSS and SSL. So if i set gssencmode=disable on my pgsql-13 to postgres 13 server connection i get an SSL connection. Is this expected behaviour? $ /usr/pgsql-13/bin/psql "

Re: Information schema sql_identifier

2020-12-23 Thread Adrian Klaver
On 12/22/20 11:21 PM, Laurenz Albe wrote: On Tue, 2020-12-22 at 16:07 -0800, Adrian Klaver wrote: This came up in this SO question: https://stackoverflow.com/questions/65416748/postgres-12-4-gives-function-does-not-exists-error Where the query is: SELECT (TABLE_SCHEMA || '"."' || TABLE_NAME)

Re: SV: SV: SV: SV: Problem with ssl and psql in Postgresql 13

2020-12-23 Thread Tom Lane
Gustavsson Mikael writes: > I did a final test before logging out for Christmas because i found a thread > in hackers discussing some issue with GSS and SSL. > So if i set gssencmode=disable on my pgsql-13 to postgres 13 server > connection i get an SSL connection. Oooh ... that's the missing i

Re: SV: SV: SV: SV: Problem with ssl and psql in Postgresql 13

2020-12-23 Thread Tom Lane
I wrote: > Gustavsson Mikael writes: >> So if i set gssencmode=disable on my pgsql-13 to postgres 13 server >> connection i get an SSL connection. > It looks like, if there is a credentials cache and gssencmode isn't > explicitly disabled, we try GSS first. If the server refuses that: > ... > t

Re: Problem with ssl and psql in Postgresql 13

2020-12-23 Thread Stephen Frost
Greetings, * Tom Lane (t...@sss.pgh.pa.us) wrote: > I wrote: > > Gustavsson Mikael writes: > >> So if i set gssencmode=disable on my pgsql-13 to postgres 13 server > >> connection i get an SSL connection. > > > It looks like, if there is a credentials cache and gssencmode isn't > > explicitly d

Re: Problem with ssl and psql in Postgresql 13

2020-12-23 Thread Tom Lane
Stephen Frost writes: > * Tom Lane (t...@sss.pgh.pa.us) wrote: >> However: it is true (and undocumented, so we have at least a docs bug >> to fix) that v12-and-later libpq will try for GSS encryption first, >> and if it succeeds then it will not consider using SSL, regardless of >> sslmode. So ab

Re: Problem with ssl and psql in Postgresql 13

2020-12-23 Thread Stephen Frost
Greetings, * Tom Lane (t...@sss.pgh.pa.us) wrote: > Stephen Frost writes: > > * Tom Lane (t...@sss.pgh.pa.us) wrote: > >> However: it is true (and undocumented, so we have at least a docs bug > >> to fix) that v12-and-later libpq will try for GSS encryption first, > >> and if it succeeds then it

Re: Problem with ssl and psql in Postgresql 13

2020-12-23 Thread Tom Lane
Stephen Frost writes: > * Tom Lane (t...@sss.pgh.pa.us) wrote: >> In the meantime, I did spot a code path that would explain the symptoms: >> pqsecure_open_gss() clears allow_ssl_try sooner than it oughta. If >> gss_wrap_size_limit() failed for some reason, we'd abandon the GSS >> connection and

Re: Problem with ssl and psql in Postgresql 13

2020-12-23 Thread Tom Lane
Oh ... wait a second. I've just managed to partially reproduce this report. Assume that we have a working Kerberos environment on both ends. Then libpq will establish a connection with GSS encryption and continue on with the usual PG authentication exchange. If that part fails, then this logic

bitmap heap scan exact/lossy blocks and row removal

2020-12-23 Thread Augusto Callejas
I created a GIN index on the following relation and ran an EXPLAIN query on a query, and noticed that despite all heap blocks being exact, that the outermost bitmap heap scan removed 62 rows after recheck. My understanding (mainly from https://paquier.xyz/postgresql-2/postgres-9-4-feature-highlight

Re: bitmap heap scan exact/lossy blocks and row removal

2020-12-23 Thread Tom Lane
Augusto Callejas writes: > I created a GIN index on the following relation and ran an EXPLAIN query on > a query, and noticed that despite all heap blocks being exact, that the > outermost bitmap heap scan removed 62 rows after recheck. My understanding > (mainly from > https://paquier.xyz/postgre

Range search on primary key does not use index scan

2020-12-23 Thread Shantanu Shekhar
I am trying to understand how Postgres uses index and ran into a surprising behavior if someone can help me with. I have a table like so: CREATE TABLE testschema.employees (        employee_id integer not null, first_name  varchar(1000) not null, last_name   varchar(1000) not null, date_of_birth

Re: Range search on primary key does not use index scan

2020-12-23 Thread Tom Lane
Shantanu Shekhar writes: > (2) Here I am searching for employee_id < 123. I was expecting the plan would > use the index on employees_pk to find all leaf nodes where employee_id < 123 > and then issue read of table blocks for each of the matching entries in the > index leaf. But looks like the

Is there a good discussion of optimizations?

2020-12-23 Thread Guyren Howe
I’d like to put together a good video and writeup about what the… philosophy behind relational databases is. Most folks, in my experience, who use relational databases don’t really understand the basic theory or even more important the why — the philosophy — of what a relational database is and

Re: Problem with ssl and psql in Postgresql 13

2020-12-23 Thread Kyotaro Horiguchi
At Wed, 23 Dec 2020 17:34:05 -0500, Tom Lane wrote in > Oh ... wait a second. I've just managed to partially reproduce this > report. Assume that we have a working Kerberos environment on both If I kninit'ed and pg_hba.conf doesn't have a hostgssenc line and has a hostssl line, I got the follo

Re: Problem with ssl and psql in Postgresql 13

2020-12-23 Thread Tom Lane
Kyotaro Horiguchi writes: > At Wed, 23 Dec 2020 17:34:05 -0500, Tom Lane wrote in >> However, in the tests Mikael ran after backing that pg_hba.conf entry >> off to just "host", pg_hba wouldn't have caused an authentication-stage >> failure, so it's not so clear why we'd have looped back at this

Re: Is there a good discussion of optimizations?

2020-12-23 Thread Bruce Momjian
On Wed, Dec 23, 2020 at 05:55:57PM -0800, Guyren Howe wrote: > I’d be interested in any comments anyone has about useful things to discuss > here, and in particular I’m interested in an accessible discussion of the > sorts > of query optimizations Postgres can do for us. I have a few talks on thi