pgsql: doc: Improve wording of section for repslot statistics

2021-01-28 Thread Michael Paquier
doc: Improve wording of section for repslot statistics This documentation has been added in 9868167, so no backpatch is needed. Author: Justin Pryzby, Michael Paquier Discussion: https://postgr.es/m/[email protected] Branch -- master Details --- https://git.postgresql

Re: pgsql: Refactor code in tablecmds.c to check and process tablespace mov

2021-01-28 Thread Michael Paquier
On Thu, Jan 28, 2021 at 10:56:29AM -0300, Alvaro Herrera wrote: > Yep, seems OK to me, assuming that, as you say, you'll update the > comments again when they are used to handle the concurrent cases. That's the idea. I need first to look in depth at what's proposed on the other thread for REINDEX

pgsql: Adjust comments of CheckRelationTableSpaceMove() and SetRelation

2021-01-28 Thread Michael Paquier
Adjust comments of CheckRelationTableSpaceMove() and SetRelationTableSpace() 4c9c359, that introduced those two functions, has been overoptimistic on the point that only ShareUpdateExclusiveLock would be required when moving a relation to a new tablespace. AccessExclusiveLock is a requirement, bu

pgsql: Remove documentation of waiting restore_command.

2021-01-28 Thread Thomas Munro
Remove documentation of waiting restore_command. Following the removal of pg_standby, also remove the documentation section that describes how to write your own "waiting restore_command" along the same lines. Discussion: https://postgr.es/m/20201029024412.GP5380%40telsasoft.com Reviewed-by: Micha

pgsql: Retire pg_standby.

2021-01-28 Thread Thomas Munro
Retire pg_standby. pg_standby was useful more than a decade ago, but now it is obsolete. It has been proposed that we retire it many times. Now seems like a good time to finally do it, because "waiting restore commands" are incompatible with a proposed recovery prefetching feature. Discussion: h

pgsql: Silence another gcc 11 warning.

