pgsql: Block ALTER TABLE .. DROP NOT NULL on columns in replica identit

2021-11-24 Thread Michael Paquier
Block ALTER TABLE .. DROP NOT NULL on columns in replica identity index Replica identities that depend directly on an index rely on a set of properties, one of them being that all the columns defined in this index have to be marked as NOT NULL. There was a hole in the logic with ALTER TABLE DROP

pgsql: Block ALTER TABLE .. DROP NOT NULL on columns in replica identit

2021-11-24 Thread Michael Paquier
Block ALTER TABLE .. DROP NOT NULL on columns in replica identity index Replica identities that depend directly on an index rely on a set of properties, one of them being that all the columns defined in this index have to be marked as NOT NULL. There was a hole in the logic with ALTER TABLE DROP

pgsql: Block ALTER TABLE .. DROP NOT NULL on columns in replica identit

2021-11-24 Thread Michael Paquier
Block ALTER TABLE .. DROP NOT NULL on columns in replica identity index Replica identities that depend directly on an index rely on a set of properties, one of them being that all the columns defined in this index have to be marked as NOT NULL. There was a hole in the logic with ALTER TABLE DROP

pgsql: Block ALTER TABLE .. DROP NOT NULL on columns in replica identit

2021-11-24 Thread Michael Paquier
Block ALTER TABLE .. DROP NOT NULL on columns in replica identity index Replica identities that depend directly on an index rely on a set of properties, one of them being that all the columns defined in this index have to be marked as NOT NULL. There was a hole in the logic with ALTER TABLE DROP

pgsql: Block ALTER TABLE .. DROP NOT NULL on columns in replica identit

2021-11-24 Thread Michael Paquier
Block ALTER TABLE .. DROP NOT NULL on columns in replica identity index Replica identities that depend directly on an index rely on a set of properties, one of them being that all the columns defined in this index have to be marked as NOT NULL. There was a hole in the logic with ALTER TABLE DROP

pgsql: Block ALTER TABLE .. DROP NOT NULL on columns in replica identit

2021-11-24 Thread Michael Paquier
Block ALTER TABLE .. DROP NOT NULL on columns in replica identity index Replica identities that depend directly on an index rely on a set of properties, one of them being that all the columns defined in this index have to be marked as NOT NULL. There was a hole in the logic with ALTER TABLE DROP

pgsql: Fix fstat() emulation on Windows with standard streams

2021-11-24 Thread Michael Paquier
Fix fstat() emulation on Windows with standard streams The emulation of fstat() in win32stat.c caused two issues with the existing in-core callers, failing on EINVAL when using a stream as argument: - psql's \copy would crash when using a stream. - pg_recvlogical would fail with -f -. The tests i

pgsql: Fix fstat() emulation on Windows with standard streams

2021-11-24 Thread Michael Paquier
Fix fstat() emulation on Windows with standard streams The emulation of fstat() in win32stat.c caused two issues with the existing in-core callers, failing on EINVAL when using a stream as argument: - psql's \copy would crash when using a stream. - pg_recvlogical would fail with -f -. The tests i

Re: pgsql: xlog.c: Remove global variables ReadRecPtr and EndRecPtr.

2021-11-24 Thread Andres Freund
Hi, On 2021-11-24 15:12:06 -0800, Andres Freund wrote: > This fails when building with WAL_DEBUG. There's remaining Read/EndRecPtr > references in #ifdef WAL_DEBUG sections... Pushed the obvious fix for that. Somehow thought I'd seen more compile failure than the one WAL_DEBUG...

pgsql: Replace straggling uses of ReadRecPtr/EndRecPtr.

2021-11-24 Thread Andres Freund
Replace straggling uses of ReadRecPtr/EndRecPtr. d2ddfa681db removed ReadRecPtr/EndRecPtr, but two uses within an #ifdef WAL_DEBUG escaped. Discussion: https://postgr.es/m/[email protected] Branch -- master Details --- https://git.postgresql.org/pg/commi

Re: pgsql: xlog.c: Remove global variables ReadRecPtr and EndRecPtr.

2021-11-24 Thread Andres Freund
Hi, On 2021-11-24 16:27:58 +, Robert Haas wrote: > xlog.c: Remove global variables ReadRecPtr and EndRecPtr. This fails when building with WAL_DEBUG. There's remaining Read/EndRecPtr references in #ifdef WAL_DEBUG sections... Greetings, Andres Freund

pgsql: Doc: improve documentation about nextval()/setval().

2021-11-24 Thread Tom Lane
Doc: improve documentation about nextval()/setval(). Clarify that the results of nextval and setval are not guaranteed persistent until the calling transaction commits. Some people seem to have drawn the opposite conclusion from the statement that these functions are never rolled back, so re-word

pgsql: Doc: improve documentation about nextval()/setval().

2021-11-24 Thread Tom Lane
Doc: improve documentation about nextval()/setval(). Clarify that the results of nextval and setval are not guaranteed persistent until the calling transaction commits. Some people seem to have drawn the opposite conclusion from the statement that these functions are never rolled back, so re-word

pgsql: Doc: improve documentation about nextval()/setval().

2021-11-24 Thread Tom Lane
Doc: improve documentation about nextval()/setval(). Clarify that the results of nextval and setval are not guaranteed persistent until the calling transaction commits. Some people seem to have drawn the opposite conclusion from the statement that these functions are never rolled back, so re-word

pgsql: Doc: improve documentation about nextval()/setval().

2021-11-24 Thread Tom Lane
Doc: improve documentation about nextval()/setval(). Clarify that the results of nextval and setval are not guaranteed persistent until the calling transaction commits. Some people seem to have drawn the opposite conclusion from the statement that these functions are never rolled back, so re-word

