[17] CREATE SUBSCRIPTION ... SERVER

2023-08-29 Thread Jeff Davis
Synopsis: Publisher: CREATE TABLE x(i INT); CREATE TABLE y(i INT); INSERT INTO x VALUES(1); INSERT INTO y VALUES(-1); CREATE PUBLICATION pub1 FOR TABLE x; CREATE PUBLICATION pub2 FOR TABLE y; Subscriber: CREATE SERVER myserver FOR CONNECTION ONLY OPTIONS (

Re: [PoC] pg_upgrade: allow to upgrade publisher node

2023-08-29 Thread Peter Smith
Hi Kuroda-san. Here are some review comments for v28-0003. == src/bin/pg_upgrade/check.c 1. check_and_dump_old_cluster + /* + * Logical replication slots can be migrated since PG17. See comments atop + * get_old_cluster_logical_slot_infos(). + */ + if (GET_MAJOR_VERSION(old_cluster.major_ver

Re: Extract numeric filed in JSONB more effectively

2023-08-29 Thread Andy Fan
(Sorry for leaving this discussion for such a long time, how times fly!) On Sun, Aug 27, 2023 at 6:28 AM Chapman Flack wrote: > On 2023-08-22 08:16, Chapman Flack wrote: > > On 2023-08-22 01:54, Andy Fan wrote: > >> After we label it, we will get error like this: > >> > >> select (a->'a')::int4

Re: Synchronizing slots from primary to standby

2023-08-29 Thread shveta malik
On Wed, Aug 23, 2023 at 4:21 PM Dilip Kumar wrote: > > On Wed, Aug 23, 2023 at 3:38 PM shveta malik wrote: > > > I have reviewed the v12-0002 patch and I have some comments. I see the > latest version posted sometime back and if any of this comment is > already fixed in this version then feel fre

Re: persist logical slots to disk during shutdown checkpoint

2023-08-29 Thread Amit Kapila
On Wed, Aug 30, 2023 at 9:03 AM Julien Rouhaud wrote: > > On Tue, Aug 29, 2023 at 02:21:15PM +0530, Amit Kapila wrote: > > On Tue, Aug 29, 2023 at 10:16 AM vignesh C wrote: > > > > > > That makes sense. The attached v6 version has the changes for the > > > same, apart from this I have also fixed

Re: pg_stat_get_backend_subxact() and backend IDs?

2023-08-29 Thread Michael Paquier
On Tue, Aug 29, 2023 at 07:01:51PM -0700, Nathan Bossart wrote: > On Wed, Aug 30, 2023 at 08:22:27AM +0900, Michael Paquier wrote: >> +extern LocalPgBackendStatus *pgstat_get_local_beentry_by_index(int beid); >> >> Still I would to a bit more of s/beid/id/ for cases where the code >> refers to an

Re: Synchronizing slots from primary to standby

2023-08-29 Thread shveta malik
On Fri, Aug 25, 2023 at 11:09 AM shveta malik wrote: > > On Wed, Aug 23, 2023 at 4:21 PM Dilip Kumar wrote: > > > > On Wed, Aug 23, 2023 at 3:38 PM shveta malik wrote: > > > > > I have reviewed the v12-0002 patch and I have some comments. I see the > > latest version posted sometime back and if

Re: persist logical slots to disk during shutdown checkpoint

2023-08-29 Thread Julien Rouhaud
Hi, On Tue, Aug 29, 2023 at 02:21:15PM +0530, Amit Kapila wrote: > On Tue, Aug 29, 2023 at 10:16 AM vignesh C wrote: > > > > That makes sense. The attached v6 version has the changes for the > > same, apart from this I have also fixed a) pgindent issues b) perltidy > > issues c) one variable chan

Re: Debian 12 gcc warning

2023-08-29 Thread Tom Lane
Bruce Momjian writes: > On Tue, Aug 29, 2023 at 10:18:36AM -0400, Tom Lane wrote: >> That seems like a pretty clear compiler bug, particularly since it just >> appears in this one version. Rather than contorting our code, I'd >> suggest filing a gcc bug. > I assume I have to create a test case t

Re: [PoC] pg_upgrade: allow to upgrade publisher node

2023-08-29 Thread Peter Smith
Here are some minor review comments for patch v28-0002 == src/sgml/ref/pgupgrade.sgml 1. - with the primary.) Replication slots are not copied and must - be recreated. + with the primary.) Replication slots on old standby are not copied. + Only logical slots on the p

