pgsql: Preserve replica identity index across ALTER TABLE rewrite

2020-03-13 Thread Peter Eisentraut
Preserve replica identity index across ALTER TABLE rewrite

If an index was explicitly set as replica identity index, this setting
was lost when a table was rewritten by ALTER TABLE.  Because this
setting is part of pg_index but actually controlled by ALTER
TABLE (not part of CREATE INDEX, say), we have to do some extra work
to restore it.

Based-on-patch-by: Quan Zongliang 
Reviewed-by: Euler Taveira 
Discussion: 
https://www.postgresql.org/message-id/flat/[email protected]

Branch
--
REL9_6_STABLE

Details
---
https://git.postgresql.org/pg/commitdiff/2f0dd9d93efe0d2e41585f804a38b2db5b7f429d

Modified Files
--
src/backend/commands/tablecmds.c   | 42 +++
src/backend/utils/cache/lsyscache.c| 25 ++
src/include/utils/lsyscache.h  |  1 +
src/test/regress/expected/replica_identity.out | 46 ++
src/test/regress/sql/replica_identity.sql  | 21 
5 files changed, 135 insertions(+)



pgsql: Preserve replica identity index across ALTER TABLE rewrite

2020-03-13 Thread Peter Eisentraut
Preserve replica identity index across ALTER TABLE rewrite

If an index was explicitly set as replica identity index, this setting
was lost when a table was rewritten by ALTER TABLE.  Because this
setting is part of pg_index but actually controlled by ALTER
TABLE (not part of CREATE INDEX, say), we have to do some extra work
to restore it.

Based-on-patch-by: Quan Zongliang 
Reviewed-by: Euler Taveira 
Discussion: 
https://www.postgresql.org/message-id/flat/[email protected]

Branch
--
REL9_5_STABLE

Details
---
https://git.postgresql.org/pg/commitdiff/c15d35041206dbe2fd8f57a18c6227a2312ddf0d

Modified Files
--
src/backend/commands/tablecmds.c   | 42 +++
src/backend/utils/cache/lsyscache.c| 25 ++
src/include/utils/lsyscache.h  |  1 +
src/test/regress/expected/replica_identity.out | 46 ++
src/test/regress/sql/replica_identity.sql  | 21 
5 files changed, 135 insertions(+)



pgsql: Preserve replica identity index across ALTER TABLE rewrite

2020-03-13 Thread Peter Eisentraut
Preserve replica identity index across ALTER TABLE rewrite

If an index was explicitly set as replica identity index, this setting
was lost when a table was rewritten by ALTER TABLE.  Because this
setting is part of pg_index but actually controlled by ALTER
TABLE (not part of CREATE INDEX, say), we have to do some extra work
to restore it.

Based-on-patch-by: Quan Zongliang 
Reviewed-by: Euler Taveira 
Discussion: 
https://www.postgresql.org/message-id/flat/[email protected]

Branch
--
master

Details
---
https://git.postgresql.org/pg/commitdiff/1cc9c2412cc9a2fbe6a381170097d315fd40ccca

Modified Files
--
src/backend/commands/tablecmds.c   | 42 +++
src/backend/utils/cache/lsyscache.c| 23 +
src/include/utils/lsyscache.h  |  1 +
src/test/regress/expected/replica_identity.out | 46 ++
src/test/regress/sql/replica_identity.sql  | 21 
5 files changed, 133 insertions(+)



pgsql: Preserve replica identity index across ALTER TABLE rewrite

2020-03-13 Thread Peter Eisentraut
Preserve replica identity index across ALTER TABLE rewrite

If an index was explicitly set as replica identity index, this setting
was lost when a table was rewritten by ALTER TABLE.  Because this
setting is part of pg_index but actually controlled by ALTER
TABLE (not part of CREATE INDEX, say), we have to do some extra work
to restore it.

Based-on-patch-by: Quan Zongliang 
Reviewed-by: Euler Taveira 
Discussion: 
https://www.postgresql.org/message-id/flat/[email protected]

Branch
--
REL_11_STABLE

Details
---
https://git.postgresql.org/pg/commitdiff/15cbbf81a58fd04479c0e5ff134838492473e935

Modified Files
--
src/backend/commands/tablecmds.c   | 42 +++
src/backend/utils/cache/lsyscache.c| 25 ++
src/include/utils/lsyscache.h  |  1 +
src/test/regress/expected/replica_identity.out | 46 ++
src/test/regress/sql/replica_identity.sql  | 21 
5 files changed, 135 insertions(+)



pgsql: Preserve replica identity index across ALTER TABLE rewrite

