src/test/modules/test_regex/test_regex.c typo issue

2023-02-03 Thread jian he
Hi, in src/test/modules/test_regex/test_regex.c /* Report individual info bit states */ for (inf = infonames; inf->bit != 0; inf++) { if (cpattern->re_info & inf->bit) { if (flags->info & inf->bit)

Re: Remove unused code related to unknown type

2023-02-03 Thread Peter Eisentraut
On 03.02.23 00:12, Tom Lane wrote: Peter Eisentraut writes: Here is a patch that removes some unused leftovers from commit cfd9be939e9c516243c5b6a49ad1e1a9a38f1052 (old). Ugh. Those are outright wrong now, aren't they? Better nuke 'em. done

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

2023-02-03 Thread Takamichi Osumi (Fujitsu)
Hi, On wangw.f...@fujitsu.com Amit Kapila wrote: > On Fri, Feb 3, 2023 at 3:12 PM wangw.f...@fujitsu.com > wrote: > > > > Here is a comment: > > > > 1. The checks in function AlterSubscription > > + /* > > +* The

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

2023-02-03 Thread Takamichi Osumi (Fujitsu)
Hi, On Friday, February 3, 2023 3:35 PM I wrote: > On Friday, February 3, 2023 2:21 PM Amit Kapila > wrote: > > On Fri, Feb 3, 2023 at 6:41 AM Peter Smith > wrote: > > > On Thu, Feb 2, 2023 at 7:21 PM Takamichi Osumi (Fujitsu) > > > wrote: > > > ... > > > > > Besides, I am not sure it's a

Re: run pgindent on a regular basis / scripted manner

2023-02-03 Thread Noah Misch
On Fri, Feb 03, 2023 at 12:52:50PM -0500, Tom Lane wrote: > Andrew Dunstan writes: > > On 2023-01-22 Su 17:47, Tom Lane wrote: > >> Yeah. That's one of my biggest gripes about pgperltidy: if you insert > >> another assignment in a series of assignments, it is very likely to > >> reformat all the

Re: Add progress reporting to pg_verifybackup

2023-02-03 Thread Michael Paquier
On Thu, Feb 02, 2023 at 05:56:47PM +0900, Masahiko Sawada wrote: > Seems a good idea. Please find an attached patch. That seems rather OK seen from here. I'll see about getting that applied except if there is an objection of any kind. -- Michael signature.asc Description: PGP signature

Re: recovery modules

2023-02-03 Thread Michael Paquier
On Thu, Feb 02, 2023 at 11:37:00AM -0800, Nathan Bossart wrote: > On Thu, Feb 02, 2023 at 02:34:17PM +0900, Michael Paquier wrote: >> Okay, the changes done here look straight-forward seen from here. I >> got one small-ish comment. >> >> +basic_archive_startup(ArchiveModuleState *state) >> +{ >>

Re: Amcheck verification of GiST and GIN

2023-02-03 Thread Peter Geoghegan
On Thu, Feb 2, 2023 at 12:15 PM Peter Geoghegan wrote: > * Why are there only WARNINGs, never ERRORs here? Attached revision v22 switches all of the WARNINGs over to ERRORs. It has also been re-indented, and now uses a non-generic version of PageGetItemIdCareful() in both verify_gin.c and

Re: Weird failure with latches in curculio on v15

2023-02-03 Thread Michael Paquier
On Fri, Feb 03, 2023 at 10:54:17AM -0800, Nathan Bossart wrote: > 0001 is just v1-0001 from upthread. This moves Pre/PostRestoreCommand to > surround only the call to system(). I think this should get us closer to > pre-v15 behavior. + if (exitOnSigterm) + PreRestoreCommand(); + rc

Re: run pgindent on a regular basis / scripted manner

2023-02-03 Thread Michael Paquier
On Thu, Feb 02, 2023 at 11:34:37AM +, Dean Rasheed wrote: > I didn't reply until now, but I'm solidly in the camp of committers > who care about keeping the tree properly indented, and I wouldn't have > any problem with such a check being imposed. So do I. pgindent is part of my routine when

Re: About PostgreSQL Core Team

2023-02-03 Thread Andrew Dunstan
On 2023-02-01 We 07:24, adherent postgres wrote: Hi hackers:     I came across a blog that I was very impressed with, especially the views mentioned in it about PostgreSQL Core Team Perhaps people might take more notice if you didn't hide behind an anonymous hotmail account. I've

Re: proposal: psql: show current user in prompt

2023-02-03 Thread Pavel Stehule
pá 3. 2. 2023 v 21:21 odesílatel Tom Lane napsal: > Pavel Stehule writes: > > Both patches are very simple - and they use almost already prepared > > infrastructure. > > It's not simple at all to make the psql feature depend on marking > "role" as GUC_REPORT when it never has been before. That

Re: Transparent column encryption

2023-02-03 Thread Jacob Champion
On Tue, Jan 31, 2023 at 5:26 AM Peter Eisentraut wrote: > See here for example: > https://learn.microsoft.com/en-us/sql/relational-databases/security/encryption/always-encrypted-database-engine?view=sql-server-ver15 Hm. I notice they haven't implemented more than one algorithm, so I wonder if

Re: Schema variables - new implementation for Postgres 15 (typo)

2023-02-03 Thread Pavel Stehule
Hi I read notes from the FOSDEM developer meeting, and I would like to repeat notice about motivation for introduction of session variables, and one reason why session_variables are not transactional, and why they should not be replaced by temp tables is performance. There are more use cases

Re: proposal: psql: show current user in prompt

2023-02-03 Thread Tom Lane
Pavel Stehule writes: > Both patches are very simple - and they use almost already prepared > infrastructure. It's not simple at all to make the psql feature depend on marking "role" as GUC_REPORT when it never has been before. That will cause the feature to misbehave when using older servers.

Re: Make EXPLAIN generate a generic plan for a parameterized query

2023-02-03 Thread Tom Lane
Laurenz Albe writes: > Thanks for the pointer. Perhaps something like the attached? > The changes in "CreatePartitionPruneState" make my test case work, > but they cause a difference in the regression tests, which would be > intended if we have no partition pruning with plain EXPLAIN. Hmm, so I

Re: proposal: psql: show current user in prompt

2023-02-03 Thread Pavel Stehule
pá 3. 2. 2023 v 20:42 odesílatel Corey Huinker napsal: > > > On Fri, Feb 3, 2023 at 9:56 AM Pavel Stehule > wrote: > >> Hi >> >> one visitor of p2d2 (Prague PostgreSQL Developer Day) asked if it is >> possible to show the current role in psql's prompt. I think it is not >> possible, but

Re: proposal: psql: show current user in prompt

2023-02-03 Thread Corey Huinker
On Fri, Feb 3, 2023 at 9:56 AM Pavel Stehule wrote: > Hi > > one visitor of p2d2 (Prague PostgreSQL Developer Day) asked if it is > possible to show the current role in psql's prompt. I think it is not > possible, but fortunately (with some limits) almost all necessary work is > done, and the

Re: Fix GUC_NO_SHOW_ALL test scenario in 003_check_guc.pl

2023-02-03 Thread Tom Lane
Nitin Jadhav writes: > My concern is if we do this, then we will end up having some policies > (which can be read from pg_show_all_settings()) in guc.sql and some in > guc.c. I feel all these should be at one place either at guc.c or > guc.sql. I don't particularly see why that needs to be the

First draft of back-branch release notes is done

2023-02-03 Thread Tom Lane
... at https://git.postgresql.org/gitweb/?p=postgresql.git;a=commitdiff;h=f282b026787da69d88a35404cf62f1cc21cfbb7c As usual, please send corrections/comments by Sunday. regards, tom lane

Re: proposal: psql: psql variable BACKEND_PID

2023-02-03 Thread Corey Huinker
On Fri, Feb 3, 2023 at 5:42 AM Pavel Stehule wrote: > Hi > > We can simply allow an access to backend process id thru psql variable. I > propose the name "BACKEND_PID". The advantages of usage are simple > accessibility by command \set, and less typing then using function > pg_backend_pid,

Re: Weird failure with latches in curculio on v15

2023-02-03 Thread Nathan Bossart
On Thu, Feb 02, 2023 at 11:44:22PM -0800, Andres Freund wrote: > On 2023-02-03 02:24:03 -0500, Tom Lane wrote: >> Andres Freund writes: >> > A workaround for the back branches could be to have a test in >> > StartupProcShutdownHandler() that tests if MyProcPid == getpid(), and >> > not do the

Re: Fix GUC_NO_SHOW_ALL test scenario in 003_check_guc.pl

2023-02-03 Thread Nitin Jadhav
> > Thanks Michael for identifying a new mistake. I am a little confused > > here. I don't understand why GUC_NO_SHOW_ALL depends on other GUCs > > like GUC_NOT_IN_SAMPLE or GUC_NO_RESET_ALL. Looks like the dependency > > between GUC_NO_RESET_ALL and GUC_NO_SHOW_ALL is removed in the above > >

Index-only scan and random_page_cost

2023-02-03 Thread Konstantin Knizhnik
Hi hackers, Right now cost of index-only scan is using `random_page_cost`. Certainly for point selects we really have random access pattern, but queries like "select count(*) from hits"  access pattern is more or less sequential: we are iterating through subsequent leaf B-Tree pages.  As far

Re: run pgindent on a regular basis / scripted manner

2023-02-03 Thread Tom Lane
Andrew Dunstan writes: > On 2023-01-22 Su 17:47, Tom Lane wrote: >> Yeah. That's one of my biggest gripes about pgperltidy: if you insert >> another assignment in a series of assignments, it is very likely to >> reformat all the adjacent assignments because it thinks it's cool to >> make all the

Re: run pgindent on a regular basis / scripted manner

2023-02-03 Thread Andrew Dunstan
On 2023-01-22 Su 17:47, Tom Lane wrote: Andres Freund writes: I strongly dislike it, I rarely get it right by hand - but it does have some benefit over aligning variable names based on the length of the type names as uncrustify/clang-format: In their approach an added local variable can cause

Re: Make EXPLAIN generate a generic plan for a parameterized query

2023-02-03 Thread Laurenz Albe
On Fri, 2023-02-03 at 09:44 -0500, Tom Lane wrote: > Laurenz Albe writes: > > I played around with it, and I ran into a problem with partitions that > > are foreign tables: > > ... > >   EXPLAIN (GENERIC_PLAN) SELECT * FROM looppart WHERE key = $1; > >   ERROR:  no value found for parameter 1 >

proposal: psql: show current user in prompt

2023-02-03 Thread Pavel Stehule
Hi one visitor of p2d2 (Prague PostgreSQL Developer Day) asked if it is possible to show the current role in psql's prompt. I think it is not possible, but fortunately (with some limits) almost all necessary work is done, and the patch is short. In the assigned patch I implemented a new prompt

Re: Make EXPLAIN generate a generic plan for a parameterized query

2023-02-03 Thread Tom Lane
Laurenz Albe writes: > I played around with it, and I ran into a problem with partitions that > are foreign tables: > ... > EXPLAIN (GENERIC_PLAN) SELECT * FROM looppart WHERE key = $1; > ERROR: no value found for parameter 1 Hmm, offhand I'd say that something is doing something it has no

Re: CI and test improvements

2023-02-03 Thread Justin Pryzby
rebased, and re-including a patch to show code coverage of changed files. a5b3e50d922 cirrus/windows: add compiler_warnings_script 4c98dcb0e03 cirrus/freebsd: run with more CPUs+RAM and do not repartition aaeef938ed4 cirrus/freebsd: define ENFORCE_REGRESSION_TEST_NAME_RESTRICTIONS 9baf41674ad

Re: Make mesage at end-of-recovery less scary.

2023-02-03 Thread Alvaro Herrera
So this patch is now failing because it applies new tests to 011_crash_recovery.pl, which was removed recently. Can you please move them elsewhere? I think the comment for ValidXLogRecordLength should explain what the return value is. -- Álvaro HerreraBreisgau, Deutschland —

Re: Make EXPLAIN generate a generic plan for a parameterized query

2023-02-03 Thread Laurenz Albe
On Tue, 2023-01-31 at 13:49 -0500, Tom Lane wrote: > Laurenz Albe writes: > > [ 0001-Add-EXPLAIN-option-GENERIC_PLAN.v4.patch ] > > I took a closer look at this patch, and didn't like the implementation > much.  You're not matching the behavior of PREPARE at all: for example, > this patch is

Re: generic plans and "initial" pruning

2023-02-03 Thread Amit Langote
On Thu, Feb 2, 2023 at 11:49 PM Amit Langote wrote: > On Fri, Jan 27, 2023 at 4:01 PM Amit Langote wrote: > > I didn't actually go with calling the plancache on every lock taken on > > a relation, that is, in ExecGetRangeTableRelation(). One thing about > > doing it that way that I didn't quite

RE: Exit walsender before confirming remote flush in logical replication

2023-02-03 Thread Hayato Kuroda (Fujitsu)
Dear Amit, Sawada-san, > > IIUC there is no difference between smart shutdown and fast shutdown > > in logical replication walsender, but reading the doc[1], it seems to > > me that in the smart shutdown mode, the server stops existing sessions > > normally. For example, If the client is psql

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

2023-02-03 Thread Amit Kapila
On Fri, Feb 3, 2023 at 3:12 PM wangw.f...@fujitsu.com wrote: > > Here is a comment: > > 1. The checks in function AlterSubscription > + /* > +* The combination of parallel > streaming mode and > +

proposal: psql: psql variable BACKEND_PID

2023-02-03 Thread Pavel Stehule
Hi We can simply allow an access to backend process id thru psql variable. I propose the name "BACKEND_PID". The advantages of usage are simple accessibility by command \set, and less typing then using function pg_backend_pid, because psql variables are supported by tab complete routine.

Re: [PATCH] Compression dictionaries for JSONB

2023-02-03 Thread Pavel Borisov
On Fri, 3 Feb 2023 at 14:04, Alvaro Herrera wrote: > > This patch came up at the developer meeting in Brussels yesterday. > https://wiki.postgresql.org/wiki/FOSDEM/PGDay_2023_Developer_Meeting#v16_Patch_Triage > > First, as far as I can tell, there is a large overlap between this patch > and

Re: POC PATCH: copy from ... exceptions to: (was Re: VLDB Features)

2023-02-03 Thread Damir Belyalov
Hi, Danil and Nikita! Thank you for reviewing. Why is there no static keyword in the definition of the SafeCopying() > function, but it is in the function declaration. > Correct this. 675: MemoryContext cxt = > MemoryContextSwitchTo(econtext->ecxt_per_tuple_memory); > 676: > 677: valid_row =

Re: Support logical replication of DDLs

2023-02-03 Thread Alvaro Herrera
On 2023-Feb-03, Peter Smith wrote: > 1. > (This is not really a review comment - more just an observation...) > > This patch seemed mostly like an assortment of random changes that > don't seem to have anything in common except that some *later* patches > of this set are apparently going to want

Re: [PATCH] Reuse Workers and Replication Slots during Logical Replication

2023-02-03 Thread shveta malik
On Thu, Feb 2, 2023 at 5:01 PM shveta malik wrote: > > Reviewing further > Hi Melih, int64 rep_slot_id; int64 lastusedid; int64 sublastusedid --Should all of the above be unsigned integers? thanks Shveta

Re: Pluggable toaster

2023-02-03 Thread Alvaro Herrera
On 2023-Jan-14, Nikita Malakhov wrote: > Hi! > Fails due to recent changes. Working on it. Please see my response here https://postgr.es/m/20230203095540.zutul5vmsbmantbm@alvherre.pgsql -- Álvaro Herrera 48°01'N 7°57'E — https://www.EnterpriseDB.com/ "Oh, great altar of passive

Re: [PATCH] Compression dictionaries for JSONB

2023-02-03 Thread Alvaro Herrera
This patch came up at the developer meeting in Brussels yesterday. https://wiki.postgresql.org/wiki/FOSDEM/PGDay_2023_Developer_Meeting#v16_Patch_Triage First, as far as I can tell, there is a large overlap between this patch and "Pluggable toaster" patch. The approaches are completely

Re: Use windows VMs instead of windows containers on the CI

2023-02-03 Thread Thomas Munro
On Fri, Feb 3, 2023 at 6:57 PM Andres Freund wrote: > And pushed! I think an improvement in CI times of this degree is pretty > awesome. +1 A lot of CI compute time is saved. The Cirrus account[1] was previously hitting the 4 job limit all day long, and now it's often running 1 or 2 jobs when

Re: Where is the logig to create a table file?

2023-02-03 Thread Pavel Borisov
Hi, Jack On Fri, 3 Feb 2023 at 13:19, jack...@gmail.com wrote: > > When I use 'create table t(a int);'; suppose that this table t's oid is 1200, > then postgres will create a file named 1200 in the $PGDATA/base, So where > is the logic code in the internal? >

Re: Perform streaming logical transactions by background workers and parallel apply

2023-02-03 Thread Amit Kapila
On Fri, Feb 3, 2023 at 1:28 PM Masahiko Sawada wrote: > > On Fri, Feb 3, 2023 at 12:29 PM houzj.f...@fujitsu.com > wrote: > > > > On Friday, February 3, 2023 11:04 AM Amit Kapila > > wrote: > > > > > > On Thu, Feb 2, 2023 at 4:52 AM Peter Smith > > > wrote: > > > > > > > > Some minor review

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

2023-02-03 Thread wangw.f...@fujitsu.com
On Thurs, Feb 2, 2023 16:04 PM Takamichi Osumi (Fujitsu) wrote: > Attached the updated patch v26 accordingly. Thanks for your patch. Here is a comment: 1. The checks in function AlterSubscription + /* +* The

Re: Weird failure with latches in curculio on v15

2023-02-03 Thread Andres Freund
Hi, On February 3, 2023 9:19:23 AM GMT+01:00, Thomas Munro wrote: >On Fri, Feb 3, 2023 at 9:09 PM Andres Freund wrote: >> Thinking about popen() suggests that we have a similar problem with COPY >> FROM PROGRAM as we have in pgarch (i.e. not as bad as the startup >> process issue, but still

Where is the logig to create a table file?

2023-02-03 Thread jack...@gmail.com
When I use 'create table t(a int);'; suppose that this table t's oid is 1200, then postgres will create a file named 1200 in the $PGDATA/base, So where is the logic code in the internal? -- jack...@gmail.com

Re: Non-superuser subscription owners

2023-02-03 Thread Andres Freund
Hi, On 2023-02-02 09:28:03 -0500, Robert Haas wrote: > I don't know what you mean by this. DML doesn't confer privileges. If > code gets executed and runs with the replication user's credentials, > that could lead to privilege escalation, but just moving rows around > doesn't, at least not in the

Re: Weird failure with latches in curculio on v15

2023-02-03 Thread Thomas Munro
On Fri, Feb 3, 2023 at 9:09 PM Andres Freund wrote: > Thinking about popen() suggests that we have a similar problem with COPY > FROM PROGRAM as we have in pgarch (i.e. not as bad as the startup > process issue, but still not great, due to > procsignal_sigusr1_handler()). A small mercy: while we

Re: Weird failure with latches in curculio on v15

2023-02-03 Thread Andres Freund
Hi, On 2023-02-03 02:50:38 -0500, Tom Lane wrote: > Andres Freund writes: > > On 2023-02-03 02:24:03 -0500, Tom Lane wrote: > >> setsid(2) is required since SUSv2, so I'm not sure which systems > >> are of concern here ... other than Redmond's of course. > > > I was thinking of windows, yes. > >