Re: Missing comments/docs about custom scan path

2023-08-29 Thread Richard Guo
On Tue, Aug 29, 2023 at 5:08 PM Etsuro Fujita wrote: > Another thing I would like to propose is minor adjustments to the docs > related to parallel query: > > A custom scan provider will typically add paths for a base relation by > setting the following hook, which is called after the cor

Re: pg_stat_get_backend_subxact() and backend IDs?

2023-08-29 Thread Nathan Bossart
On Wed, Aug 30, 2023 at 08:22:27AM +0900, Michael Paquier wrote: > On Tue, Aug 29, 2023 at 09:46:55AM -0700, Nathan Bossart wrote: >> This was my first reaction [0]. I was concerned about renaming the >> exported functions so close to release, so I was suggesting that we hold >> off on that part u

Re: pgbench: allow to exit immediately when any client is aborted

2023-08-29 Thread Yugo NAGATA
On Wed, 30 Aug 2023 10:11:10 +0900 (JST) Tatsuo Ishii wrote: > Yugo, > Fabien, > > >>> I start to think this behavior is ok and consistent with previous > >>> behavior of pgbench because serialization (and dealock) errors have > >>> been treated specially from other types of errors, such as acce

Re: Fix shadow warnings in logical replication code

2023-08-29 Thread Richard Guo
On Wed, Aug 30, 2023 at 8:49 AM Michael Paquier wrote: > There is much more going on with -Wshadow, but let's do things > incrementally, case by case. Yeah, IIRC the source tree currently is able to be built without any shadow-related warnings with -Wshadow=compatible-local. But with -Wshadow

A propose to revise \watch help message

2023-08-29 Thread Kyotaro Horiguchi
Recently \watch got the following help message. > \watch [[i=]SEC] [c=N] [m=MIN] > execute query every SEC seconds, up to N times > stop if less than MIN rows are returned The "m=MIN" can be a bit misleading. It may look like it's about interv

Re: Wrong usage of pqMsg_Close message code?

2023-08-29 Thread Nathan Bossart
On Wed, Aug 30, 2023 at 07:56:33AM +0900, Michael Paquier wrote: > On Tue, Aug 29, 2023 at 02:11:06PM -0700, Nathan Bossart wrote: >> I plan to commit the attached patch shortly. > > WFM. Committed. -- Nathan Bossart Amazon Web Services: https://aws.amazon.com

Re: A propose to revise \watch help message

2023-08-29 Thread Kyotaro Horiguchi
At Wed, 30 Aug 2023 10:21:26 +0900 (JST), Kyotaro Horiguchi wrote in > Recently \watch got the following help message. > > > \watch [[i=]SEC] [c=N] [m=MIN] > > execute query every SEC seconds, up to N times > > stop if less than MIN rows are

Re: should frontend tools use syncfs() ?

2023-08-29 Thread Nathan Bossart
On Wed, Aug 30, 2023 at 09:10:47AM +0900, Michael Paquier wrote: > I understand that I'm perhaps sounding pedantic about fsync_pgdata().. > But, after thinking more about it, I would still make this code fail > hard with an exit(EXIT_FAILURE) to let any C code calling directly > this routine with s

Re: pgbench: allow to exit immediately when any client is aborted

2023-08-29 Thread Tatsuo Ishii
Yugo, Fabien, >>> I start to think this behavior is ok and consistent with previous >>> behavior of pgbench because serialization (and dealock) errors have >>> been treated specially from other types of errors, such as accessing >>> non existing tables. However, I suggest to add more sentences to

Re: Remove IndexInfo.ii_OpclassOptions field

2023-08-29 Thread Michael Paquier
On Tue, Aug 29, 2023 at 10:51:10AM +0200, Peter Eisentraut wrote: > At a glance, however, I think my patch is (a) not related, and (b) if it > were, it would probably *help*, because the change is to not allocate any > long-lived structures that no one needs and that might get out of date. Hmm, ye

Re: Fix shadow warnings in logical replication code