2020-03-13 Thread Peter Eisentraut
Preserve replica identity index across ALTER TABLE rewrite

If an index was explicitly set as replica identity index, this setting
was lost when a table was rewritten by ALTER TABLE.  Because this
setting is part of pg_index but actually controlled by ALTER
TABLE (not part of CREATE INDEX, say), we have to do some extra work
to restore it.

Based-on-patch-by: Quan Zongliang 
Reviewed-by: Euler Taveira 
Discussion: 
https://www.postgresql.org/message-id/flat/[email protected]

Branch
--
REL_10_STABLE

Details
---
https://git.postgresql.org/pg/commitdiff/02530da73f0438f7c2073267de6fe2be84f592d7

Modified Files
--
src/backend/commands/tablecmds.c   | 42 +++
src/backend/utils/cache/lsyscache.c| 25 ++
src/include/utils/lsyscache.h  |  1 +
src/test/regress/expected/replica_identity.out | 46 ++
src/test/regress/sql/replica_identity.sql  | 21 
5 files changed, 135 insertions(+)



pgsql: Preserve replica identity index across ALTER TABLE rewrite

2020-03-13 Thread Peter Eisentraut
Preserve replica identity index across ALTER TABLE rewrite

If an index was explicitly set as replica identity index, this setting
was lost when a table was rewritten by ALTER TABLE.  Because this
setting is part of pg_index but actually controlled by ALTER
TABLE (not part of CREATE INDEX, say), we have to do some extra work
to restore it.

Based-on-patch-by: Quan Zongliang 
Reviewed-by: Euler Taveira 
Discussion: 
https://www.postgresql.org/message-id/flat/[email protected]

Branch
--
REL_12_STABLE

Details
---
https://git.postgresql.org/pg/commitdiff/c9ef507e82ebb2bffc50e531edd6fb4593dd5146

Modified Files
--
src/backend/commands/tablecmds.c   | 42 +++
src/backend/utils/cache/lsyscache.c| 23 +
src/include/utils/lsyscache.h  |  1 +
src/test/regress/expected/replica_identity.out | 46 ++
src/test/regress/sql/replica_identity.sql  | 21 
5 files changed, 133 insertions(+)



pgsql: Remove am_syslogger global variable

2020-03-13 Thread Peter Eisentraut
Remove am_syslogger global variable

Use the new MyBackendType instead.  More similar changes for other "am
something" variables are possible.  This one was just particularly
simple.

Reviewed-by: Julien Rouhaud 
Reviewed-by: Kuntal Ghosh 
Reviewed-by: Alvaro Herrera 
Discussion: 
https://www.postgresql.org/message-id/flat/[email protected]

Branch
--
master

Details
---
https://git.postgresql.org/pg/commitdiff/d90bd24391fdde2b73906e16052821c9e3c1ce82

Modified Files
--
src/backend/postmaster/syslogger.c | 9 +
src/backend/utils/error/elog.c | 8 
src/include/postmaster/syslogger.h | 2 --
3 files changed, 5 insertions(+), 14 deletions(-)



pgsql: Unify several ways to tracking backend type

2020-03-13 Thread Peter Eisentraut
Unify several ways to tracking backend type

Add a new global variable MyBackendType that uses the same BackendType
enum that was previously only used by the stats collector.  That way
several duplicate ways of checking what type a particular process is
can be simplified.  Since it's no longer just for stats, move to
miscinit.c and rename existing functions to match the expanded
purpose.

Reviewed-by: Julien Rouhaud 
Reviewed-by: Kuntal Ghosh 
Reviewed-by: Alvaro Herrera 
Discussion: 
https://www.postgresql.org/message-id/flat/[email protected]

Branch
--
master

Details
---
https://git.postgresql.org/pg/commitdiff/8e8a0becb335529c66a9f82f88e1419e49b458ae

Modified Files
--
src/backend/bootstrap/bootstrap.c   |  48 +++--
src/backend/postmaster/autovacuum.c |   8 +--
src/backend/postmaster/bgworker.c   |   2 +-
src/backend/postmaster/pgarch.c |   6 +--
src/backend/postmaster/pgstat.c | 105 ++--
src/backend/postmaster/postmaster.c |   7 ++-
src/backend/postmaster/syslogger.c  |   3 +-
src/backend/utils/adt/pgstatfuncs.c |   2 +-
src/backend/utils/init/miscinit.c   |  55 +++
src/backend/utils/misc/ps_status.c  |  11 +++-
src/include/miscadmin.h |  22 
src/include/pgstat.h|  21 +---
12 files changed, 126 insertions(+), 164 deletions(-)