pgsql: Doc: improve documentation about nextval()/setval().

2021-11-24 Thread Tom Lane
Doc: improve documentation about nextval()/setval(). Clarify that the results of nextval and setval are not guaranteed persistent until the calling transaction commits. Some people seem to have drawn the opposite conclusion from the statement that these functions are never rolled back, so re-word

pgsql: Doc: improve documentation about nextval()/setval().

2021-11-24 Thread Tom Lane
Doc: improve documentation about nextval()/setval(). Clarify that the results of nextval and setval are not guaranteed persistent until the calling transaction commits. Some people seem to have drawn the opposite conclusion from the statement that these functions are never rolled back, so re-word

pgsql: Fix missing space in docs.

2021-11-24 Thread Heikki Linnakangas
Fix missing space in docs. Author: Japin Li Discussion: https://www.postgresql.org/message-id/meyp282mb1669c36e5f733c2efbdcb80bb6...@meyp282mb1669.ausp282.prod.outlook.com Branch -- REL_10_STABLE Details --- https://git.postgresql.org/pg/commitdiff/113b0a2dd79b369e3adc238896c0909935a5ad

pgsql: Fix missing space in docs.

2021-11-24 Thread Heikki Linnakangas
Fix missing space in docs. Author: Japin Li Discussion: https://www.postgresql.org/message-id/meyp282mb1669c36e5f733c2efbdcb80bb6...@meyp282mb1669.ausp282.prod.outlook.com Branch -- REL_13_STABLE Details --- https://git.postgresql.org/pg/commitdiff/892da5200aaf31f950021b4bf92916ad35113f

pgsql: Fix missing space in docs.

2021-11-24 Thread Heikki Linnakangas
Fix missing space in docs. Author: Japin Li Discussion: https://www.postgresql.org/message-id/meyp282mb1669c36e5f733c2efbdcb80bb6...@meyp282mb1669.ausp282.prod.outlook.com Branch -- REL_12_STABLE Details --- https://git.postgresql.org/pg/commitdiff/4a761b72a9ecb59f26c06fac4d1614e9a02b46

pgsql: Fix missing space in docs.

2021-11-24 Thread Heikki Linnakangas
Fix missing space in docs. Author: Japin Li Discussion: https://www.postgresql.org/message-id/meyp282mb1669c36e5f733c2efbdcb80bb6...@meyp282mb1669.ausp282.prod.outlook.com Branch -- REL_11_STABLE Details --- https://git.postgresql.org/pg/commitdiff/a00bd7aa17f652d88c8c0fe52286ef93bb4ec3

pgsql: Fix missing space in docs.

2021-11-24 Thread Heikki Linnakangas
Fix missing space in docs. Author: Japin Li Discussion: https://www.postgresql.org/message-id/meyp282mb1669c36e5f733c2efbdcb80bb6...@meyp282mb1669.ausp282.prod.outlook.com Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/373e55218972f840ad29cd8a4dabe4b17e98d28b Mod

pgsql: Fix missing space in docs.

2021-11-24 Thread Heikki Linnakangas
Fix missing space in docs. Author: Japin Li Discussion: https://www.postgresql.org/message-id/meyp282mb1669c36e5f733c2efbdcb80bb6...@meyp282mb1669.ausp282.prod.outlook.com Branch -- REL_14_STABLE Details --- https://git.postgresql.org/pg/commitdiff/88482d75cce5f3527ebad1cf42ec59a355f4b0

pgsql: xlog.c: Remove global variables ReadRecPtr and EndRecPtr.

2021-11-24 Thread Robert Haas
xlog.c: Remove global variables ReadRecPtr and EndRecPtr. In most places, the variables necessarily store the same value as the eponymous members of the XLogReaderState that we use during WAL replay, because ReadRecord() assigns the values from the structure members to the global variables just af

pgsql: Fix corner-case failure to detect improper timeline switch.

2021-11-24 Thread Robert Haas
Fix corner-case failure to detect improper timeline switch. rescanLatestTimeLine() contains a guard against switching to a timeline that forked off from the current one prior to the current recovery point, but that guard does not work if the timeline switch occurs before the first WAL recod (which

pgsql: Remove useless LZ4 system call on failure when writing file head

2021-11-24 Thread Michael Paquier
Remove useless LZ4 system call on failure when writing file header If an error occurs when writing the LZ4 file header, LZ4F_compressEnd() was called in the error code path of write(), followed by LZ4F_freeCompressionContext() to finish the cleanup. The code as-is was not broken, but the LZ4F_com

pgsql: Flush Memoize cache when non-key parameters change, take 2

2021-11-24 Thread David Rowley
Flush Memoize cache when non-key parameters change, take 2 It's possible that a subplan below a Memoize node contains a parameter from above the Memoize node. If this parameter changes then cache entries may become out-dated due to the new parameter value. Previously Memoize was mistakenly not a

pgsql: Flush Memoize cache when non-key parameters change, take 2

2021-11-24 Thread David Rowley
Flush Memoize cache when non-key parameters change, take 2 It's possible that a subplan below a Memoize node contains a parameter from above the Memoize node. If this parameter changes then cache entries may become out-dated due to the new parameter value. Previously Memoize was mistakenly not a

Re: pgsql: Flush Memoize cache when non-key parameters change

2021-11-24 Thread David Rowley
On Wed, 24 Nov 2021 at 20:27, David Rowley wrote: > > On Wed, 24 Nov 2021 at 17:31, Michael Paquier wrote: > > From what I can see, there are two separate problems here: > > - force_parallel_mode = regress. > > - -DRELCACHE_FORCE_RELEASE and/or -DCATCACHE_FORCE_RELEASE. > > Thanks. I missed addin