Re: Emit a warning if the extension's GUC is set incorrectly

2021-12-15 Thread Shinya Kato
Thank you for the review and sorry for the late reply. On 2021-11-16 19:25, Bharath Rupireddy wrote: > I observed an odd behaviour: > 1) I set postgres_fdw.XXX = 'I_messed_up_conf_file' in postgresql.conf > 2) With EmitWarningsOnPlaceholders("postgres_fdw"); in postgres_fdw > contrib module, I

RE: parallel vacuum comments

2021-12-15 Thread houzj.f...@fujitsu.com
On Wed, Dec 15, 2021 4:03 PM Masahiko Sawada wrote: > On Tue, Dec 14, 2021 at 12:03 PM Amit Kapila wrote: > > There is still pending > > work related to moving parallel vacuum code to a separate file and a > > few other pending comments that are still under discussion. We can > > take care of

Re: Failed transaction statistics to measure the logical replication progress

2021-12-15 Thread Greg Nancarrow
On Tue, Dec 14, 2021 at 1:28 PM Amit Kapila wrote: > > If we fear a large number of entries for such workers then won't it be > better to show the value of these stats only for apply workers. I > think normally the table sync workers perform only copy operation or > maybe a fixed number of xacts,

RE: Failed transaction statistics to measure the logical replication progress

2021-12-15 Thread osumi.takami...@fujitsu.com
On Wednesday, December 15, 2021 9:52 PM vignesh C wrote: > On Tue, Dec 14, 2021 at 7:58 AM Amit Kapila > wrote: > > > > On Mon, Dec 13, 2021 at 5:48 PM osumi.takami...@fujitsu.com > > wrote: > > > > > > On Monday, December 13, 2021 6:19 PM Amit Kapila > wrote: > > > > On Tue, Dec 7, 2021 at

Addition of --no-sync to pg_upgrade for test speedup

2021-12-15 Thread Michael Paquier
Hi all, As per $subject, avoiding the flush of the new cluster's data directory shortens a bint the runtime of the test. In some of my slow VMs, aka Windows, this shaves a couple of seconds even if the bulk of the time is still spent on the main regression test suite. In pg_upgrade, we let the

Re: Allow escape in application_name

