Re: [PATCH] Use indexes on the subscriber when REPLICA IDENTITY is full on the publisher

2023-03-10 Thread Amit Kapila
On Fri, Mar 10, 2023 at 7:58 PM Önder Kalacı wrote: > > > I think one option could be to drop some cases altogether, but not sure we'd > want that. > > As a semi-related question: Are you aware of any setting that'd make > pg_stat_all_indexes > reflect the changes sooner? It is hard to debug

Re: Add LZ4 compression in pg_dump

2023-03-10 Thread Alexander Lakhin
Hello, 23.02.2023 23:24, Tomas Vondra wrote: On 2/23/23 16:26, Tomas Vondra wrote: Thanks for v30 with the updated commit messages. I've pushed 0001 after fixing a comment typo and removing (I think) an unnecessary change in an error message. I'll give the buildfarm a bit of time before

Re: Dead code in ps_status.c

2023-03-10 Thread Andres Freund
Hi, On 2023-03-11 16:59:46 +1300, Thomas Munro wrote: > On Fri, Feb 17, 2023 at 3:38 AM Tom Lane wrote: > > Thomas Munro writes: > > > On Thu, Feb 16, 2023 at 6:34 PM Tom Lane wrote: > > > My GCC compile farm account seems to have expired, or something, so I > > > couldn't check on wrasse's

Re: proposal - get_extension_version function