2021-01-28 Thread Tom Lane
Silence another gcc 11 warning. Per buildfarm and local experimentation, bleeding-edge gcc isn't convinced that the MemSet in reorder_function_arguments() is safe. Shut it up by adding an explicit check that pronargs isn't negative, and by changing MemSet to memset. (It appears that either change

pgsql: Silence another gcc 11 warning.

2021-01-28 Thread Tom Lane
Silence another gcc 11 warning. Per buildfarm and local experimentation, bleeding-edge gcc isn't convinced that the MemSet in reorder_function_arguments() is safe. Shut it up by adding an explicit check that pronargs isn't negative, and by changing MemSet to memset. (It appears that either change

pgsql: Silence another gcc 11 warning.

2021-01-28 Thread Tom Lane
Silence another gcc 11 warning. Per buildfarm and local experimentation, bleeding-edge gcc isn't convinced that the MemSet in reorder_function_arguments() is safe. Shut it up by adding an explicit check that pronargs isn't negative, and by changing MemSet to memset. (It appears that either change

pgsql: Silence another gcc 11 warning.

2021-01-28 Thread Tom Lane
Silence another gcc 11 warning. Per buildfarm and local experimentation, bleeding-edge gcc isn't convinced that the MemSet in reorder_function_arguments() is safe. Shut it up by adding an explicit check that pronargs isn't negative, and by changing MemSet to memset. (It appears that either change

pgsql: Silence another gcc 11 warning.

2021-01-28 Thread Tom Lane
Silence another gcc 11 warning. Per buildfarm and local experimentation, bleeding-edge gcc isn't convinced that the MemSet in reorder_function_arguments() is safe. Shut it up by adding an explicit check that pronargs isn't negative, and by changing MemSet to memset. (It appears that either change

pgsql: Silence another gcc 11 warning.

2021-01-28 Thread Tom Lane
Silence another gcc 11 warning. Per buildfarm and local experimentation, bleeding-edge gcc isn't convinced that the MemSet in reorder_function_arguments() is safe. Shut it up by adding an explicit check that pronargs isn't negative, and by changing MemSet to memset. (It appears that either change

pgsql: Silence another gcc 11 warning.

2021-01-28 Thread Tom Lane
Silence another gcc 11 warning. Per buildfarm and local experimentation, bleeding-edge gcc isn't convinced that the MemSet in reorder_function_arguments() is safe. Shut it up by adding an explicit check that pronargs isn't negative, and by changing MemSet to memset. (It appears that either change

pgsql: Remove bogus restriction from BEFORE UPDATE triggers

2021-01-28 Thread Alvaro Herrera
Remove bogus restriction from BEFORE UPDATE triggers In trying to protect the user from inconsistent behavior, commit 487e9861d0cf "Enable BEFORE row-level triggers for partitioned tables" tried to prevent BEFORE UPDATE FOR EACH ROW triggers from moving the row from one partition to another. Howe

pgsql: Remove bogus restriction from BEFORE UPDATE triggers

2021-01-28 Thread Alvaro Herrera
Remove bogus restriction from BEFORE UPDATE triggers In trying to protect the user from inconsistent behavior, commit 487e9861d0cf "Enable BEFORE row-level triggers for partitioned tables" tried to prevent BEFORE UPDATE FOR EACH ROW triggers from moving the row from one partition to another. Howe

pgsql: Fix hash partition pruning with asymmetric partition sets.

2021-01-28 Thread Tom Lane
Fix hash partition pruning with asymmetric partition sets. perform_pruning_combine_step() was not taught about the number of partition indexes used in hash partitioning; more embarrassingly, get_matching_hash_bounds() also had it wrong. These errors are masked in the common case where all the par

pgsql: Fix hash partition pruning with asymmetric partition sets.

2021-01-28 Thread Tom Lane
Fix hash partition pruning with asymmetric partition sets. perform_pruning_combine_step() was not taught about the number of partition indexes used in hash partitioning; more embarrassingly, get_matching_hash_bounds() also had it wrong. These errors are masked in the common case where all the par

pgsql: Fix hash partition pruning with asymmetric partition sets.

2021-01-28 Thread Tom Lane
Fix hash partition pruning with asymmetric partition sets. perform_pruning_combine_step() was not taught about the number of partition indexes used in hash partitioning; more embarrassingly, get_matching_hash_bounds() also had it wrong. These errors are masked in the common case where all the par

pgsql: Fix hash partition pruning with asymmetric partition sets.

2021-01-28 Thread Tom Lane
Fix hash partition pruning with asymmetric partition sets. perform_pruning_combine_step() was not taught about the number of partition indexes used in hash partitioning; more embarrassingly, get_matching_hash_bounds() also had it wrong. These errors are masked in the common case where all the par

pgsql: Make ecpg's rjulmdy() and rmdyjul() agree with their declaration

2021-01-28 Thread Tom Lane
Make ecpg's rjulmdy() and rmdyjul() agree with their declarations. We had "short *mdy" in the extern declarations, but "short mdy[3]" in the actual function definitions. Per C99 these are equivalent, but recent versions of gcc have started to issue warnings about the inconsistency. Clean it up b

pgsql: Make ecpg's rjulmdy() and rmdyjul() agree with their declaration

2021-01-28 Thread Tom Lane
Make ecpg's rjulmdy() and rmdyjul() agree with their declarations. We had "short *mdy" in the extern declarations, but "short mdy[3]" in the actual function definitions. Per C99 these are equivalent, but recent versions of gcc have started to issue warnings about the inconsistency. Clean it up b

pgsql: Make ecpg's rjulmdy() and rmdyjul() agree with their declaration

2021-01-28 Thread Tom Lane
Make ecpg's rjulmdy() and rmdyjul() agree with their declarations. We had "short *mdy" in the extern declarations, but "short mdy[3]" in the actual function definitions. Per C99 these are equivalent, but recent versions of gcc have started to issue warnings about the inconsistency. Clean it up b

pgsql: Make ecpg's rjulmdy() and rmdyjul() agree with their declaration

2021-01-28 Thread Tom Lane
Make ecpg's rjulmdy() and rmdyjul() agree with their declarations. We had "short *mdy" in the extern declarations, but "short mdy[3]" in the actual function definitions. Per C99 these are equivalent, but recent versions of gcc have started to issue warnings about the inconsistency. Clean it up b

pgsql: Make ecpg's rjulmdy() and rmdyjul() agree with their declaration

2021-01-28 Thread Tom Lane
Make ecpg's rjulmdy() and rmdyjul() agree with their declarations. We had "short *mdy" in the extern declarations, but "short mdy[3]" in the actual function definitions. Per C99 these are equivalent, but recent versions of gcc have started to issue warnings about the inconsistency. Clean it up b

pgsql: Make ecpg's rjulmdy() and rmdyjul() agree with their declaration

2021-01-28 Thread Tom Lane
Make ecpg's rjulmdy() and rmdyjul() agree with their declarations. We had "short *mdy" in the extern declarations, but "short mdy[3]" in the actual function definitions. Per C99 these are equivalent, but recent versions of gcc have started to issue warnings about the inconsistency. Clean it up b

pgsql: Make ecpg's rjulmdy() and rmdyjul() agree with their declaration

2021-01-28 Thread Tom Lane
Make ecpg's rjulmdy() and rmdyjul() agree with their declarations. We had "short *mdy" in the extern declarations, but "short mdy[3]" in the actual function definitions. Per C99 these are equivalent, but recent versions of gcc have started to issue warnings about the inconsistency. Clean it up b

pgsql: pgbench: Remove dead code

2021-01-28 Thread Alvaro Herrera
pgbench: Remove dead code doConnect() never returns connections in state CONNECTION_BAD, so checking for that is pointless. Remove the code that does. This code has been dead since ba708ea3dc84, 20 years ago. Discussion: https://postgr.es/m/[email protected] Reviewed-by: Tom

pgsql: pgbench: Remove dead code

2021-01-28 Thread Alvaro Herrera
pgbench: Remove dead code doConnect() never returns connections in state CONNECTION_BAD, so checking for that is pointless. Remove the code that does. This code has been dead since ba708ea3dc84, 20 years ago. Discussion: https://postgr.es/m/[email protected] Reviewed-by: Tom

pgsql: pgbench: Remove dead code

2021-01-28 Thread Alvaro Herrera
pgbench: Remove dead code doConnect() never returns connections in state CONNECTION_BAD, so checking for that is pointless. Remove the code that does. This code has been dead since ba708ea3dc84, 20 years ago. Discussion: https://postgr.es/m/[email protected] Reviewed-by: Tom

pgsql: pgbench: Remove dead code

2021-01-28 Thread Alvaro Herrera
pgbench: Remove dead code doConnect() never returns connections in state CONNECTION_BAD, so checking for that is pointless. Remove the code that does. This code has been dead since ba708ea3dc84, 20 years ago. Discussion: https://postgr.es/m/[email protected] Reviewed-by: Tom

pgsql: pgbench: Remove dead code

2021-01-28 Thread Alvaro Herrera
pgbench: Remove dead code doConnect() never returns connections in state CONNECTION_BAD, so checking for that is pointless. Remove the code that does. This code has been dead since ba708ea3dc84, 20 years ago. Discussion: https://postgr.es/m/[email protected] Reviewed-by: Tom

pgsql: pgbench: Remove dead code

2021-01-28 Thread Alvaro Herrera
pgbench: Remove dead code doConnect() never returns connections in state CONNECTION_BAD, so checking for that is pointless. Remove the code that does. This code has been dead since ba708ea3dc84, 20 years ago. Discussion: https://postgr.es/m/[email protected] Reviewed-by: Tom

pgsql: pgbench: Remove dead code

2021-01-28 Thread Alvaro Herrera
pgbench: Remove dead code doConnect() never returns connections in state CONNECTION_BAD, so checking for that is pointless. Remove the code that does. This code has been dead since ba708ea3dc84, 20 years ago. Discussion: https://postgr.es/m/[email protected] Reviewed-by: Tom

Re: pgsql: Refactor code in tablecmds.c to check and process tablespace mov

2021-01-28 Thread Alvaro Herrera
On 2021-Jan-28, Michael Paquier wrote: > So, for now, I would just do the attached to address your > suggestions. Is that fine for you? Yep, seems OK to me, assuming that, as you say, you'll update the comments again when they are used to handle the concurrent cases. Thanks! -- Álvaro Herrera

pgsql: Remove gratuitous uses of deprecated SELECT INTO

2021-01-28 Thread Peter Eisentraut
Remove gratuitous uses of deprecated SELECT INTO CREATE TABLE AS has been preferred over SELECT INTO (outside of ecpg and PL/pgSQL) for a long time. There were still a few uses of SELECT INTO in tests and documentation, some old, some more recent. This changes them to CREATE TABLE AS. Some occu

pgsql: Add direct conversion routines between EUC_TW and Big5.

2021-01-28 Thread Heikki Linnakangas
Add direct conversion routines between EUC_TW and Big5. Conversions between EUC_TW and Big5 were previously implemented by converting the whole input to MIC first, and then from MIC to the target encoding. Implement functions to convert directly between the two. The reason to do this now is that

pgsql: Add mbverifystr() functions specific to each encoding.

2021-01-28 Thread Heikki Linnakangas
Add mbverifystr() functions specific to each encoding. This makes pg_verify_mbstr() function faster, by allowing more efficient encoding-specific implementations. All the implementations included in this commit are pretty naive, they just call the same encoding-specific verifychar functions that w

pgsql: Don't add bailout adjustment for non-strict deserialize calls.

2021-01-28 Thread Andrew Gierth
Don't add bailout adjustment for non-strict deserialize calls. When building aggregate expression steps, strict checks need a bailout jump for when a null value is encountered, so there is a list of steps that require later adjustment. Adding entries to that list for steps that aren't actually str

pgsql: Don't add bailout adjustment for non-strict deserialize calls.

2021-01-28 Thread Andrew Gierth
Don't add bailout adjustment for non-strict deserialize calls. When building aggregate expression steps, strict checks need a bailout jump for when a null value is encountered, so there is a list of steps that require later adjustment. Adding entries to that list for steps that aren't actually str

pgsql: Don't add bailout adjustment for non-strict deserialize calls.

2021-01-28 Thread Andrew Gierth
Don't add bailout adjustment for non-strict deserialize calls. When building aggregate expression steps, strict checks need a bailout jump for when a null value is encountered, so there is a list of steps that require later adjustment. Adding entries to that list for steps that aren't actually str

pgsql: Don't add bailout adjustment for non-strict deserialize calls.

2021-01-28 Thread Andrew Gierth
Don't add bailout adjustment for non-strict deserialize calls. When building aggregate expression steps, strict checks need a bailout jump for when a null value is encountered, so there is a list of steps that require later adjustment. Adding entries to that list for steps that aren't actually str