2021-12-15 Thread Fujii Masao
On 2021/12/16 11:53, kuroda.hay...@fujitsu.com wrote: Dear Fujii-san, Thank you for updating! I read your patches and I have only one comment. if (strcmp(keywords[i], "application_name") == 0 && values[i] != NULL && *(values[i]) !=

Re: Documenting when to retry on serialization failure

2021-12-15 Thread Greg Stark
Fwiw I think the real problem with automatic retries is that the SQL interface doesn't lend itself to it because the server never really knows if the command is going to be followed by a commit or more commands. I actually think if that problem were tackled it would very likely be a highly

Re: [PATCH] Accept IP addresses in server certificate SANs

2021-12-15 Thread Kyotaro Horiguchi
At Thu, 16 Dec 2021 01:13:57 +, Jacob Champion wrote in > This patch arose because I was writing tests for the NSS implementation > that used a server cert with both DNS names and IP addresses, and then > they failed when I ran those tests against the OpenSSL implementation. > NSS supports

Re: Skipping logical replication transactions on subscriber side

2021-12-15 Thread Masahiko Sawada
On Thu, Dec 16, 2021 at 2:21 PM Amit Kapila wrote: > > On Thu, Dec 16, 2021 at 10:37 AM Masahiko Sawada > wrote: > > > > On Thu, Dec 16, 2021 at 11:43 AM Amit Kapila > > wrote: > > > > > > I thought we just want to lock before clearing the skip_xid something > > > like take the lock, check if

Re: Optionally automatically disable logical replication subscriptions on error

2021-12-15 Thread Greg Nancarrow
On Tue, Dec 14, 2021 at 4:34 PM osumi.takami...@fujitsu.com wrote: > > Besides all of those changes, I've removed the obsolete > comment of DisableSubscriptionOnError in v12. > I have a few minor comments, otherwise the patch LGTM at this point: doc/src/sgml/catalogs.sgml (1) Current comment

Re: Skipping logical replication transactions on subscriber side

2021-12-15 Thread Amit Kapila
On Thu, Dec 16, 2021 at 10:37 AM Masahiko Sawada wrote: > > On Thu, Dec 16, 2021 at 11:43 AM Amit Kapila wrote: > > > > I thought we just want to lock before clearing the skip_xid something > > like take the lock, check if the skip_xid in the catalog is the same > > as we have skipped, if it is

Re: Skipping logical replication transactions on subscriber side

2021-12-15 Thread Masahiko Sawada
On Thu, Dec 16, 2021 at 11:43 AM Amit Kapila wrote: > > On Wed, Dec 15, 2021 at 8:19 PM Masahiko Sawada wrote: > > > > On Wed, Dec 15, 2021 at 1:10 PM Amit Kapila wrote: > > > > > > On Wed, Dec 15, 2021 at 8:19 AM Masahiko Sawada > > > wrote: > > > > > > > > On Tue, Dec 14, 2021 at 2:35 PM

Re: pg_dump versus ancient server versions

2021-12-15 Thread Tom Lane
Justin Pryzby writes: > I think you missed a few parts though ? Um. I think those are leftover from when I was intending the cutoff to be 9.0 not 9.2. I'll take a fresh look tomorrow. regards, tom lane

Re: pg_dump versus ancient server versions

2021-12-15 Thread Justin Pryzby
On Wed, Dec 15, 2021 at 10:08:07PM -0600, Justin Pryzby wrote: > Is it possible to clean up pg_upgrade, too ? Nevermind - I found yesterday's e469f0aaf3 after git-fetch. I think you missed a few parts though ? src/bin/pg_upgrade/function.c if

Re: parallel vacuum comments

2021-12-15 Thread Amit Kapila
On Wed, Dec 15, 2021 at 1:33 PM Masahiko Sawada wrote: > > I've attached an updated patch. The patch incorporated several changes > from the last version: > > * Rename parallel_vacuum_begin() to parallel_vacuum_init() > * Unify the terminology; use "index bulk-deletion" and "index cleanup" >

Re: pg_dump versus ancient server versions

2021-12-15 Thread Tom Lane
Justin Pryzby writes: > On Tue, Dec 14, 2021 at 05:18:44PM -0500, Tom Lane wrote: >> I've completed the pg_dump/pg_dumpall part of that, but while > Is it possible to clean up pg_upgrade, too ?

Re: Transparent column encryption

2021-12-15 Thread Greg Stark
> In the server, the encrypted datums are stored in types called > encryptedr and encryptedd (for randomized and deterministic > encryption). These are essentially cousins of bytea. Does that mean someone could go in with psql and select out the data without any keys and just get a raw

Re: [PATCH] Document heuristics for parameterized paths

2021-12-15 Thread Greg Stark
On Wed, 15 Dec 2021 at 23:22, Greg Stark wrote: > > On Mon, 6 Dec 2021 at 13:01, Steinar H. Gunderson > wrote: > > > > +one that must cannot be delayed right away (because of outer join > > must cannot? Actually on further reading... "delayed right away"? -- greg

Re: [PATCH] Document heuristics for parameterized paths

2021-12-15 Thread Greg Stark
On Mon, 6 Dec 2021 at 13:01, Steinar H. Gunderson wrote: > > +one that must cannot be delayed right away (because of outer join must cannot? -- greg

Re: pg_dump versus ancient server versions

2021-12-15 Thread Justin Pryzby
On Tue, Dec 14, 2021 at 05:18:44PM -0500, Tom Lane wrote: > I wrote: > > Anyway, it seems like there's some consensus that 9.2 is a good > > stopping place for today. I'll push forward with > > (1) back-patching as necessary to make 9.2 and up build cleanly > > on the platforms I have handy; > >

Re: COPY IN/BOTH vs. extended query mode

2021-12-15 Thread Jeff Davis
On Mon, 2017-01-23 at 21:12 -0500, Robert Haas wrote: > According to the documentation for COPY IN mode, "If the COPY command > was issued via an extended-query message, the backend will now > discard > frontend messages until a Sync message is received, then it will > issue > ReadyForQuery and

Re: A micro-optimisation for ProcSendSignal()

2021-12-15 Thread Thomas Munro
On Tue, Aug 3, 2021 at 2:56 PM Andres Freund wrote: > On 2021-08-03 13:44:58 +1200, Thomas Munro wrote: > > In the case of buffer pin waits, we switch to storing the pgprocno of > > the waiter. In the case of SERIALIZABLE READ ONLY DEFERRABLE waits, we > > derive the pgprocno from the vxid

RE: Allow escape in application_name

2021-12-15 Thread kuroda.hay...@fujitsu.com
Dear Fujii-san, Thank you for updating! I read your patches and I have only one comment. > if (strcmp(keywords[i], "application_name") == 0 && > values[i] != NULL && *(values[i]) != '\0') I'm not sure but do we have a case that values[i]

Re: Rewriting the test of pg_upgrade as a TAP test - take three - remastered set

2021-12-15 Thread Michael Paquier
On Wed, Dec 15, 2021 at 10:47:24AM +0900, Michael Paquier wrote: > Missed that, thanks! I'll think about all that a bit more before > sending a long-overdue rebased version. Okay, here is finally a rebase of this patch, where I have fixed a couple of existing issues, and I have extended the

Apple's ranlib warns about protocol_openssl.c

2021-12-15 Thread Thomas Munro
Hi, Apple's ranlib doesn't like empty translation units[1], but protocol_openssl.c doesn't define any symbols (unless you have an ancient EOL'd openssl), so longfin and CI say: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file:

Re: Skipping logical replication transactions on subscriber side

2021-12-15 Thread Amit Kapila
On Wed, Dec 15, 2021 at 8:19 PM Masahiko Sawada wrote: > > On Wed, Dec 15, 2021 at 1:10 PM Amit Kapila wrote: > > > > On Wed, Dec 15, 2021 at 8:19 AM Masahiko Sawada > > wrote: > > > > > > On Tue, Dec 14, 2021 at 2:35 PM Greg Nancarrow > > > wrote: > > > > > > > > On Tue, Dec 14, 2021 at

Re: Buildfarm support for older versions

2021-12-15 Thread Larry Rosenman
On 12/15/2021 11:15 am, Andrew Dunstan wrote: OK, old_branches_of_interest.txt now exists on the buildfarm server, and the code has been modified to take notice of it (i.e. to accept builds for branches listed there). The contents are the non-live versions from 9.2 on. I have set up a test

RE: Confused comment about drop replica identity index

2021-12-15 Thread wangw.f...@fujitsu.com
On Tue, Dec 16, 2021 at 06:40AM, Michael Paquier wrote: > Would you like to write a patch to address all that? OK, I will push it soon. Regards, Wang wei

Re: Synchronizing slots from primary to standby

2021-12-15 Thread Hsu, John
Hello, I started taking a brief look at the v2 patch, and it does appear to work for the basic case. Logical slot is synchronized across and I can connect to the promoted standby and stream changes afterwards. It's not clear to me what the correct behavior is when a logical slot that has been

Re: pg_upgrade should truncate/remove its logs before running

2021-12-15 Thread Michael Paquier
On Wed, Dec 15, 2021 at 04:13:10PM -0600, Justin Pryzby wrote: > On Wed, Dec 15, 2021 at 05:04:54PM -0500, Andrew Dunstan wrote: >> The directory name needs to be predictable somehow, or maybe optionally >> set as a parameter. Having just a timestamped directory name would make >> life annoying

[PATCH] Accept IP addresses in server certificate SANs

2021-12-15 Thread Jacob Champion
Hello all, libpq currently supports server certificates with a single IP address in the Common Name. It's fairly brittle; as far as I can tell, the single name you choose has to match the client's address exactly. Attached is a patch for libpq to support IP addresses in the server's Subject

Re: Unnecessary delay in streaming replication due to replay lag

2021-12-15 Thread Soumyadeep Chakraborty
Hi Bharath, Thanks for the review! On Sat, Nov 27, 2021 at 6:36 PM Bharath Rupireddy < bharath.rupireddyforpostg...@gmail.com> wrote: > 1) A memory leak: add FreeDir(dir); before returning. > + ereport(LOG, > + (errmsg("Could not start streaming WAL eagerly"), > + errdetail("There are timeline

Re: A test for replay of regression tests

2021-12-15 Thread Michael Paquier
On Wed, Dec 15, 2021 at 05:50:45PM +0900, Michael Paquier wrote: > Hmm. FWIW, I am working on doing similar for pg_upgrade to switch to > TAP there, and we share a lot in terms of running pg_regress on an > exising cluster. Wouldn't it be better to move this definition to >

Re: Life cycles of tuple descriptors

2021-12-15 Thread Tom Lane
Thomas Munro writes: > On Thu, Dec 16, 2021 at 11:51 AM Tom Lane wrote: >> Here's a draft patch for this. > LGTM. Pushed, thanks for looking. regards, tom lane

Re: Life cycles of tuple descriptors

2021-12-15 Thread Chapman Flack
On 12/15/21 17:50, Tom Lane wrote: > Here's a draft patch for this. There are several places that are > directly using DecrTupleDescRefCount after lookup_rowtype_tupdesc > or equivalent, which'd now be forbidden. I think they are all safe > given the assumption that the typcache's tupdescs for

Re: Life cycles of tuple descriptors

2021-12-15 Thread Thomas Munro
On Thu, Dec 16, 2021 at 11:51 AM Tom Lane wrote: > Here's a draft patch for this. There are several places that are > directly using DecrTupleDescRefCount after lookup_rowtype_tupdesc > or equivalent, which'd now be forbidden. I think they are all safe > given the assumption that the typcache's

Re: Life cycles of tuple descriptors

2021-12-15 Thread Tom Lane
I wrote: > Chapman Flack writes: >> Oh, hmm, maybe one thing in that API comment ought to be changed. It says >> I must call ReleaseTupleDesc *or* DecrTupleDescRefCount. Maybe that dates >> from before the shared registry? ReleaseTupleDesc is safe, but anybody who >> uses DecrTupleDescRefCount on

Re: Confused comment about drop replica identity index

2021-12-15 Thread Michael Paquier
On Wed, Dec 15, 2021 at 09:18:26AM +, wangw.f...@fujitsu.com wrote: > Yeah, if we can add some details to pg-doc and code comments, I think it will > be more friendly to PG users and developers. Would you like to write a patch to address all that? Thanks, -- Michael signature.asc

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

2021-12-15 Thread Justin Pryzby
On Fri, Dec 03, 2021 at 03:02:24PM -0500, Melanie Plageman wrote: > Thanks again! I really appreciate the thorough review. > > I have combined responses to all three of your emails below. > Let me know if it is more confusing to do it this way. One email is better than three - I'm just not a

Re: pg_upgrade should truncate/remove its logs before running

2021-12-15 Thread Justin Pryzby
On Wed, Dec 15, 2021 at 05:04:54PM -0500, Andrew Dunstan wrote: > On 12/15/21 16:23, Bruce Momjian wrote: > > On Wed, Dec 15, 2021 at 04:17:23PM -0500, Tom Lane wrote: > >> Bruce Momjian writes: > >>> On Sat, Dec 11, 2021 at 08:50:17PM -0600, Justin Pryzby wrote: > If pg_upgrade fails and is

Re: Add index scan progress to pg_stat_progress_vacuum

2021-12-15 Thread Bossart, Nathan
On 12/1/21, 3:02 PM, "Imseih (AWS), Sami" wrote: > The current implementation of pg_stat_progress_vacuum does not > provide progress on which index is being vacuumed making it > difficult for a user to determine if the "vacuuming indexes" phase > is making progress. By exposing which index is

Re: Support for NSS as a libpq TLS backend

2021-12-15 Thread Daniel Gustafsson
> On 25 Nov 2021, at 14:39, Joshua Brindle > wrote: > On Wed, Nov 24, 2021 at 8:49 AM Joshua Brindle > wrote: >> >> On Wed, Nov 24, 2021 at 8:46 AM Joshua Brindle >> wrote: >> I don't know enough about NSS to know if this is problematic or not >> but if I try verify-full without having the

Re: pg_upgrade should truncate/remove its logs before running

2021-12-15 Thread Andrew Dunstan
On 12/15/21 16:23, Bruce Momjian wrote: > On Wed, Dec 15, 2021 at 04:17:23PM -0500, Tom Lane wrote: >> Bruce Momjian writes: >>> On Sat, Dec 11, 2021 at 08:50:17PM -0600, Justin Pryzby wrote: If pg_upgrade fails and is re-run, it appends to its logfiles, which is confusing since, if

Re: SQL/JSON: functions

2021-12-15 Thread Andrew Dunstan
On 12/9/21 09:04, Himanshu Upadhyaya wrote: > > > > 2) > I am not sure if below is required as per SQL standard, ORACLE is > allowing to construct JSON_OBJECT bases on the records in the table as > below, but postgres parser is not allowing: > create table test (id varchar(10), value int); >

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

2021-12-15 Thread Melanie Plageman
v18 attached. On Thu, Dec 9, 2021 at 2:17 PM Andres Freund wrote: > > Hi, > > On 2021-12-03 15:02:24 -0500, Melanie Plageman wrote: > > From e0f7f3dfd60a68fa01f3c023bcdb69305ade3738 Mon Sep 17 00:00:00 2001 > > From: Melanie Plageman > > Date: Mon, 11 Oct 2021 16:15:06 -0400 > > Subject: [PATCH

Re: SQL/JSON: functions

2021-12-15 Thread Andrew Dunstan
On 12/9/21 09:04, Himanshu Upadhyaya wrote: > > > > 4) > Are we intentionally allowing numeric keys in JSON_OBJECT but somehow > these are not allowed in ORACLE? > ‘postgres[151876]=#’select JSON_OBJECT( 3+1:2, 2+2:1); >     json_object > >  {"4" : 2, "4" : 1} > (1 row) > >

Re: pg_upgrade should truncate/remove its logs before running

2021-12-15 Thread Bruce Momjian
On Wed, Dec 15, 2021 at 04:17:23PM -0500, Tom Lane wrote: > Bruce Momjian writes: > > On Sat, Dec 11, 2021 at 08:50:17PM -0600, Justin Pryzby wrote: > >> If pg_upgrade fails and is re-run, it appends to its logfiles, which is > >> confusing since, if it fails again, it then looks like the

Re: pg_upgrade should truncate/remove its logs before running

2021-12-15 Thread Tom Lane
Bruce Momjian writes: > On Sat, Dec 11, 2021 at 08:50:17PM -0600, Justin Pryzby wrote: >> If pg_upgrade fails and is re-run, it appends to its logfiles, which is >> confusing since, if it fails again, it then looks like the original error >> recurred and wasn't fixed. The "append" behavior dates

Re: pg_upgrade should truncate/remove its logs before running

2021-12-15 Thread Justin Pryzby
On Wed, Dec 15, 2021 at 04:09:16PM -0500, Bruce Momjian wrote: > On Sat, Dec 11, 2021 at 08:50:17PM -0600, Justin Pryzby wrote: > > I have seen this numerous times but had not dug into it, until now. > > > > If pg_upgrade fails and is re-run, it appends to its logfiles, which is > > confusing

Re: Buildfarm support for older versions

2021-12-15 Thread Tom Lane
Andrew Dunstan writes: > I have set up a test buildfarm client (which will eventually report > under the name 'godwit') alongside crake (Fedora 34). So far testing has > run smoothly, there are only two glitches: > * 9.3 and 9.2 don't have a show_dl_suffix make target. This would > require

Re: pg_upgrade should truncate/remove its logs before running

2021-12-15 Thread Bruce Momjian
On Sat, Dec 11, 2021 at 08:50:17PM -0600, Justin Pryzby wrote: > I have seen this numerous times but had not dug into it, until now. > > If pg_upgrade fails and is re-run, it appends to its logfiles, which is > confusing since, if it fails again, it then looks like the original error > recurred

Re: psql format output

2021-12-15 Thread Pavel Stehule
Hi st 15. 12. 2021 v 21:16 odesílatel Florian Koch < florian.murat.k...@gmail.com> napsal: > Hello, > > I realized that the output of "\df+ func_name" has a formatting problem > when a > lot of arguments are used. The field 'Arguments data types' gets very long > and > destroys the whole

Re: Non-superuser subscription owners

2021-12-15 Thread Mark Dilger
> On Nov 24, 2021, at 4:30 PM, Jeff Davis wrote: > > We need to do permission checking for WITH CHECK OPTION and RLS. The > patch right now allows the subscription to write data that an RLS > policy forbids. Version 4 of the patch, attached, no longer allows RLS to be circumvented, but does

psql format output

2021-12-15 Thread Florian Koch
Hello, I realized that the output of "\df+ func_name" has a formatting problem when a lot of arguments are used. The field 'Arguments data types' gets very long and destroys the whole formatting in the console. The field 'Source code' is most of the time multi-line and I thought that the output

Re: Privilege required for IF EXISTS event if the object already exists

2021-12-15 Thread David G. Johnston
On Wednesday, December 15, 2021, Shay Rojansky wrote: > > . Now, before creating tables, the ORM generates CREATE SCHEMA IF NOT > EXISTS, to ensure that the schema exists before CREATE TABLE; that's > reasonable general-purpose behavior. > If the user hasn’t specified they want the schema

Re: [Proposal] Fully WAL logged CREATE DATABASE - No Checkpoints

2021-12-15 Thread Bruce Momjian
On Thu, Dec 2, 2021 at 07:19:50PM +0530, Dilip Kumar wrote: >From the patch: > Currently, CREATE DATABASE forces a checkpoint, then copies all the files, > then forces another checkpoint. The comments in the createdb() function > explain the reasons for this. The attached patch fixes this

Re: archive modules

2021-12-15 Thread Bossart, Nathan
On 11/2/21, 8:07 AM, "Bossart, Nathan" wrote: > The main motivation is provide a way to archive without shelling out. > This reduces the amount of overhead, which can improve archival rate > significantly. It should also make it easier to archive more safely. > For example, many of the common

Re: Granting SET and ALTER SYSTE privileges for GUCs

2021-12-15 Thread Mark Dilger
> On Dec 15, 2021, at 10:02 AM, Joshua Brindle > wrote: > > Ah, I was actually requesting a hook where the acl check was done for > setting a GUC, such that we could deny setting them in a hook, > something that would be useful for the set_user extension > (github.com/pgaudit/set_user) Hmm,

Re: Privilege required for IF EXISTS event if the object already exists

2021-12-15 Thread Shay Rojansky
> I would say it is reasonable in theory. But I cannot think of an actual scenario that would benefit from such a change. Your stated use case is rejected since you explicitly do not want tenants to be able to create schemas - so the simple act of issuing "CREATE SCHEMA" is disallowed. > [...] >

Re: Granting SET and ALTER SYSTE privileges for GUCs

2021-12-15 Thread Joshua Brindle
On Wed, Dec 15, 2021 at 10:56 AM Mark Dilger wrote: > > > > > On Dec 14, 2021, at 2:26 PM, Joshua Brindle > > wrote: > > > > currently there is a failure in check-world (not sure if it's known): > > That one is definitely my fault. 'en_US.UTF-8' exists on my platform, so I > hadn't noticed.

Re: Allow escape in application_name

2021-12-15 Thread Fujii Masao
On 2021/12/10 16:35, kuroda.hay...@fujitsu.com wrote: How about adding that new paragraph just after the existing one, instead? Fixed. Thanks for the fix! Attached is the updated version of 0001 patch. I added "See for details." into the description. Barring any objection, I will commit

Buildfarm support for older versions

2021-12-15 Thread Andrew Dunstan
OK, old_branches_of_interest.txt now exists on the buildfarm server, and the code has been modified to take notice of it (i.e. to accept builds for branches listed there). The contents are the non-live versions from 9.2 on. I have set up a test buildfarm client (which will eventually report under

Re: preserving db/ts/relfilenode OIDs across pg_upgrade (was Re: storing an explicit nonce)

2021-12-15 Thread tushar
On 12/15/21 12:09 AM, tushar wrote: I spent much of today reviewing 0001. Here's an updated version, so far only lightly tested. Please check whether I've broken anything. Thanks Robert, I tested from v96/12/13/v14 -> v15( with patch) things are working fine i.e table /index relfilenode is

Re: logical decoding and replication of sequences

2021-12-15 Thread Tomas Vondra
On 12/15/21 17:42, Alvaro Herrera wrote: > Looking at 0003, > > On 2021-Dec-14, Tomas Vondra wrote: > >> diff --git a/doc/src/sgml/ref/alter_publication.sgml >> b/doc/src/sgml/ref/alter_publication.sgml >> index bb4ef5e5e22..4d166ad3f9c 100644 >> --- a/doc/src/sgml/ref/alter_publication.sgml

Re: Privilege required for IF EXISTS event if the object already exists

2021-12-15 Thread Chapman Flack
On 12/15/21 11:10, David G. Johnston wrote: >> IF NOT EXISTS(SELECT 1 FROM pg_namespace WHERE nspname = 'foo') THEN Orthogonally to any other comments, IF pg_catalog.to_regnamespace('foo') IS NULL THEN might be tidier, if you don't need to support PG < 9.5. Regards, -Chap

Re: speed up text_position() for utf-8

2021-12-15 Thread John Naylor
I wrote: > The test is attached and the test function is part of the patch. It's > based on the test used in the commit above. The test searches for a > string that's at the end of a ~1 million byte string. This is on gcc > 11 with 2-3 runs to ensure repeatability, but I didn't bother with >

Re: logical decoding and replication of sequences

2021-12-15 Thread Alvaro Herrera
Looking at 0003, On 2021-Dec-14, Tomas Vondra wrote: > diff --git a/doc/src/sgml/ref/alter_publication.sgml > b/doc/src/sgml/ref/alter_publication.sgml > index bb4ef5e5e22..4d166ad3f9c 100644 > --- a/doc/src/sgml/ref/alter_publication.sgml > +++ b/doc/src/sgml/ref/alter_publication.sgml > @@

Re: Privilege required for IF EXISTS event if the object already exists

2021-12-15 Thread David G. Johnston
On Wed, Dec 15, 2021 at 5:35 AM Shay Rojansky wrote: > Hi all, > > I've received numerous complaints about CREATE SCHEMA IF NOT EXISTS > failing when the user lacks CREATE privileges on the database - even if the > schema already exists. A typical scenario would be a multi-tenant >

Re: Add id's to various elements in protocol.sgml

2021-12-15 Thread Brar Piening
On Dec 15, 2021 at 15:49, Alvaro Herrera wrote: On 2021-Dec-15, Brar Piening wrote: Since I can't argue towards some general utility for the xreflabels and don't have any other solid argument in favor of adding more, I will remove them from my current patch but leave the existing ones intact.

Re: conchuela has some SSL issues

2021-12-15 Thread Mikael Kjellström
On 2021-12-14 15:05, Mikael Kjellström wrote: I will take a look at it. At the moment I have disabled new builds until I have fixed it. Sorry for the inconvenience. Should be fixed now. /Mikael

Re: Adding CI to our tree

2021-12-15 Thread Daniel Gustafsson
> On 15 Dec 2021, at 16:21, Tom Lane wrote: > > Justin Pryzby writes: >> On Mon, Dec 13, 2021 at 03:45:23PM -0800, Andres Freund wrote: >>> On 2021-12-13 18:14:52 -0500, Tom Lane wrote: I'm with Justin on this one. I would view a script trying to mess with /cores as a hostile act. >

Re: Privilege required for IF EXISTS event if the object already exists

2021-12-15 Thread Tom Lane
Shay Rojansky writes: > I've received numerous complaints about CREATE SCHEMA IF NOT EXISTS failing > when the user lacks CREATE privileges on the database - even if the schema > already exists. A typical scenario would be a multi-tenant > schema-per-tenant setup, where the schema and tenant user

Re: generalized conveyor belt storage

2021-12-15 Thread Robert Haas
On Wed, Dec 15, 2021 at 10:03 AM Matthias van de Meent wrote: > > +Conceptually, a relation fork organized as a conveyor belt has three parts: > > + > > +- Payload. The payload is whatever data the user of this module wishes > > + to store. The conveyor belt doesn't care what you store in a

Re: Adding CI to our tree

2021-12-15 Thread Tom Lane
Justin Pryzby writes: > On Mon, Dec 13, 2021 at 03:45:23PM -0800, Andres Freund wrote: >> On 2021-12-13 18:14:52 -0500, Tom Lane wrote: >>> I'm with Justin on this one. I would view a script trying to >>> mess with /cores as a hostile act. >> I'm not quite following. This is a ephemeral CI

Re: Probable memory leak with ECPG and AIX

2021-12-15 Thread Benoit Lobréau
Our client confirmed that the more he fetches the more memory is consumed. The segfault was indeed caused by the absence of LDR_CNTRL. The tests show that: * without LDR_CNTRL, we reach 256Mb and segfault ; * with LDR_CNTRL=MAXDATA=0x1000, we reach 256Mo but there is no segfault, the program

Re: generalized conveyor belt storage

2021-12-15 Thread Matthias van de Meent
On Wed, 15 Dec 2021 at 00:01, Robert Haas wrote: > > Hi! [...] > So here's a patch. Basically, it lets you initialize a relation fork > as a "conveyor belt," and then you can add pages of basically > arbitrary data to the conveyor belt and then throw away old ones and, > modulo bugs, it will take

Re: Skipping logical replication transactions on subscriber side

2021-12-15 Thread Masahiko Sawada
On Wed, Dec 15, 2021 at 1:10 PM Amit Kapila wrote: > > On Wed, Dec 15, 2021 at 8:19 AM Masahiko Sawada wrote: > > > > On Tue, Dec 14, 2021 at 2:35 PM Greg Nancarrow wrote: > > > > > > On Tue, Dec 14, 2021 at 3:23 PM vignesh C wrote: > > > > > > > > While the worker is skipping one of the skip

Re: Add id's to various elements in protocol.sgml

2021-12-15 Thread Alvaro Herrera
On 2021-Dec-15, Brar Piening wrote: > On Dec 14, 2021 at 20:47, Alvaro Herrera wrote: > > > > Hmm, I think we tend to avoid xreflabels; see > > https://www.postgresql.org/message-id/8315c0ca-7758-8823-fcb6-f37f9413e...@2ndquadrant.com > > Ok, thank you for the hint. > I added them because

[PATCH] sort leaf pages by ctid for gist indexes built using sorted method

2021-12-15 Thread Aliaksandr Kalenik
Hi! With the current implementation, for GiST indexes created by doing multiple inserts, index tuples match heap tuples order, but it doesn't work that way for sorted method where index tuples on all levels are ordered using comparator provided in sortsupport (z-order for geometry type, for

Re: Adding CI to our tree

2021-12-15 Thread Justin Pryzby
On Mon, Dec 13, 2021 at 03:45:23PM -0800, Andres Freund wrote: > Hi, > > On 2021-12-13 18:14:52 -0500, Tom Lane wrote: > > Andres Freund writes: > > > On 2021-12-13 16:02:50 -0600, Justin Pryzby wrote: > > >> sudo is used exactly twice; maybe it's not needed at all ? > > > > > The macos one is

Re: port conflicts when running tests concurrently on windows.

2021-12-15 Thread Peter Eisentraut
On 13.12.21 20:33, Andres Freund wrote: pg_regress.c at remove_temp() is still there. These things should probably be addressed before we can consider making this the default. Hm, not immediately obvious what to do about this. Do you know if windows has restrictions around the length of unix

Re: logical decoding and replication of sequences

2021-12-15 Thread Tomas Vondra
On 12/15/21 14:51, Tomas Vondra wrote: > On 12/15/21 14:20, Amit Kapila wrote: >> On Tue, Dec 14, 2021 at 7:02 AM Tomas Vondra >> wrote: >>> >>> Hi, >>> >>> here's an updated version of the patches, dealing with almost all of the >>> issues (at least in the 0001 and 0002 parts). The main

Re: logical decoding and replication of sequences

2021-12-15 Thread Tomas Vondra
On 12/15/21 14:20, Amit Kapila wrote: > On Tue, Dec 14, 2021 at 7:02 AM Tomas Vondra > wrote: >> >> Hi, >> >> here's an updated version of the patches, dealing with almost all of the >> issues (at least in the 0001 and 0002 parts). The main changes: >> >> 1) I've removed the 'created' flag from

Re: logical decoding and replication of sequences

2021-12-15 Thread Peter Eisentraut
On 14.12.21 02:31, Tomas Vondra wrote: There's still one remaining problem, that I already explained in [1]. The problem is that with this: BEGIN; SELECT nextval('s') FROM generate_series(1,100); ROLLBACK; The root cause is that pg_current_wal_lsn() uses the LogwrtResult.Write, which

Re: logical decoding and replication of sequences

2021-12-15 Thread Amit Kapila
On Tue, Dec 14, 2021 at 7:02 AM Tomas Vondra wrote: > > Hi, > > here's an updated version of the patches, dealing with almost all of the > issues (at least in the 0001 and 0002 parts). The main changes: > > 1) I've removed the 'created' flag from fill_seq_with_data, as > discussed. I don't think

Re: [PATCH] proposal for regexp_count, regexp_instr, regexp_substr and regexp_replace

2021-12-15 Thread Gilles Darold
Le 15/12/2021 à 13:41, Peter Eisentraut a écrit : On 03.08.21 19:10, Tom Lane wrote: Gilles Darold writes: Sorry I have missed that, but I'm fine with this implemenation so let's keep the v6 version of the patch and drop this one. Pushed, then.  There's still lots of time to tweak the

Re: Failed transaction statistics to measure the logical replication progress

2021-12-15 Thread vignesh C
On Tue, Dec 14, 2021 at 7:58 AM Amit Kapila wrote: > > On Mon, Dec 13, 2021 at 5:48 PM osumi.takami...@fujitsu.com > wrote: > > > > On Monday, December 13, 2021 6:19 PM Amit Kapila > > wrote: > > > On Tue, Dec 7, 2021 at 3:12 PM osumi.takami...@fujitsu.com > > > wrote: > > > > > > Few

Re: [PATCH] proposal for regexp_count, regexp_instr, regexp_substr and regexp_replace

2021-12-15 Thread Peter Eisentraut
On 03.08.21 19:10, Tom Lane wrote: Gilles Darold writes: Sorry I have missed that, but I'm fine with this implemenation so let's keep the v6 version of the patch and drop this one. Pushed, then. There's still lots of time to tweak the behavior of course. I have a documentation follow-up

Privilege required for IF EXISTS event if the object already exists

2021-12-15 Thread Shay Rojansky
Hi all, I've received numerous complaints about CREATE SCHEMA IF NOT EXISTS failing when the user lacks CREATE privileges on the database - even if the schema already exists. A typical scenario would be a multi-tenant schema-per-tenant setup, where the schema and tenant user are created

Re: Add id's to various elements in protocol.sgml

2021-12-15 Thread Brar Piening
On Dec 14, 2021 at 20:47, Alvaro Herrera wrote: Hmm, I think we tend to avoid xreflabels; see https://www.postgresql.org/message-id/8315c0ca-7758-8823-fcb6-f37f9413e...@2ndquadrant.com Ok, thank you for the hint. I added them because doesn't automatically generate labels and they were

Re: Windows default locale vs initdb

2021-12-15 Thread Juan José Santamaría Flecha
On Sun, May 16, 2021 at 6:29 AM Noah Misch wrote: > On Mon, Apr 19, 2021 at 05:42:51PM +1200, Thomas Munro wrote: > > > The question we asked ourselves > > multiple times in the other thread was how we're supposed to get to > > the modern BCP 47 form when creating the template databases. It

Re: row filtering for logical replication

2021-12-15 Thread Amit Kapila
On Wed, Dec 15, 2021 at 1:52 PM Greg Nancarrow wrote: > > On Wed, Dec 15, 2021 at 5:25 PM Amit Kapila wrote: > > > > > "If a subscriber is a pre-15 version, the initial table > > > synchronization won't use row filters even if they are defined in the > > > publisher." > > > > > > Won't this lead

RE: Confused comment about drop replica identity index

2021-12-15 Thread wangw.f...@fujitsu.com
On Tue, Dec 15, 2021 at 11:25AM, Michael Paquier wrote: > Yeah, the comment is wrong. If the index of a REPLICA_IDENTITY_INDEX is > dropped, I recall that the behavior is the same as REPLICA_IDENTITY_NOTHING. Thank you for your response. I agreed that the comment is wrong. > Not sure about the

Re: A test for replay of regression tests

2021-12-15 Thread Michael Paquier
On Fri, Dec 10, 2021 at 12:58:01PM +1300, Thomas Munro wrote: > -# required for 017_shm.pl > +# required for 017_shm.pl and 027_stream_regress.pl > REGRESS_SHLIB=$(abs_top_builddir)/src/test/regress/regress$(DLSUFFIX) > export REGRESS_SHLIB Hmm. FWIW, I am working on doing similar for

Re: Strange behavior with polygon and NaN

2021-12-15 Thread Kyotaro Horiguchi
At Wed, 15 Dec 2021 16:20:55 +0900 (JST), Kyotaro Horiguchi wrote in > adjusted so that it treats null as false. On the way doing this, the > bug #17334 [2] and another bug raised earlier [3] are naturally fixed. That being said, even if this patch were committed to the master branch, we won't

Re: row filtering for logical replication

2021-12-15 Thread Greg Nancarrow
On Wed, Dec 15, 2021 at 5:25 PM Amit Kapila wrote: > > > "If a subscriber is a pre-15 version, the initial table > > synchronization won't use row filters even if they are defined in the > > publisher." > > > > Won't this lead to data inconsistencies or errors that otherwise > > wouldn't happen?

Re: parallel vacuum comments

2021-12-15 Thread Masahiko Sawada
On Tue, Dec 14, 2021 at 12:03 PM Amit Kapila wrote: > > On Tue, Dec 14, 2021 at 7:40 AM tanghy.f...@fujitsu.com > wrote: > > > > On Monday, December 13, 2021 2:12 PM Masahiko Sawada > > wrote: > > > > > > On Mon, Dec 13, 2021 at 2:09 PM Amit Kapila > > > wrote: > > > > > > > > On Mon, Dec