pgsql: doc: Remove unused title ids

2020-03-13 Thread Peter Eisentraut
doc: Remove unused title ids

FOP issues warnings about them.  These aren't even used, so just
remove them.  For the ones that are actually used, we'll come up with
a different solution.

Discussion: 
https://www.postgresql.org/message-id/flat/e29b580e-79ab-a371-5ea4-6946e4d3af0b%402ndQuadrant.com

Branch
--
master

Details
---
https://git.postgresql.org/pg/commitdiff/340de72780e4eb769d5cf052b03084808bac476a

Modified Files
--
doc/src/sgml/ecpg.sgml | 4 ++--
doc/src/sgml/file-fdw.sgml | 2 +-
doc/src/sgml/ref/commit_prepared.sgml  | 2 +-
doc/src/sgml/ref/create_foreign_table.sgml | 2 +-
doc/src/sgml/ref/create_view.sgml  | 2 +-
doc/src/sgml/ref/do.sgml   | 2 +-
doc/src/sgml/ref/prepare_transaction.sgml  | 2 +-
doc/src/sgml/ref/rollback_prepared.sgml| 2 +-
8 files changed, 9 insertions(+), 9 deletions(-)



pgsql: Doc: fix mistaken reference to "PG_ARGNULL_xxx()" macro.

2020-03-13 Thread Tom Lane
Doc: fix mistaken reference to "PG_ARGNULL_xxx()" macro.

This should of course be just "PG_ARGISNULL()".

Also reorder a couple of paras to make the discussion of PG_ARGISNULL
less disjointed.

Back-patch to v10 where the error was introduced.

Laurenz Albe and Tom Lane, per an anonymous docs comment

Discussion: 
https://postgr.es/m/[email protected]

Branch
--
REL_11_STABLE

Details
---
https://git.postgresql.org/pg/commitdiff/7e32aaab589a8927c22d3b83d55fc0e77424b348

Modified Files
--
doc/src/sgml/xfunc.sgml | 20 ++--
1 file changed, 10 insertions(+), 10 deletions(-)



pgsql: Doc: fix mistaken reference to "PG_ARGNULL_xxx()" macro.

2020-03-13 Thread Tom Lane
Doc: fix mistaken reference to "PG_ARGNULL_xxx()" macro.

This should of course be just "PG_ARGISNULL()".

Also reorder a couple of paras to make the discussion of PG_ARGISNULL
less disjointed.

Back-patch to v10 where the error was introduced.

Laurenz Albe and Tom Lane, per an anonymous docs comment

Discussion: 
https://postgr.es/m/[email protected]

Branch
--
REL_12_STABLE

Details
---
https://git.postgresql.org/pg/commitdiff/f393fb20a1543a3e08597968ff6017d9d399513d

Modified Files
--
doc/src/sgml/xfunc.sgml | 20 ++--
1 file changed, 10 insertions(+), 10 deletions(-)



pgsql: Doc: fix mistaken reference to "PG_ARGNULL_xxx()" macro.

2020-03-13 Thread Tom Lane
Doc: fix mistaken reference to "PG_ARGNULL_xxx()" macro.

This should of course be just "PG_ARGISNULL()".

Also reorder a couple of paras to make the discussion of PG_ARGISNULL
less disjointed.

Back-patch to v10 where the error was introduced.

Laurenz Albe and Tom Lane, per an anonymous docs comment

Discussion: 
https://postgr.es/m/[email protected]

Branch
--
REL_10_STABLE

Details
---
https://git.postgresql.org/pg/commitdiff/00f38866f7e966ac4c48c6b027e2666c3ab29398

Modified Files
--
doc/src/sgml/xfunc.sgml | 20 ++--
1 file changed, 10 insertions(+), 10 deletions(-)



pgsql: Doc: fix mistaken reference to "PG_ARGNULL_xxx()" macro.

2020-03-13 Thread Tom Lane
Doc: fix mistaken reference to "PG_ARGNULL_xxx()" macro.

This should of course be just "PG_ARGISNULL()".

Also reorder a couple of paras to make the discussion of PG_ARGISNULL
less disjointed.

Back-patch to v10 where the error was introduced.

Laurenz Albe and Tom Lane, per an anonymous docs comment

Discussion: 
https://postgr.es/m/[email protected]

Branch
--
master

Details
---
https://git.postgresql.org/pg/commitdiff/dbf95c843a3d66cf9a692f5937a1bec4f2261035

Modified Files
--
doc/src/sgml/xfunc.sgml | 20 ++--
1 file changed, 10 insertions(+), 10 deletions(-)