2023-03-10 Thread Pavel Stehule
Hi st 8. 3. 2023 v 17:58 odesílatel Pavel Stehule napsal: > Hi > > I try to write a safeguard check that ensures the expected extension > version for an extension library. > > Some like > > const char *expected_extversion = "2.5"; > > ... > > extoid = getExtensionOfObject(ProcedureRelationId,

Re: cpluspluscheck vs ICU

2023-03-10 Thread Andres Freund
Hi, On 2023-03-10 19:37:27 -0800, Andres Freund wrote: > On 2022-03-23 08:56:17 -0700, Andres Freund wrote: > > On 2022-03-23 08:19:38 -0400, Andrew Dunstan wrote: > > > On 3/22/22 22:23, Andres Freund wrote: > > > That only helps when running the CI/cfbot setup. Fixing it for other > > > (manual

Re: Dead code in ps_status.c

2023-03-10 Thread Thomas Munro
On Fri, Feb 17, 2023 at 3:38 AM Tom Lane wrote: > Thomas Munro writes: > > On Thu, Feb 16, 2023 at 6:34 PM Tom Lane wrote: > > My GCC compile farm account seems to have expired, or something, so I > > couldn't check on wrasse's host (though whether wrasse is "live" is > > debatable: Solaris

Re: cpluspluscheck vs ICU

2023-03-10 Thread Andres Freund
Hi, On 2022-03-23 08:56:17 -0700, Andres Freund wrote: > On 2022-03-23 08:19:38 -0400, Andrew Dunstan wrote: > > On 3/22/22 22:23, Andres Freund wrote: > > That only helps when running the CI/cfbot setup. Fixing it for other > > (manual or buildfarm) users would be nice. Luckily crake isn't

Re: pg_dump versus hash partitioning

2023-03-10 Thread Julien Rouhaud
On Fri, Mar 10, 2023 at 10:10:14PM -0500, Tom Lane wrote: > Julien Rouhaud writes: > > Working on some side project that can cause dump of hash partitions to be > > routed to a different partition, I realized that --load-via-partition-root > > can > > indeed cause deadlock in such case without

Re: [PATCH] Use indexes on the subscriber when REPLICA IDENTITY is full on the publisher

2023-03-10 Thread Amit Kapila
On Fri, Mar 10, 2023 at 3:25 PM Önder Kalacı wrote: > >> > > Done with an important caveat. I think this reorganization of the test helped > us to find one edge case regarding dropped columns. > > I realized that the dropped columns also get into the tuples_equal() > function. And, > the remote

Re: pg_dump versus hash partitioning

2023-03-10 Thread Tom Lane
Julien Rouhaud writes: > Working on some side project that can cause dump of hash partitions to be > routed to a different partition, I realized that --load-via-partition-root can > indeed cause deadlock in such case without FK dependency or anything else. > The problem is that each worker will

Re: Lock mode in ExecMergeMatched()

2023-03-10 Thread Dean Rasheed
On Fri, 10 Mar 2023 at 21:42, Alexander Korotkov wrote: > > I wonder why does ExecMergeMatched() determine the lock mode using > ExecUpdateLockMode(). Why don't we use lock mode set by > table_tuple_update() like ExecUpdate() does? I skim through the > MERGE-related threads, but didn't find an

Re: pg_dump versus hash partitioning

2023-03-10 Thread Julien Rouhaud
On Tue, Feb 14, 2023 at 02:21:33PM -0500, Tom Lane wrote: > Here's a set of draft patches around this issue. > > 0001 does what I last suggested, ie force load-via-partition-root for > leaf tables underneath a partitioned table with a partitioned-by-hash > enum column. It wasn't quite as messy as

Re: Should vacuum process config file reload more often

2023-03-10 Thread Melanie Plageman
On Fri, Mar 10, 2023 at 6:11 PM Melanie Plageman wrote: > > Quotes below are combined from two of Sawada-san's emails. > > I've also attached a patch with my suggested current version. > > On Thu, Mar 9, 2023 at 10:27 PM Masahiko Sawada wrote: > > > > On Fri, Mar 10, 2023 at 11:23 AM Melanie

Re: postgres_fdw, dblink, and CREATE SUBSCRIPTION security

2023-03-10 Thread Jacob Champion
On Thu, Mar 9, 2023 at 6:17 AM Robert Haas wrote: > That seems like a circular argument. If you call the problem the > confused deputy problem then the issue must indeed be that the deputy > is confused, and needs to talk to someone else to get un-confused. But > why is the deputy necessarily

Re: [PoC] Let libpq reject unexpected authentication requests

2023-03-10 Thread Jacob Champion
On Fri, Mar 10, 2023 at 3:09 PM Michael Paquier wrote: > >> + reason = libpq_gettext("server did not complete > >> authentication"), > >> -+ result = false; > >> ++ result = false; > >> + } > > > > This

Re: Should vacuum process config file reload more often

2023-03-10 Thread Melanie Plageman
Quotes below are combined from two of Sawada-san's emails. I've also attached a patch with my suggested current version. On Thu, Mar 9, 2023 at 10:27 PM Masahiko Sawada wrote: > > On Fri, Mar 10, 2023 at 11:23 AM Melanie Plageman > wrote: > > > > On Tue, Mar 7, 2023 at 12:10 AM Masahiko Sawada

Re: [PoC] Let libpq reject unexpected authentication requests

2023-03-10 Thread Michael Paquier
On Fri, Mar 10, 2023 at 02:32:17PM -0800, Jacob Champion wrote: > On 3/8/23 22:35, Michael Paquier wrote: > Works for me. I wonder if > >sizeof(((PGconn*) 0)->allowed_auth_methods) > > would make pgindent any happier? That'd let you keep the assertion local > to auth_method_allowed, but it

Re: buildfarm + meson

2023-03-10 Thread Andres Freund
Hi, On 2023-03-09 11:55:57 -0800, Andres Freund wrote: > On 2023-03-09 14:47:36 -0500, Andrew Dunstan wrote: > > On 2023-03-09 Th 08:28, Andrew Dunstan wrote: > > > At this stage I think I'm prepared to turn this loose on a couple of my > > > buildfarm animals, and if nothing goes awry for the

Re: Add LZ4 compression in pg_dump

2023-03-10 Thread Michael Paquier
On Fri, Mar 10, 2023 at 07:05:49AM -0600, Justin Pryzby wrote: > On Thu, Mar 09, 2023 at 06:58:20PM +0100, Tomas Vondra wrote: >> I'm a bit confused about the lz4 vs. lz4f stuff, TBH. If we switch to >> lz4f, doesn't that mean it (e.g. restore) won't work on systems that >> only have older lz4

RE: Ability to reference other extensions by schema in extension scripts

2023-03-10 Thread Regina Obe
> "Regina Obe" writes: > >> requires = 'extfoo, extbar' > >> no_relocate = 'extfoo' > > > So when no_relocate is specified, where would that live? > > In the control file. > > > Would I mark the extfoo as not relocatable on CREATE / ALTER of said > > extension? > > Or add an extra field to

Re: Sub-millisecond [autovacuum_]vacuum_cost_delay broken

2023-03-10 Thread Tom Lane
Thomas Munro writes: > I think this is the minimal back-patchable change. I propose to go > ahead and do that, and then to kick the ideas about latch API changes > into a new thread for the next commitfest. OK by me, but then again 4753ef37 wasn't my patch. regards, tom

Re: Ability to reference other extensions by schema in extension scripts

2023-03-10 Thread Tom Lane
"Regina Obe" writes: >> requires = 'extfoo, extbar' >> no_relocate = 'extfoo' > So when no_relocate is specified, where would that live? In the control file. > Would I mark the extfoo as not relocatable on CREATE / ALTER of said > extension? > Or add an extra field to pg_extension We don't

Re: Sub-millisecond [autovacuum_]vacuum_cost_delay broken

2023-03-10 Thread Thomas Munro
On Fri, Mar 10, 2023 at 6:58 PM Thomas Munro wrote: > ... Perhaps something like 0004, which also shows the sort > of thing that we might consider back-patching to 14 and 15 (next > revision I'll move that up the front and put it in back-patchable > form). I think this is the minimal

RE: Ability to reference other extensions by schema in extension scripts

2023-03-10 Thread Regina Obe
> No, pg_depend is not the thing to use for this. I was thinking of a new field in > the extension's control file, right beside where it says it's dependent on such- > and-such extensions in the first place. Say like > > requires = 'extfoo, extbar' > no_relocate = 'extfoo' > So

Re: [PoC] Let libpq reject unexpected authentication requests

2023-03-10 Thread Jacob Champion
On 3/8/23 22:35, Michael Paquier wrote: > I have been reviewing 0001, finishing with the attached, and that's > nice work. My notes are below. Thanks! > pqDropServerData() is in charge of cleaning up the transient data of a > connection between different attempts. Shouldn't

Re: Ability to reference other extensions by schema in extension scripts

2023-03-10 Thread Tom Lane
"Regina Obe" writes: >> If you want to work harder, perhaps a reasonable way to deal with the issue >> would be to allow dependent extensions to declare that they don't want your >> extension relocated. But I do not think it's okay to make that the default >> behavior, much less the only

Re: recovery modules

2023-03-10 Thread Nathan Bossart
Here is a rebased version of the restore modules patch set. I swapped the patch for the stopgap fix for restore_command with the latest version [0], and I marked the restore/ headers as installable (as was recently done for archive/ [1]). There are no other changes. [0]

Lock mode in ExecMergeMatched()

2023-03-10 Thread Alexander Korotkov
Hi! I wonder why does ExecMergeMatched() determine the lock mode using ExecUpdateLockMode(). Why don't we use lock mode set by table_tuple_update() like ExecUpdate() does? I skim through the MERGE-related threads, but didn't find an answer. I also noticed that we use ExecUpdateLockMode() even

RE: Ability to reference other extensions by schema in extension scripts

2023-03-10 Thread Regina Obe
> "Regina Obe" writes: > > [ 0005-Allow-use-of-extschema-reqextname-to-reference.patch ] > > I took a look at this. I'm on board with the feature design, but not so much > with this undocumented restriction you added to ALTER EXTENSION SET > SCHEMA: > > + /* If an extension

Re: [BUG] pg_stat_statements and extended query protocol

2023-03-10 Thread David Zhang
Yes, I agree that proper test coverage is needed here. Will think about how to accomplish this. Tried to apply this patch to current master branch and the build was ok, however it crashed during initdb with a message like below. "performing post-bootstrap initialization ... Segmentation

Re: Add SHELL_EXIT_CODE to psql

2023-03-10 Thread Tom Lane
Justin Pryzby writes: > The exit status is one byte. I think you should define the status > variable along the lines of: > - 0 if successful; or, > - a positive number 1..255 indicating its exit status. or, > - a negative number N indicating it was terminated by signal -N; or, > - 256 if an

Re: zstd compression for pg_dump

2023-03-10 Thread Jacob Champion
Hi, This'll need another rebase over the meson ICU changes. On Wed, Mar 8, 2023 at 10:59 AM Jacob Champion wrote: > I did some smoke testing against zstd's GitHub release on Windows. To > build against it, I had to construct an import library, and put that > and the DLL into the `lib` folder

RE: Ability to reference other extensions by schema in extension scripts

2023-03-10 Thread Regina Obe
> -Original Message- > From: Tom Lane [mailto:t...@sss.pgh.pa.us] > Sent: Friday, March 10, 2023 3:07 PM > To: Regina Obe > Cc: 'Gregory Stark (as CFM)' ; 'Sandro Santilli' > ; pgsql-hackers@lists.postgresql.org; 'Regina Obe' > > Subject: Re: Ability to reference other extensions by

Re: Progress report of CREATE INDEX for nested partitioned tables

2023-03-10 Thread Tom Lane
Justin Pryzby writes: > Update to address a compiler warning in the supplementary patches adding > assertions. I took a look through this. It seems like basically a good solution, but the count_leaf_partitions() function is bothering me, for two reasons: 1. It seems like a pretty expensive

Re: pg_stat_bgwriter.buffers_backend is pretty meaningless (and more?)

2023-03-10 Thread Melanie Plageman
On Fri, Mar 10, 2023 at 3:19 PM Justin Pryzby wrote: > > On Thu, Mar 09, 2023 at 11:43:01AM -0800, Andres Freund wrote: > > > https://api.cirrus-ci.com/v1/artifact/task/6701069548388352/log/src/test/recovery/tmp_check/regression.diffs > > > > Hm. I guess the explanation here is that the buffers

Re: pg_stat_bgwriter.buffers_backend is pretty meaningless (and more?)

2023-03-10 Thread Justin Pryzby
On Thu, Mar 09, 2023 at 11:43:01AM -0800, Andres Freund wrote: > On 2023-03-09 06:51:31 -0600, Justin Pryzby wrote: > > On Tue, Mar 07, 2023 at 10:18:44AM -0800, Andres Freund wrote: > > > Hi, > > > > > > On 2023-03-06 15:21:14 -0500, Melanie Plageman wrote: > > > > Good point. Attached is what

Re: Ability to reference other extensions by schema in extension scripts

2023-03-10 Thread Tom Lane
"Regina Obe" writes: > [ 0005-Allow-use-of-extschema-reqextname-to-reference.patch ] I took a look at this. I'm on board with the feature design, but not so much with this undocumented restriction you added to ALTER EXTENSION SET SCHEMA: + /* If an extension requires this

Re: pg_stat_bgwriter.buffers_backend is pretty meaningless (and more?)

2023-03-10 Thread Melanie Plageman
On Thu, Mar 9, 2023 at 2:43 PM Andres Freund wrote: > On 2023-03-09 06:51:31 -0600, Justin Pryzby wrote: > > On Tue, Mar 07, 2023 at 10:18:44AM -0800, Andres Freund wrote: > > There's a 2nd portion of the test that's still flapping, at least on > > cirrusci. > > > > The issue that Tom mentioned

Re: pgsql: Use ICU by default at initdb time.

2023-03-10 Thread Jeff Davis
On Fri, 2023-03-10 at 07:48 -0800, Jeff Davis wrote: > On Fri, 2023-03-10 at 15:48 +0100, Peter Eisentraut wrote: > > Yes, of course.  So we can't really do what I was thinking of. > > OK, I plan to commit something like the patch in this thread soon. I > just need to add an explanatory comment.

Re: RLS makes COPY TO process child tables

2023-03-10 Thread Tom Lane
Stephen Frost writes: > Yeah, that should also be updated. Perhaps you'd send an updated patch > which includes fixing that too and maybe adds clarifying documentation > to COPY which mentions what happens when RLS is enabled on the relation? I couldn't find anything in copy.sgml that seemed to

Re: Memory leak from ExecutorState context?

2023-03-10 Thread Jehan-Guillaume de Rorthais
Hi, > So I guess the best thing would be to go through these threads, see what > the status is, restart the discussion and propose what to do. If you do > that, I'm happy to rebase the patches, and maybe see if I could improve > them in some way. OK! It took me some time, but I did it. I'll try

Re: pg_usleep for multisecond delays

2023-03-10 Thread Tom Lane
Nathan Bossart writes: > On Fri, Feb 10, 2023 at 10:51:20AM -0800, Nathan Bossart wrote: >> On Fri, Feb 10, 2023 at 10:18:34AM -0500, Tom Lane wrote: >>> BTW, we have an existing pg_sleep() function that deals with all >>> of this except re-setting the latch. > Here is a work-in-progress patch.

Re: POC: Lock updated tuples in tuple_update() and tuple_delete()

2023-03-10 Thread Chris Travers
"Right, the improvement this patch gives to the heap is not the full motivation. Another motivation is the improvement it gives to TableAM API. Our current API implies that the effort on locating the tuple by tid is small. This is more or less true for the heap, where we just need to pin and

Re: RLS makes COPY TO process child tables

2023-03-10 Thread Tom Lane
Stephen Frost writes: >> Tom Lane wrote: >>> Yugo NAGATA writes: I think this is a bug because the current behaviour is different from the documentation. >>> I agree, it shouldn't do that. > Yeah, I agree based on what the COPY table TO docs say should be > happening. Yeah, the

Re: pgsql: Use ICU by default at initdb time.

2023-03-10 Thread Jeff Davis
On Fri, 2023-03-10 at 15:48 +0100, Peter Eisentraut wrote: > Yes, of course.  So we can't really do what I was thinking of. OK, I plan to commit something like the patch in this thread soon. I just need to add an explanatory comment. It passes CI, but it's possible that there could be more

Re: Date-Time dangling unit fix

2023-03-10 Thread Tom Lane
Alexander Lakhin writes: > I also wonder how the units affect time zone parsing. > With the patch: > SELECT time with time zone '010203m+3'; > ERROR:  invalid input syntax for type time with time zone: "010203m+3" > But without the patch: > SELECT time with time zone '010203m+3'; >  01:02:03+03

Re: pgsql: Use ICU by default at initdb time.

2023-03-10 Thread Peter Eisentraut
On 10.03.23 15:38, Jeff Davis wrote: On Fri, 2023-03-10 at 10:59 +0100, Peter Eisentraut wrote: I think originally the locale forced the encoding.  With ICU, we have a choice.  We could either stick to the encoding suggested by the OS, or pick our own. We still need LC_COLLATE and LC_CTYPE to

Re: pgsql: Use ICU by default at initdb time.

2023-03-10 Thread Jeff Davis
On Fri, 2023-03-10 at 10:59 +0100, Peter Eisentraut wrote: > I think originally the locale forced the encoding.  With ICU, we have > a > choice.  We could either stick to the encoding suggested by the OS, > or > pick our own. We still need LC_COLLATE and LC_CTYPE to match the database encoding

Re: [PATCH] Add pretty-printed XML output option

2023-03-10 Thread Tom Lane
Jim Jones writes: > On 09.03.23 21:21, Tom Lane wrote: >> I've looked through this now, and have some minor complaints and a major >> one. The major one is that it doesn't work for XML that doesn't satisfy >> IS DOCUMENT. For example, > How do you suggest the output should look like? I'd say

Re: [PoC] Improve dead tuple storage for lazy vacuum

2023-03-10 Thread Masahiko Sawada
On Fri, Mar 10, 2023 at 3:42 PM John Naylor wrote: > > On Thu, Mar 9, 2023 at 1:51 PM Masahiko Sawada wrote: > > > I've attached the new version patches. I merged improvements and fixes > > I did in the v29 patch. > > I haven't yet had a chance to look at those closely, since I've had to devote

Re: [PATCH] Use indexes on the subscriber when REPLICA IDENTITY is full on the publisher

2023-03-10 Thread Önder Kalacı
Hi Amit, all > I'll look for more opportunities and reply to the thread. I wanted to send > this mail so that you can have a look at (1) earlier. > > > I merged SUBSCRIPTION CREATE/DROP INDEX WORKS WITHOUT ISSUES into SUBSCRIPTION CAN USE INDEXES WITH EXPRESSIONS AND COLUMNS. Also, merged

Re: [PATCH] Add pretty-printed XML output option

2023-03-10 Thread Jim Jones
Thanks a lot for the review! On 09.03.23 21:21, Tom Lane wrote: I've looked through this now, and have some minor complaints and a major one. The major one is that it doesn't work for XML that doesn't satisfy IS DOCUMENT. For example, regression=# select '42'::xml is document; ?column?

Re: Add LZ4 compression in pg_dump

2023-03-10 Thread Justin Pryzby
On Thu, Mar 09, 2023 at 06:58:20PM +0100, Tomas Vondra wrote: > I'm a bit confused about the lz4 vs. lz4f stuff, TBH. If we switch to > lz4f, doesn't that mean it (e.g. restore) won't work on systems that > only have older lz4 version? What would/should happen if we take backup > compressed with

Re: Add standard collation UNICODE

2023-03-10 Thread Peter Eisentraut
On 09.03.23 20:23, Jeff Davis wrote: On Thu, 2023-03-09 at 11:21 +0100, Peter Eisentraut wrote: How about this patch version? Looks good to me. Committed, after adding a test.

Re: psql: Add role's membership options to the \du+ command

2023-03-10 Thread Pavel Luzanov
On 08.03.2023 00:02, David G. Johnston wrote: FWIW I've finally gotten to publishing my beta version of the Role Graph for PostgreSQL pseudo-extension I'd been talking about: https://github.com/polobo/RoleGraphForPostgreSQL Great. So far I've looked very briefly, but it's interesting. I

RE: Rework LogicalOutputPluginWriterUpdateProgress

2023-03-10 Thread Takamichi Osumi (Fujitsu)
Hi, On Friday, March 10, 2023 6:32 PM Wang, Wei/王 威 wrote: > Attach the new patch set. Thanks for updating the patch ! One review comment on v7-0005. stream_start_cb_wrapper and stream_stop_cb_wrapper don't call the pair of threshold check and UpdateProgressAndKeepalive unlike other write

Re: [PATCH] Use indexes on the subscriber when REPLICA IDENTITY is full on the publisher

2023-03-10 Thread Amit Kapila
On Fri, Mar 10, 2023 at 5:16 PM Önder Kalacı wrote: > >> >> wip_for_optimize_index_column_match >> +static bool >> +IndexContainsAnyRemoteColumn(IndexInfo *indexInfo, >> + LogicalRepRelation *remoterel) >> +{ >> + for (int i = 0; i < indexInfo->ii_NumIndexAttrs; i++) >> + { >> >> Wouldn't it be

Re: psql: Add role's membership options to the \du+ command

2023-03-10 Thread Pavel Luzanov
On 08.03.2023 05:31, David G. Johnston wrote: Moving the goal posts for this meta-command to >= 9.5 seems like it should be done as a separate patch and thread.  The documentation presently states we are targeting 9.2 and newer. I missed the comment at the beginning of the file about version

RE: Time delayed LR (WAS Re: logical replication restrictions)

2023-03-10 Thread Hayato Kuroda (Fujitsu)
Dear hackers, Based on the discussion Sawada-san pointed out[1] that the current approach of logical time-delayed avoids recycling WALs, I'm planning to close the CF entry once. This or the forked thread will be registered again after deciding on the alternative approach. Thank you very much

Re: [PATCH] Use indexes on the subscriber when REPLICA IDENTITY is full on the publisher

2023-03-10 Thread Önder Kalacı
Hi Amit, all > wip_for_optimize_index_column_match > +static bool > +IndexContainsAnyRemoteColumn(IndexInfo *indexInfo, > + LogicalRepRelation *remoterel) > +{ > + for (int i = 0; i < indexInfo->ii_NumIndexAttrs; i++) > + { > > Wouldn't it be better to just check if the first column is not

Re: Minimal logical decoding on standbys

2023-03-10 Thread Drouvot, Bertrand
Hi, On 3/8/23 11:25 AM, Drouvot, Bertrand wrote: Hi, On 3/3/23 5:26 PM, Drouvot, Bertrand wrote: Hi, On 3/3/23 8:58 AM, Jeff Davis wrote: On Thu, 2023-03-02 at 11:45 -0800, Jeff Davis wrote: In this case it looks easier to add the right API than to be sure about whether it's needed or not.

Re: Add macros for ReorderBufferTXN toptxn

2023-03-10 Thread Amit Kapila
On Fri, Mar 10, 2023 at 4:36 AM Peter Smith wrote: > > During a recent code review, I was confused multiple times by the > toptxn member of ReorderBufferTXN, which is defined only for > sub-transactions. > > e.g. txn->toptxn member == NULL means the txn is a top level txn. > e.g. txn->toptxn

Re: How to get the real type use oid in internal codes?

2023-03-10 Thread Peter Eisentraut
On 10.03.23 06:33, jack...@gmail.com wrote: I can use relation struct  to get all attributes' typeoid, so which funcion I can use to get the real type. Depends on what you mean by "real", but perhaps the format_type* family of functions would help you.

Re: Date-Time dangling unit fix

2023-03-10 Thread Peter Eisentraut
On 04.03.23 22:05, Tom Lane wrote: Joseph Koshakow writes: On Mon, Dec 12, 2022 at 10:55 AM Joseph Koshakow wrote: I just found another class of this bug that the submitted patch does not fix. If the units are at the beginning of the string, then they are also ignored. For example, `date 'm

Re: Combine pg_walinspect till_end_of_wal functions with others

2023-03-10 Thread Bharath Rupireddy
On Fri, Mar 10, 2023 at 9:54 AM Michael Paquier wrote: > > Hmm. I think this patch ought to have a result simpler than what's > proposed here. > > First, do we really have to begin marking the functions as non-STRICT > to abide with the treatment of NULL as a special value? The part that > I've

Re: [PATCH] Use indexes on the subscriber when REPLICA IDENTITY is full on the publisher

2023-03-10 Thread Önder Kalacı
Hi Peter, all > src/backend/replication/logical/relation.c > > 1. FindUsableIndexForReplicaIdentityFull > > +static Oid > +FindUsableIndexForReplicaIdentityFull(Relation localrel) > +{ > + List*indexlist = RelationGetIndexList(localrel); > + Oid usableIndex = InvalidOid; > + ListCell *lc;

Re: Combine pg_walinspect till_end_of_wal functions with others

2023-03-10 Thread Michael Paquier
On Fri, Mar 10, 2023 at 04:37:23PM +0800, Julien Rouhaud wrote: > isn't '0/0' the same as InvalidXLogRecPtr? but my point is that we > shouldn't require to spell it explicitly, just rely on the default value. Perhaps. Still the addition of a DEFAULT to the function definitions and its value

Re: logical decoding and replication of sequences, take 2

2023-03-10 Thread John Naylor
On Wed, Mar 1, 2023 at 1:02 AM Tomas Vondra wrote: > here's a rebased patch to make cfbot happy, dropping the first part that > is now unnecessary thanks to 7fe1aa991b. Hi Tomas, I'm looking into doing some "in situ" testing, but for now I'll mention some minor nits I found: 0001 + * so we

Re: pgsql: Use ICU by default at initdb time.

2023-03-10 Thread Peter Eisentraut
On 10.03.23 03:26, Jeff Davis wrote: That's because ICU always uses UTF-8 by default. ICU works just fine with many other encodings; is there a reason it doesn't take it from the environment just like for provider=libc? I think originally the locale forced the encoding. With ICU, we have a

Re: pgsql: Allow tailoring of ICU locales with custom rules

2023-03-10 Thread Peter Eisentraut
On 08.03.23 21:57, Jeff Davis wrote: On Wed, 2023-03-08 at 16:03 +, Peter Eisentraut wrote: Allow tailoring of ICU locales with custom rules Late review: * Should throw error when provider != icu and rules != NULL I have fixed that. * Explain what the example means. By itself, users

RE: Rework LogicalOutputPluginWriterUpdateProgress

2023-03-10 Thread wangw.f...@fujitsu.com
On Mon, Mar 10, 2023 14:35 PM Amit Kapila wrote: > On Fri, Mar 10, 2023 at 11:17 AM Peter Smith wrote: > > > > On Fri, Mar 10, 2023 at 3:32 PM Amit Kapila wrote: > > > > > > On Thu, Mar 9, 2023 at 10:56 AM Peter Smith > wrote: > > > > > > > > 2. rollback_prepared_cb_wrapper > > > > > > > >

RE: Rework LogicalOutputPluginWriterUpdateProgress

2023-03-10 Thread wangw.f...@fujitsu.com
On Thur, Mar 9, 2023 13:26 PM Peter Smith wrote: > Here are some review comments for v6-0001 Thanks for your comments. > == > General. > > 1. > There are lots of new comments saying: > /* don't call update progress, we didn't really make any */ > > but is the wording "call update

RE: Rework LogicalOutputPluginWriterUpdateProgress

2023-03-10 Thread wangw.f...@fujitsu.com
On Wed, Mar 8, 2023 23:55 PM Osumi, Takamichi/大墨 昂道 wrote: > Hi, > > > On Wednesday, March 8, 2023 11:54 AM From: wangw.f...@fujitsu.com > wrote: > > Attach the new patch. > Thanks for sharing v6 ! Few minor comments for the same. Thanks for your comments. > (1) commit message > > The old

RE: Rework LogicalOutputPluginWriterUpdateProgress

2023-03-10 Thread wangw.f...@fujitsu.com
On Wed, Mar 8, 2023 19:06 PM Kuroda, Hayato/黒田 隼人 wrote: > Dear Wang, Thanks for your testing and comments. > --- > ``` > +/* > + * Update progress tracking and send keep alive (if required). > + */ > +static void > +UpdateProgressAndKeepalive(LogicalDecodingContext *ctx, bool finished_xact) >

RE: Rework LogicalOutputPluginWriterUpdateProgress

2023-03-10 Thread wangw.f...@fujitsu.com
On Mon, Mar 10, 2023 11:56 AM Amit Kapila wrote: > On Wed, Mar 8, 2023 at 8:24 AM wangw.f...@fujitsu.com > wrote: > > > > Attach the new patch. > > > > I think this combines multiple improvements in one patch. We can > consider all of them together or maybe it would be better to split > some of

Re: [Proposal] Add foreign-server health checks infrastructure

2023-03-10 Thread Katsuragi Yuta
On 2023-03-08 13:40, Hayato Kuroda (Fujitsu) wrote: Dear Vignesh, Thank you for reviewing! PSA new version. Hi, Thank you for the comments, Vignesh. Thank you for updating the patch, Kuroda-san. This fix looks fine to me. And also, there seems no other comments from this post [1]. So, I'm

Re: POC: Lock updated tuples in tuple_update() and tuple_delete()

2023-03-10 Thread Alexander Korotkov
On Wed, Mar 8, 2023 at 4:22 AM Andres Freund wrote: > On 2023-03-07 04:45:32 +0300, Alexander Korotkov wrote: > > The second patch now implements a concept of LazyTupleTableSlot, a slot > > which gets allocated only when needed. Also, there is more minor > > refactoring and more comments. > >

Re: Combine pg_walinspect till_end_of_wal functions with others

2023-03-10 Thread Julien Rouhaud
On Fri, 10 Mar 2023, 16:14 Michael Paquier, wrote: > On Fri, Mar 10, 2023 at 04:04:15PM +0800, Julien Rouhaud wrote: > > As long as we provide a sensible default value (so I guess '0/0' to > > mean "no upper bound") and that we therefore don't have to manually > > specify an upper bound if we

Re: Compilation error after redesign of the archive modules

2023-03-10 Thread Michael Paquier
On Fri, Mar 10, 2023 at 01:41:07PM +0530, Sravan Kumar wrote: > I have attached a patch that fixes the problem. Can you please review > if it makes sense to push this patch? Indeed, reproduced here. I'll fix that in a bit.. -- Michael signature.asc Description: PGP signature

Re: Combine pg_walinspect till_end_of_wal functions with others

2023-03-10 Thread Michael Paquier
On Fri, Mar 10, 2023 at 04:04:15PM +0800, Julien Rouhaud wrote: > As long as we provide a sensible default value (so I guess '0/0' to > mean "no upper bound") and that we therefore don't have to manually > specify an upper bound if we don't want one I'm fine with keeping the > functions marked as

Assert failure of the cross-check for nullingrels

2023-03-10 Thread Richard Guo
While looking into issue [1], I came across $subject on master. Below is how to reproduce it. DROP TABLE IF EXISTS t1,t2,t3,t4 CASCADE; CREATE TABLE t1 AS SELECT true AS x FROM generate_series(0,1) x; CREATE TABLE t2 AS SELECT true AS x FROM generate_series(0,1) x; CREATE TABLE t3 AS SELECT true

Compilation error after redesign of the archive modules

2023-03-10 Thread Sravan Kumar
Hi, With the redesign of the archive modules: 35739b87dcfef9fc0186aca659f262746fecd778 - Redesign archive modules if we were to compile basic_archive module with USE_PGXS=1, we get compilation error: []$ make USE_PGXS=1 gcc -std=gnu99 -Wall -Wmissing-prototypes -Wpointer-arith

Re: Combine pg_walinspect till_end_of_wal functions with others

2023-03-10 Thread Julien Rouhaud
On Fri, Mar 10, 2023 at 12:24 PM Michael Paquier wrote: > > On Wed, Mar 08, 2023 at 01:40:46PM +0530, Bharath Rupireddy wrote: > > 1. When start_lsn is NULL or invalid ('0/0'), emit an error. There was > > a comment on the functions automatically determining start_lsn to be > > the oldest WAL