2023-08-29 Thread Michael Paquier
On Wed, Aug 30, 2023 at 09:16:38AM +1000, Peter Smith wrote: > logicalfuncs.c:184:13: warning: declaration of ‘name’ shadows a > previous local [-Wshadow] > char*name = TextDatumGetCString(datum_opts[i]); > ^ > logicalfuncs.c:105:8: warning: shadowed declaration is here [-Wshad

Re: Strange presentaion related to inheritance in \d+

2023-08-29 Thread Kyotaro Horiguchi
At Tue, 29 Aug 2023 19:28:28 +0200, Alvaro Herrera wrote in > On 2023-Aug-29, Kyotaro Horiguchi wrote: > > > Attached is the initial version of the patch. It prevents "CREATE > > TABLE" from executing if there is an inconsisntent not-null > > constraint. Also I noticed that "ALTER TABLE t ADD

Re: Standardize spelling of "power of two"

2023-08-29 Thread Kyotaro Horiguchi
At Tue, 29 Aug 2023 14:39:42 +0200, Daniel Gustafsson wrote in > > On 29 Aug 2023, at 13:11, Alvaro Herrera wrote: > > > > On 2023-Aug-29, Daniel Gustafsson wrote: > > > >> Agreed. While we have numerous "power of 2" these were the only ones > >> in translated user-facing messages, so I've p

Re: should frontend tools use syncfs() ?

2023-08-29 Thread Michael Paquier
On Tue, Aug 29, 2023 at 08:45:59AM -0700, Nathan Bossart wrote: > rebased 0001 looks OK, worth its own, independent, commit. I understand that I'm perhaps sounding pedantic about fsync_pgdata().. But, after thinking more about it, I would still make this code fail hard with an exit(EXIT_FAILURE)

Re: pg_stat_get_backend_subxact() and backend IDs?

2023-08-29 Thread Michael Paquier
On Tue, Aug 29, 2023 at 09:46:55AM -0700, Nathan Bossart wrote: > This was my first reaction [0]. I was concerned about renaming the > exported functions so close to release, so I was suggesting that we hold > off on that part until v17. If there isn't a concern with renaming these > functions in

Fix shadow warnings in logical replication code

2023-08-29 Thread Peter Smith
The -Wshadow compiler option reported 3 shadow warnings within the logical replication files. (These are all in old code) PSA a patch to address those. == logicalfuncs.c:184:13: warning: declaration of ‘name’ shadows a previous local [-Wshadow] char*name = TextDatumGetCString(datum_o

Re: Avoid a possible overflow (src/backend/utils/sort/logtape.c)

2023-08-29 Thread Michael Paquier
On Thu, Aug 24, 2023 at 07:02:40PM -0700, Peter Geoghegan wrote: > FWIW I'm pretty sure that it's impossible to run into problems here in > practice -- the minheap is allocated by palloc(), and the high > watermark number of free pages is pretty small. Even still, I agree > with your conclusion. Th

Re: Allow specifying a dbname in pg_basebackup connection string

2023-08-29 Thread Jim Jones
Hi Jelte On 29.08.23 15:55, Jelte Fennema wrote: Thanks for the review. I've updated the documentation to make it clearer (using some of your suggestions but also some others) This patch applies and builds cleanly, and the documentation is very clear. I tested it using the 'replication-suppor

Re: Wrong usage of pqMsg_Close message code?

2023-08-29 Thread Michael Paquier
On Tue, Aug 29, 2023 at 02:11:06PM -0700, Nathan Bossart wrote: > I plan to commit the attached patch shortly. WFM. -- Michael signature.asc Description: PGP signature

Re: Autogenerate some wait events code and documentation

2023-08-29 Thread Michael Paquier
On Tue, Aug 29, 2023 at 02:21:48PM +0200, Alvaro Herrera wrote: > Yeah, I have a mild preference for keeping the prefix, but it's mild > because I also imagine that if somebody doesn't see the full symbol name > when grepping they will think to remove the prefix. So only -0.1. So, are you fine wi

Re: Is pg_regress --use-existing used by anyone or is it broken?

2023-08-29 Thread Peter Geoghegan
On Tue, Aug 29, 2023 at 3:37 PM Daniel Gustafsson wrote: > > It's handy when using pg_regress with a custom test suite, where I > > don't want to be nagged about disconnecting from the database every > > time. > > I'm curious about your workflow around it, it seems to me that it's kind of > broken

Re: Is pg_regress --use-existing used by anyone or is it broken?

2023-08-29 Thread Daniel Gustafsson
> On 30 Aug 2023, at 00:33, Peter Geoghegan wrote: > > On Tue, Aug 29, 2023 at 2:53 PM Daniel Gustafsson wrote: >> Having looked a bit more on it I have a feeling that plain removing it would >> be >> the best option. Unless someone chimes in as a user of it I'll propose a >> patch >> to remo

Re: Is pg_regress --use-existing used by anyone or is it broken?

2023-08-29 Thread Peter Geoghegan
On Tue, Aug 29, 2023 at 2:53 PM Daniel Gustafsson wrote: > Having looked a bit more on it I have a feeling that plain removing it would > be > the best option. Unless someone chimes in as a user of it I'll propose a > patch > to remove it. -1. I use it. It's handy when using pg_regress with a

Re: Is pg_regress --use-existing used by anyone or is it broken?

2023-08-29 Thread Daniel Gustafsson
> On 29 Aug 2023, at 23:38, Nathan Bossart wrote: > On Mon, Aug 28, 2023 at 03:11:15PM +0200, Daniel Gustafsson wrote: >> Does anyone here use it? > > I don't think I've ever used it. AFAICT it was added with hot standby mode > (efc16ea) to support 'make standbycheck', which was removed last ye

Re: Query execution in Perl TAP tests needs work

2023-08-29 Thread Thomas Munro
On Wed, Aug 30, 2023 at 1:49 AM Noah Misch wrote: > On Tue, Aug 29, 2023 at 04:25:24PM +1200, Thomas Munro wrote: > > On Tue, Aug 29, 2023 at 1:48 PM Noah Misch wrote: > > > https://github.com/cpan-authors/IPC-Run/issues/166#issuecomment-1288190929 > > > > Interesting. But that shows a case with

Re: Is pg_regress --use-existing used by anyone or is it broken?

2023-08-29 Thread Nathan Bossart
On Mon, Aug 28, 2023 at 03:11:15PM +0200, Daniel Gustafsson wrote: > When looking at pg_regress I noticed that the --use-existing support didn't > seem to work. ISTM that the removal/creation of test databases and roles > doesn't run since the conditional is reversed. There is also no support for

Re: Wrong usage of pqMsg_Close message code?

2023-08-29 Thread Nathan Bossart
On Tue, Aug 29, 2023 at 09:15:55AM -0700, Nathan Bossart wrote: > Thanks for the report. I'll get this fixed up. My guess is that this was > leftover from an earlier version of the patch that used the same macro for > identical protocol characters. I plan to commit the attached patch shortly. -

Re: tablecmds.c/MergeAttributes() cleanup

2023-08-29 Thread Nathan Bossart
On Tue, Aug 29, 2023 at 08:44:02PM +0200, Alvaro Herrera wrote: > On 2023-Aug-29, Nathan Bossart wrote: >> My compiler is complaining about 1fa9241b: >> >> ../postgresql/src/backend/commands/sequence.c: In function ‘DefineSequence’: >> ../postgresql/src/backend/commands/sequence.c:196:21: error: ‘

Re: tablecmds.c/MergeAttributes() cleanup

2023-08-29 Thread Alvaro Herrera
On 2023-Aug-29, Nathan Bossart wrote: > On Tue, Aug 29, 2023 at 10:43:39AM +0200, Peter Eisentraut wrote: > > I have committed a few more patches from this series that were already > > agreed upon. The remaining ones are rebased and reordered a bit, attached. > > My compiler is complaining about

Re: tablecmds.c/MergeAttributes() cleanup

2023-08-29 Thread Nathan Bossart
On Tue, Aug 29, 2023 at 10:43:39AM +0200, Peter Eisentraut wrote: > I have committed a few more patches from this series that were already > agreed upon. The remaining ones are rebased and reordered a bit, attached. My compiler is complaining about 1fa9241b: ../postgresql/src/backend/commands/se

Re: Strange presentaion related to inheritance in \d+

2023-08-29 Thread Alvaro Herrera
On 2023-Aug-29, Kyotaro Horiguchi wrote: > Attached is the initial version of the patch. It prevents "CREATE > TABLE" from executing if there is an inconsisntent not-null > constraint. Also I noticed that "ALTER TABLE t ADD NOT NULL c NO > INHERIT" silently ignores the "NO INHERIT" part and fixed

Re: broken master regress tests

2023-08-29 Thread Pavel Stehule
út 29. 8. 2023 v 17:54 odesílatel Alvaro Herrera napsal: > On 2023-Aug-27, Thomas Munro wrote: > > > On Sun, Aug 27, 2023 at 3:03 AM Pavel Stehule > wrote: > > > So it looks so IPC::Run::run is ignore parent environment > > > > I guess the new initdb template captures lc_messages in > > postgres

Re: pg_stat_get_backend_subxact() and backend IDs?

2023-08-29 Thread Nathan Bossart
On Mon, Aug 28, 2023 at 10:53:52AM +0900, Michael Paquier wrote: > I understand that this is not a fantastic naming, but renaming > pgstat_fetch_stat_local_beentry() to something like > pgstat_fetch_stat_local_beentry_by_{index|position}_id() would make > the difference much easier to grasp, and we

Re: Wrong usage of pqMsg_Close message code?

2023-08-29 Thread Nathan Bossart
Hi everyone, Thanks for the report. I'll get this fixed up. My guess is that this was leftover from an earlier version of the patch that used the same macro for identical protocol characters. On Tue, Aug 29, 2023 at 10:01:47AM -0400, Tom Lane wrote: > Michael Paquier writes: >> Actually, this

Re: broken master regress tests

2023-08-29 Thread Alvaro Herrera
On 2023-Aug-27, Thomas Munro wrote: > On Sun, Aug 27, 2023 at 3:03 AM Pavel Stehule wrote: > > So it looks so IPC::Run::run is ignore parent environment > > I guess the new initdb template captures lc_messages in > postgresql.conf, when it runs earlier? I guess if you put > $node->append_conf('

Re: should frontend tools use syncfs() ?

2023-08-29 Thread Nathan Bossart
rebased -- Nathan Bossart Amazon Web Services: https://aws.amazon.com >From 1bb28cfe5d40670386ae663e14c8854dc1b5486d Mon Sep 17 00:00:00 2001 From: Nathan Bossart Date: Mon, 21 Aug 2023 19:05:14 -0700 Subject: [PATCH v6 1/2] move PG_TEMP_FILE* macros to file_utils.h --- src/backend/backup/base

Re: Eager page freeze criteria clarification

2023-08-29 Thread Robert Haas
On Mon, Aug 28, 2023 at 4:30 PM Melanie Plageman wrote: > By low-velocity, do you mean lower overall TPS? In that case, wouldn't you be > less likely to run into xid wraparound and thus need less aggressive > opportunistic freezing? Yes. But it also means that we've got slack capacity to do extra

Re: Debian 12 gcc warning

2023-08-29 Thread Tom Lane
Bruce Momjian writes: > On Tue, Aug 29, 2023 at 10:26:27AM +0700, John Naylor wrote: >> It looks like the former, since I can silence it on gcc 13 / -O1 by doing: >> /* keep compiler quiet */ >> actual_arg_types[0] = InvalidOid; > Agreed, that fixes it for me too. In fact, assigning to only elem

Re: Wrong usage of pqMsg_Close message code?

2023-08-29 Thread Tom Lane
Michael Paquier writes: > Actually, this may be OK as well as it stands. One can also say that > the parallel processing is out of this scope, being used only > internally. I cannot keep wondering whether we should put more > efforts in documenting the parallel worker/leader protocol. That's >

Re: Allow specifying a dbname in pg_basebackup connection string

2023-08-29 Thread Jelte Fennema
On Mon, 28 Aug 2023 at 23:50, Tristen Raab wrote: > I've reviewed your patch and it applies and builds without error. When > testing this patch I was slightly confused as to what its purpose was, after > testing it I now understand. Initially, I thought this was a change to add > database-level

Re: Query execution in Perl TAP tests needs work

2023-08-29 Thread Noah Misch
On Tue, Aug 29, 2023 at 04:25:24PM +1200, Thomas Munro wrote: > On Tue, Aug 29, 2023 at 1:48 PM Noah Misch wrote: > > https://github.com/cpan-authors/IPC-Run/issues/166#issuecomment-1288190929 > > Interesting. But that shows a case with no pipes connected, using > select() as a dumb sleep and ig

Re: A failure in 031_recovery_conflict.pl on Debian/s390x

2023-08-29 Thread Christoph Berg
Re: Thomas Munro > 2022), and then backpatched to all releases. They were disabled again > in release branches 10-14 (discussion at > https://postgr.es/m/3447060.1652032...@sss.pgh.pa.us): > > +plan skip_all => "disabled until after minor releases, due to instability"; Right: https://pgdgbuild.d

Re: logical_replication_mode

2023-08-29 Thread Peter Eisentraut
On 27.08.23 14:05, Zhijie Hou (Fujitsu) wrote: On Friday, August 25, 2023 5:56 PM Amit Kapila wrote: On Fri, Aug 25, 2023 at 12:38 PM Peter Eisentraut wrote: On 25.08.23 08:52, Zhijie Hou (Fujitsu) wrote: On Friday, August 25, 2023 12:28 PM Amit Kapila wrote: On Thu, Aug 24, 2023 at 12

Re: Debian 12 gcc warning

2023-08-29 Thread Bruce Momjian
On Tue, Aug 29, 2023 at 10:26:27AM +0700, John Naylor wrote: > > On Tue, Aug 29, 2023 at 6:56 AM David Rowley wrote: > > > > I'm just not sure if it's unable to figure out if at least nargs > > elements is set or if it won't be happy until all 100 elements are > > set. > > It looks like the form

Re: Eliminate redundant tuple visibility check in vacuum

2023-08-29 Thread Melanie Plageman
Hi David, Thanks for taking a look! On Tue, Aug 29, 2023 at 5:07 AM David Geier wrote: > > Hi Melanie, > > On 8/29/23 01:49, Melanie Plageman wrote: > > While working on a set of patches to combine the freeze and visibility > > map WAL records into the prune record, I wrote the attached patches >

Re: pg_rewind WAL segments deletion pitfall

2023-08-29 Thread torikoshia
On 2023-08-24 09:45, Kyotaro Horiguchi wrote: At Wed, 23 Aug 2023 13:44:52 +0200, Alexander Kukushkin wrote in On Tue, 22 Aug 2023 at 07:32, Michael Paquier wrote: > I don't like much this patch. While it takes correctly advantage of > the backward record read logic from SimpleXLogPageRead()

Re: Standardize spelling of "power of two"

2023-08-29 Thread Daniel Gustafsson
> On 29 Aug 2023, at 13:11, Alvaro Herrera wrote: > > On 2023-Aug-29, Daniel Gustafsson wrote: > >> Agreed. While we have numerous "power of 2" these were the only ones >> in translated user-facing messages, so I've pushed this to master (it >> didn't seem worth disrupting translations for 16 a

Re: subscription/015_stream sometimes breaks

2023-08-29 Thread Alvaro Herrera
On 2023-Aug-29, Amit Kapila wrote: > On Mon, Aug 28, 2023 at 5:35 AM Peter Smith wrote: > > > > On Fri, Aug 25, 2023 at 8:15 PM Amit Kapila wrote: > > > > IMO there are inconsistencies in the second patch that was pushed. > I find your suggestions reasonable. Alvaro, do you have any comments?

Re: Autogenerate some wait events code and documentation

2023-08-29 Thread Alvaro Herrera
On 2023-Aug-29, Michael Paquier wrote: > On Tue, Aug 29, 2023 at 08:17:10AM +0200, Drouvot, Bertrand wrote: > > Agree that done that way one could easily grep the events from the > > source code and match them with wait_event_names.txt. Then I don't > > think the "search" issue in the code is stil

Use the same Windows image on both VS and MinGW tasks

2023-08-29 Thread Nazir Bilal Yavuz
Hi, The VS and MinGW Windows images are merged on Andres' pg-vm-images repository now [1]. So, the old pg-ci-windows-ci-vs-2019 and pg-ci-windows-ci-mingw64 images will not be updated from now on. This new merged image (pg-ci-windows-ci) needs to be used on both VS and MinGW tasks. I attached a pa

Re: proposal: psql: show current user in prompt

2023-08-29 Thread Jelte Fennema
On Mon, 28 Aug 2023 at 15:00, Pavel Stehule wrote: + minServerMajor = 1600; + serverMajor = PQserverVersion(pset.db) / 100; Instead of using the server version, we should instead use the protocol version negotiation that's provided by the NegotiateProto

Re: persist logical slots to disk during shutdown checkpoint

2023-08-29 Thread Ashutosh Bapat
On Tue, Aug 29, 2023 at 2:21 PM Amit Kapila wrote: > > On Tue, Aug 29, 2023 at 10:16 AM vignesh C wrote: > > > > That makes sense. The attached v6 version has the changes for the > > same, apart from this I have also fixed a) pgindent issues b) perltidy > > issues c) one variable change (flush_ls

Re: tablecmds.c/MergeAttributes() cleanup

2023-08-29 Thread Alvaro Herrera
On 2023-Aug-29, Peter Eisentraut wrote: > From 471fda80c41fae835ecbe63ae8505526a37487a9 Mon Sep 17 00:00:00 2001 > From: Peter Eisentraut > Date: Wed, 12 Jul 2023 16:12:35 +0200 > Subject: [PATCH v2 04/10] Add TupleDescGetDefault() > > This unifies some repetitive code. > > Note: I didn't push

RE: [PoC] pg_upgrade: allow to upgrade publisher node

2023-08-29 Thread Hayato Kuroda (Fujitsu)
Dear Amit, Thank you for giving comments! PSA new version. I ran the pgindent. > > 1. check_and_dump_old_cluster > > > > CURRENT CODE (with v26-0003 patch applied) > > > > /* Extract a list of logical replication slots */ > > get_old_cluster_logical_slot_infos(); > > > > ... > > > > /* > > * Logi

Re: tablecmds.c/MergeAttributes() cleanup

2023-08-29 Thread Alvaro Herrera
On 2023-Aug-29, Peter Eisentraut wrote: Regarding this hunk in 0002, > @@ -3278,13 +3261,16 @@ MergeAttributes(List *schema, List *supers, char > relpersistence, > * > * constraints is a list of CookedConstraint structs for previous > constraints. > * > - * Returns true if merged (constr

Re: Support prepared statement invalidation when result types change

2023-08-29 Thread Jelte Fennema
On Tue, 29 Aug 2023 at 11:29, jian he wrote: > regression=# CREATE TEMP TABLE pcachetest AS SELECT * FROM int8_tbl; > SELECT 5 > regression=# PREPARE prepstmt2(bigint) AS SELECT * FROM pcachetest > WHERE q1 = $1;' > PREPARE > regression=# alter table pcachetest rename q1 to x; > ALTER TABLE > regr

Re: Standardize spelling of "power of two"

2023-08-29 Thread Alvaro Herrera
On 2023-Aug-29, Daniel Gustafsson wrote: > Agreed. While we have numerous "power of 2" these were the only ones > in translated user-facing messages, so I've pushed this to master (it > didn't seem worth disrupting translations for 16 as we are so close to > wrapping it, if others disagree I can

Re: Support run-time partition pruning for hash join

2023-08-29 Thread Richard Guo
On Fri, Aug 25, 2023 at 11:03 AM David Rowley wrote: > I'd suggest writing some cost which costs an execution of run-time > pruning. With LIST and RANGE you probably want something like > cpu_operator_cost * LOG2(nparts) once for each hashed tuple to account > for the binary search over the sort

Re: Sync scan & regression tests

2023-08-29 Thread Heikki Linnakangas
(noticed this thread just now) On 07/08/2023 03:55, Tom Lane wrote: Having said that ... I just noticed that chipmunk, which I'd been ignoring because it had been having configuration-related failures ever since it came back to life about three months ago, has gotten past those problems Yes, I

Re: Prevent psql \watch from running queries that return no rows

2023-08-29 Thread Daniel Gustafsson
> On 22 Aug 2023, at 23:23, Greg Sabino Mullane wrote: > > Thank you for the feedback, everyone. Attached is version 4 of the patch, > featuring a few tests and minor rewordings. I went over this once more, and pushed it along with pgindenting. I did reduce the number of tests since they were

Re: [PATCH v1] PQputCopyEnd never returns 0, fix the inaccurate comment

2023-08-29 Thread Junwang Zhao
On Tue, Aug 29, 2023 at 6:40 AM Michael Paquier wrote: > > On Mon, Aug 28, 2023 at 09:46:07PM +0800, Junwang Zhao wrote: > > Yeah, it makes sense to me, or maybe just `PQputCopyEnd(...) == -1`, > > let's wait for some other opinions. > > One can argue that PQputCopyEnd() returning 0 could be possi

RE: logical_replication_mode

2023-08-29 Thread Zhijie Hou (Fujitsu)
On Tuesday, August 29, 2023 3:26 PM Peter Smith wrote: Thanks for reviewing. > 2. DebugLogicalRepStreamingMode > > -/* possible values for logical_replication_mode */ > +/* possible values for debug_logical_replication_streaming */ > typedef enum > { > - LOGICAL_REP_MODE_BUFFERED, > - LOGICAL

Re: Support prepared statement invalidation when result types change

2023-08-29 Thread jian he
On Tue, Aug 29, 2023 at 12:51 AM Jelte Fennema wrote: > > Could you share the full set of commands that cause the reporting > issue? I don't think my changes should impact this reporting, so I'm > curious if this is a new issue, or an already existing one. I didn't apply your v2 patch. full set o

Re: Standardize spelling of "power of two"

2023-08-29 Thread Daniel Gustafsson
> On 29 Aug 2023, at 10:56, Kyotaro Horiguchi wrote: > pg_resetwal and initdb has an error message like this: > > msgid "argument of --wal-segsize must be a power of 2 between 1 and 1024" > > In other parts in the tree, however, we spell it as "power of two". I > think it would make sense to st

Re: Missing comments/docs about custom scan path

2023-08-29 Thread Etsuro Fujita
On Thu, Aug 3, 2023 at 6:01 PM Etsuro Fujita wrote: > On Mon, Jul 31, 2023 at 7:05 PM Etsuro Fujita wrote: > > While working on [1], I noticed $SUBJECT: Another thing I would like to propose is minor adjustments to the docs related to parallel query: A custom scan provider will typically ad

Re: Eliminate redundant tuple visibility check in vacuum

2023-08-29 Thread David Geier
Hi Melanie, On 8/29/23 01:49, Melanie Plageman wrote: While working on a set of patches to combine the freeze and visibility map WAL records into the prune record, I wrote the attached patches reusing the tuple visibility information collected in heap_page_prune() back in lazy_scan_prune(). hea

Standardize spelling of "power of two"

2023-08-29 Thread Kyotaro Horiguchi
Hello. pg_resetwal and initdb has an error message like this: msgid "argument of --wal-segsize must be a power of 2 between 1 and 1024" In other parts in the tree, however, we spell it as "power of two". I think it would make sense to standardize the spelling for consistency. See the attached.

Re: persist logical slots to disk during shutdown checkpoint

2023-08-29 Thread Amit Kapila
On Tue, Aug 29, 2023 at 10:16 AM vignesh C wrote: > > That makes sense. The attached v6 version has the changes for the > same, apart from this I have also fixed a) pgindent issues b) perltidy > issues c) one variable change (flush_lsn_changed to > confirmed_flush_has_changed) d) corrected few com

Re: Remove IndexInfo.ii_OpclassOptions field

2023-08-29 Thread Peter Eisentraut
On 25.08.23 03:31, Michael Paquier wrote: On Thu, Aug 24, 2023 at 08:57:58AM +0200, Peter Eisentraut wrote: During some refactoring I noticed that the field IndexInfo.ii_OpclassOptions is kind of useless. The IndexInfo struct is notionally an executor support node, but this field is not used in

Re: postgres_fdw: wrong results with self join + enable_nestloop off

2023-08-29 Thread Etsuro Fujita
Hi, Thanks for the detailed explanation! On Mon, Aug 21, 2023 at 10:34 PM Önder Kalacı wrote: >> As described in the commit message, we assume that extensions use the >> hook in a similar way to FDWs > I'm not sure if it is fair to assume that extensions use any hook in any way. I am not sure

Re: tablecmds.c/MergeAttributes() cleanup

2023-08-29 Thread Peter Eisentraut
On 12.07.23 16:29, Peter Eisentraut wrote: On 11.07.23 20:17, Alvaro Herrera wrote: I spent a few minutes doing a test merge of this to my branch with NOT NULL changes.  Here's a quick review. Subject: [PATCH 01/17] Remove obsolete comment about OID support Obvious, trivial.  +1 Subject: [P

Re: logical_replication_mode

2023-08-29 Thread Amit Kapila
On Tue, Aug 29, 2023 at 12:56 PM Peter Smith wrote: > > I had a look at the patch 0001. > > It looks OK to me, but here are a couple of comments: > > == > > 1. Is this fix intended for PG16? > Yes. > I found some mention of this GUC old name lurking in the release v16 notes > [1]. > That s

Re: Wrong usage of pqMsg_Close message code?

2023-08-29 Thread Michael Paquier
On Tue, Aug 29, 2023 at 10:04:24AM +0900, Tatsuo Ishii wrote: >> Yeah, both of you are right here. Anyway, it seems to me that there >> is a bit more going on in protocol.h. I have noticed two more things >> that are incorrect: >> - HandleParallelMessage is missing a message for 'P', but I think

Re: logical_replication_mode

2023-08-29 Thread Peter Smith
Hi Hou-san. I had a look at the patch 0001. It looks OK to me, but here are a couple of comments: == 1. Is this fix intended for PG16? I found some mention of this GUC old name lurking in the release v16 notes [1]. ~~~ 2. DebugLogicalRepStreamingMode -/* possible values for logical_repl