Re: Minor edit to src/bin/pg_upgrade/IMPLEMENTAION

2023-10-09 Thread Michael Paquier
On Mon, Oct 09, 2023 at 09:55:29PM -0700, Gurjeet Singh wrote: > The attached patch adds the word 'databases' to show that template0, > template1 and postgres are databases in a default installation. +1. -- Michael signature.asc Description: PGP signature

Re: Add a new BGWORKER_BYPASS_ROLELOGINCHECK flag

2023-10-09 Thread Michael Paquier
On Tue, Oct 10, 2023 at 06:57:05AM +0200, Drouvot, Bertrand wrote: > Please find attached v9 (v8 rebase due to f483b2090). I was looking at v8 just before you sent this v9, and still got annoyed by the extra boolean argument added to InitPostgres(). So please let me propose to bite the bullet

Re: [Code Cleanup] : Small code cleanup in twophase.sql

2023-10-09 Thread Nishant Sharma
Hi, Any taker or rejector for above? -- It's a very small 'good to have' change patch for cleanup. Thanks, Nishant (EDB). On Tue, Sep 26, 2023 at 6:31 PM Nishant Sharma < nishant.sha...@enterprisedb.com> wrote: > Hi, > > > PFA small code cleanup in twophase.sql. Which contains a drop table >

Re: Add const to values and nulls arguments

2023-10-09 Thread Peter Eisentraut
On 06.10.23 16:51, Aleksander Alekseev wrote: There are a lot of Datum *values, bool *nulls argument pairs that should really be const. The 0001 patch makes those changes. Some of these hunks depend on each other. The 0002 patch, which I'm not proposing to commit at this time, makes similar

Re: Crash in add_paths_to_append_rel

2023-10-09 Thread Richard Guo
On Tue, Oct 10, 2023 at 11:52 AM David Rowley wrote: > On Mon, 9 Oct 2023 at 22:49, Richard Guo wrote: > > I came across a crash in add_paths_to_append_rel() with the query below. > > > It was introduced by commit a8a968a8 where we referenced > > cheapest_startup_path->param_info without first

Re: Crash in add_paths_to_append_rel

2023-10-09 Thread Richard Guo
On Mon, Oct 9, 2023 at 7:35 PM David Rowley wrote: > Since you've managed to attribute this to a specific commit, for the > future, I think instead of opening a new thread, it would be more > useful to communicate the issue on the thread that's linked in the > commit message. Ah, yes, I should

Re: Check each of base restriction clauses for constant-FALSE-or-NULL

2023-10-09 Thread Ashutosh Bapat
On Tue, Oct 10, 2023 at 11:09 AM Richard Guo wrote: > Do you mean the const-folding? It happens in the preprocessing phase, > specifically in eval_const_expressions(). Thanks. > Hm, I don't think so. get_gating_quals is called in createplan.c, where > we've selected the best path, while the

Re: Check each of base restriction clauses for constant-FALSE-or-NULL

2023-10-09 Thread Richard Guo
On Mon, Oct 9, 2023 at 5:48 PM Ashutosh Bapat wrote: > postgres@312571=# explain (analyze, costs off) select * from pg_class > t1 where oid = 1 and oid = 2; > QUERY PLAN > --- > Result

Re: On login trigger: take three

2023-10-09 Thread Alexander Korotkov
On Mon, Oct 9, 2023 at 11:58 PM Andres Freund wrote: > On 2023-10-09 17:11:25 +0300, Alexander Korotkov wrote: > > This version should be good and has no overhead. Any thoughts? > > I think you forgot to attach the patch? That's it! -- Regards, Alexander Korotkov

Re: Add a new BGWORKER_BYPASS_ROLELOGINCHECK flag

2023-10-09 Thread Drouvot, Bertrand
Hi, On 10/6/23 8:48 AM, Drouvot, Bertrand wrote: Hi, On 10/5/23 6:23 PM, Bharath Rupireddy wrote: On Thu, Oct 5, 2023 at 9:32 PM Drouvot, Bertrand wrote: +  CREATE ROLE nologrole with nologin; +  GRANT CREATE ON DATABASE mydb TO nologrole; A few nit-picks: 1. s/with/WITH 2.

Minor edit to src/bin/pg_upgrade/IMPLEMENTAION

2023-10-09 Thread Gurjeet Singh
The attached patch adds the word 'databases' to show that template0, template1 and postgres are databases in a default installation. Best regards, Gurjeet http://Gurje.et pg_upgrade.implementation.diff Description: Binary data

Re: Crash in add_paths_to_append_rel

2023-10-09 Thread Andy Fan
On Tue, Oct 10, 2023 at 11:52 AM David Rowley wrote: > On Mon, 9 Oct 2023 at 22:49, Richard Guo wrote: > > I came across a crash in add_paths_to_append_rel() with the query below. > > > It was introduced by commit a8a968a8 where we referenced > > cheapest_startup_path->param_info without first

Re: Add a new BGWORKER_BYPASS_ROLELOGINCHECK flag

2023-10-09 Thread Michael Paquier
On Mon, Oct 09, 2023 at 11:11:58PM -0400, Tom Lane wrote: > Michael Paquier writes: >> Saying that, I'm OK with just dropping this query, as it could also be >> possible that one decides that calling pgstat_bestart() before the >> datallowconn check is a good idea for a reason or another. > >

Re: Add support for AT LOCAL

2023-10-09 Thread Michael Paquier
On Sat, Oct 07, 2023 at 02:35:06AM +0100, Vik Fearing wrote: > I realized that my regression tests are not exercising what I originally > intended them to after this change. They are supposed to show that calling > the function explicitly or using AT LOCAL is correctly reproduced by >

Re: Lowering the default wal_blocksize to 4K

2023-10-09 Thread Andres Freund
Hi, On 2023-10-09 23:16:30 -0400, Tom Lane wrote: > Andres Freund writes: > > There's an alternative approach we could take, which is to write in 4KB > > increments, while keeping 8KB pages. With the current format that's not > > obviously a bad idea. But given there aren't really advantages in

Re: Crash in add_paths_to_append_rel

2023-10-09 Thread David Rowley
On Mon, 9 Oct 2023 at 22:49, Richard Guo wrote: > I came across a crash in add_paths_to_append_rel() with the query below. > It was introduced by commit a8a968a8 where we referenced > cheapest_startup_path->param_info without first checking that we have a > valid cheapest_startup_path. I pushed

Re: [PATCH] hstore: Fix parsing on Mac OS X: isspace() is locale specific

2023-10-09 Thread Thomas Munro
FTR I ran into a benign case of the phenomenon in this thread when dealing with row types. In rowtypes.c, we double-quote stuff containing spaces, but we detect them by passing individual bytes of UTF-8 sequences to isspace(). Like macOS, Windows thinks that 0xa0 is a space when you do that, so

Re: PGDOCS - add more links in the pub/sub reference pages

2023-10-09 Thread Peter Smith
On Tue, Oct 10, 2023 at 11:46 AM vignesh C wrote: > > I noticed a couple of other places where a link to "ALTER SUBSCRIPTION > ... DISABLE" and "ALTER SUBSCRIPTION ... SET" can be specified in > drop_subscription: > To proceed in this situation, first disable the subscription by > executing

Re: Lowering the default wal_blocksize to 4K

2023-10-09 Thread Tom Lane
Andres Freund writes: > There's an alternative approach we could take, which is to write in 4KB > increments, while keeping 8KB pages. With the current format that's not > obviously a bad idea. But given there aren't really advantages in 8KB WAL > pages, it seems we should just go for 4KB? Seems

Re: Add a new BGWORKER_BYPASS_ROLELOGINCHECK flag

2023-10-09 Thread Tom Lane
Michael Paquier writes: > On Mon, Oct 09, 2023 at 12:20:18PM -0400, Tom Lane wrote: >> There will be a window where the worker has logged "database >> "noconndb" is not currently accepting connections" but hasn't yet >> exited, so that conceivably this query could see a positive count. > I don't

Re: Evaluate arguments of correlated SubPlans in the referencing ExprState

2023-10-09 Thread Andres Freund
Hi, On 2023-10-01 14:53:23 -0400, Tom Lane wrote: > Peter Eisentraut writes: > > Is this patch still being worked on? > > I thought Andres simply hadn't gotten back to it yet. > It still seems like a worthwhile improvement. Indeed - I do plan to commit it. I haven't quite shifted into v17 mode

Re: Making aggregate deserialization (and WAL receive) functions slightly faster

2023-10-09 Thread David Rowley
On Tue, 10 Oct 2023 at 06:38, Tom Lane wrote: > Hm. I'd be inclined to use maxlen == 0 as the indicator of a read-only > buffer, just because that would not create a problem if we ever want > to change it to an unsigned type. Other than that, I agree with the > idea of using a special maxlen

Re: pg_ctl start may return 0 even if the postmaster has been already started on Windows

2023-10-09 Thread Kyotaro Horiguchi
Thank you for testing this! At Fri, 6 Oct 2023 12:28:32 +0530, Shlok Kyal wrote i> D:\project\pg_dev\bin>pg_ctl -D ../data -l data2.log start > pg_ctl: another server might be running; trying to start server anyway > waiting for server to startpg_ctl: launcher shell died > > The output

Re: Included xid in restoring reorder buffer changes from disk log message

2023-10-09 Thread Kyotaro Horiguchi
At Fri, 6 Oct 2023 14:58:13 +0530, vignesh C wrote in > On Fri, 30 Apr 2021 at 11:53, Dilip Kumar wrote: > > It makes sense to include xid in the debug message, earlier I thought > > that will it be a good idea to also print the toplevel_xid. But I > > think it is for debug purposes and only

Re: pgBufferUsage.blk_{read|write}_time are zero although there are pgBufferUsage.local_blks_{read|written}

2023-10-09 Thread Michael Paquier
On Thu, Oct 05, 2023 at 08:51:40AM -0400, Robert Haas wrote: > On Thu, Oct 5, 2023 at 6:25 AM Nazir Bilal Yavuz wrote: >> What do you think about the second patch, counting extend calls' >> timings in blk_write_time? In my opinion if something increments >> {shared|local}_blks_written, then it

Re: PGDOCS - add more links in the pub/sub reference pages

2023-10-09 Thread vignesh C
On Mon, 9 Oct 2023 at 12:18, Peter Smith wrote: > > On Mon, Oct 9, 2023 at 3:32 PM Amit Kapila wrote: > > > > On Fri, Oct 6, 2023 at 12:15 PM Peter Smith wrote: > > > > > > Here is a patch to add the 2 missing references: > > > > > > ref/alter_subscription.sgml ==> added more ids > > >

Re: typo in couple of places

2023-10-09 Thread vignesh C
On Mon, 9 Oct 2023 at 16:17, Amit Kapila wrote: > > On Sat, Oct 7, 2023 at 8:28 AM vignesh C wrote: > > > > On Fri, 6 Oct 2023 at 20:50, Dagfinn Ilmari Mannsåker > > wrote: > > > > > > vignesh C writes: > > > > > > > Hi, > > > > > > > > I noticed a couple of typos in code. "the the" should

Re: CREATE DATABASE with filesystem cloning

2023-10-09 Thread Andres Freund
Hi, On 2023-10-07 18:51:45 +1300, Thomas Munro wrote: > It should be a lot faster, and use less physical disk, than the two > existing strategies on recent-ish XFS, BTRFS, very recent OpenZFS, > APFS (= macOS), and it could in theory be extended to other systems > that invented different system

Re: post-recovery amcheck expectations

2023-10-09 Thread Peter Geoghegan
On Wed, Oct 4, 2023 at 7:52 PM Noah Misch wrote: > Suppose we start with this nbtree (subset of a diagram from verify_nbtree.c): > > * 1 > * / \ > *2 <-> 3 > > We're deleting 2, the leftmost leaf under a leftmost internal page. After the >

Re: Lowering the default wal_blocksize to 4K

2023-10-09 Thread Bruce Momjian
On Mon, Oct 9, 2023 at 04:36:20PM -0700, Andres Freund wrote: > Hi, > > On 2023-10-09 19:26:54 -0400, Bruce Momjian wrote: > > On Mon, Oct 9, 2023 at 04:08:05PM -0700, Andres Freund wrote: > > > There's an alternative approach we could take, which is to write in 4KB > > > increments, while

Re: Lowering the default wal_blocksize to 4K

2023-10-09 Thread Andres Freund
Hi, On 2023-10-09 19:26:54 -0400, Bruce Momjian wrote: > On Mon, Oct 9, 2023 at 04:08:05PM -0700, Andres Freund wrote: > > There's an alternative approach we could take, which is to write in 4KB > > increments, while keeping 8KB pages. With the current format that's not > > obviously a bad idea.

Re: Lowering the default wal_blocksize to 4K

2023-10-09 Thread Bruce Momjian
On Mon, Oct 9, 2023 at 04:08:05PM -0700, Andres Freund wrote: > There's an alternative approach we could take, which is to write in 4KB > increments, while keeping 8KB pages. With the current format that's not > obviously a bad idea. But given there aren't really advantages in 8KB WAL > pages, it

Re: New WAL record to detect the checkpoint redo location

2023-10-09 Thread Andres Freund
Hi, On 2023-10-09 18:31:11 -0400, Robert Haas wrote: > On Mon, Oct 9, 2023 at 4:47 PM Andres Freund wrote: > > I think we might be able to speed some of this up by pre-compute values so > > we > > can implement things like bytesleft / UsableBytesInPage with shifts. IIRC we > > already insist on

Re: Proposal to use JSON for Postgres Parser format

2023-10-09 Thread Thomas Munro
On Tue, Sep 20, 2022 at 4:16 PM Thomas Munro wrote: > To explain my earlier guess: reader code for #S(STRUCTNAME ...) can > bee seen here, though it's being lexed as "PLAN_SYM" so perhaps the > author of that C already didn't know that was a general syntax for > Lisp structs. (Example: at a Lisp

Lowering the default wal_blocksize to 4K

2023-10-09 Thread Andres Freund
Hi, I've mentioned this to a few people before, but forgot to start an actual thread. So here we go: I think we should lower the default wal_blocksize / XLOG_BLCKSZ to 4096, from the current 8192. The reason is that a) We don't gain much from a blocksize above 4096, as we already do one write

Re: Add a new BGWORKER_BYPASS_ROLELOGINCHECK flag

2023-10-09 Thread Michael Paquier
On Mon, Oct 09, 2023 at 12:20:18PM -0400, Tom Lane wrote: > There will be a window where the worker has logged "database > "noconndb" is not currently accepting connections" but hasn't yet > exited, so that conceivably this query could see a positive count. I don't think that's possible here.

Re: New WAL record to detect the checkpoint redo location

2023-10-09 Thread Robert Haas
On Mon, Oct 9, 2023 at 4:47 PM Andres Freund wrote: > I think we might be able to speed some of this up by pre-compute values so we > can implement things like bytesleft / UsableBytesInPage with shifts. IIRC we > already insist on power-of-two segment sizes, so instead of needing to divide > by a

Re: Remove distprep

2023-10-09 Thread Andres Freund
Hi, On 2023-10-09 12:16:23 +0200, Peter Eisentraut wrote: > On 06.10.23 20:50, Andres Freund wrote: > > The only thing I wonder is whether we ought to keep a maintainer-clean > > target (as an alias to distclean), so that extensions that added things > > to maintainer-clean continue to work. > >

Re: Request for comment on setting binary format output per session

2023-10-09 Thread Jelte Fennema
On Mon, 9 Oct 2023 at 21:08, Dave Cramer wrote: > So if we use . would it be possible to have something like > which represents a set of well known types? > My goal here is to reduce the overhead of naming all the types the client > wants in binary. The list of well known types is pretty

Re: CHECK Constraint Deferrable

2023-10-09 Thread David G. Johnston
On Mon, Oct 9, 2023 at 1:27 PM Robert Haas wrote: > On Tue, Oct 3, 2023 at 10:05 AM David G. Johnston > wrote: > >> The real-world use case, at least for me, is when using an ORM. For > large object-graphs ORMs have a tendency to INSERT first with NULLs then > UPDATE the “NOT NULLs” later. > >>

Re: Request for comment on setting binary format output per session

2023-10-09 Thread Jelte Fennema
On Mon, 9 Oct 2023 at 22:25, Jeff Davis wrote: > We absolutely would > need to update the documentation, and clients (like psql) really should > be updated. +1 > > I think one > > could conclude on these facts either that (a) client_encoding is fine > > and the problems with controlling

Re: On login trigger: take three

2023-10-09 Thread Andres Freund
On 2023-10-09 17:11:25 +0300, Alexander Korotkov wrote: > This version should be good and has no overhead. Any thoughts? I think you forgot to attach the patch?

Re: should frontend tools use syncfs() ?

2023-10-09 Thread Nathan Bossart
On Wed, Oct 04, 2023 at 10:29:07AM -0500, Nathan Bossart wrote: > On Wed, Sep 27, 2023 at 01:56:08PM +0100, Peter Eisentraut wrote: >> We have a collection of platform-specific notes in chapter 19, including >> file-system-related notes in section 19.2. Maybe it could be put there? > > I will

Re: New WAL record to detect the checkpoint redo location

2023-10-09 Thread Andres Freund
Hi, As noted in my email from a few minutes ago, I agree that optimizing this shouldn't be a requirement for merging the patch. On 2023-10-09 15:58:36 -0400, Robert Haas wrote: > 1. The reason why we're doing this multiplication and division is to > make sure that the code in

Re: Fix output of zero privileges in psql

2023-10-09 Thread David G. Johnston
On Mon, Oct 9, 2023 at 12:13 PM Tom Lane wrote: > Laurenz Albe writes: > > On Mon, 2023-10-09 at 09:30 -0700, David G. Johnston wrote: > >> My point with the second paragraph is that we could, instead of > documenting the > >> caveat about null printing as empty strings is to instead issue an >

Re: Request for comment on setting binary format output per session

2023-10-09 Thread Jelte Fennema
On Mon, 9 Oct 2023 at 21:00, Robert Haas wrote: > ...but then... > > > With Citus the same user defined type can have > > different OIDs on each of the servers in the cluster. > > I realize that your intention here may be to say that this is not an > *additional* problem but one we have already.

Re: CHECK Constraint Deferrable

2023-10-09 Thread Robert Haas
On Tue, Oct 3, 2023 at 10:05 AM David G. Johnston wrote: >> The real-world use case, at least for me, is when using an ORM. For large >> object-graphs ORMs have a tendency to INSERT first with NULLs then UPDATE >> the “NOT NULLs” later. >> >> “Rewrite the ORM” is not an option for most of us… >

Re: Request for comment on setting binary format output per session

2023-10-09 Thread Jeff Davis
On Wed, 2023-10-04 at 15:10 -0400, Robert Haas wrote: > I hadn't really considered client_encoding as a precedent for this > setting. A lot of my discomfort with the proposed mechanism also > applies to client_encoding, namely, suppose you call some function or > procedure or whatever and it

Re: New WAL record to detect the checkpoint redo location

2023-10-09 Thread Andres Freund
Hi, On 2023-10-06 13:44:55 -0400, Robert Haas wrote: > On Thu, Oct 5, 2023 at 2:34 PM Andres Freund wrote: > > If I add an unlikely around if (rechdr->xl_rmid == RM_XLOG_ID), the > > performance does improve. But that "only" brings it up to 322.406. Not sure > > what the rest is. > > I don't

Re: CHECK Constraint Deferrable

2023-10-09 Thread Robert Haas
On Mon, Oct 2, 2023 at 10:25 PM Tom Lane wrote: > But here we have a > feature whose only possible use is with constraints that *aren't* > immutable; else we might as well just check them immediately. I'm a little bit confused by this whole discussion because surely this statement is just

Re: New WAL record to detect the checkpoint redo location

2023-10-09 Thread Robert Haas
On Thu, Oct 5, 2023 at 2:34 PM Andres Freund wrote: > One thing that's notable, but not related to the patch, is that we waste a > fair bit of cpu time below XLogInsertRecord() with divisions. I think they're > all due to the use of UsableBytesInSegment in >

Re: [PoC/RFC] Multiple passwords, interval expirations

2023-10-09 Thread Gurjeet Singh
On Mon, Oct 9, 2023 at 2:31 AM Gurjeet Singh wrote: > > Next steps: > - Break the patch into a series of smaller patches. Please see attached the same v3 patch, but now split into 3 separate patches. Each patch in the series depends on the previous patch to have been applied. I have made sure

Re: should frontend tools use syncfs() ?

2023-10-09 Thread Nathan Bossart
On Mon, Oct 09, 2023 at 11:14:39AM -0500, Nathan Bossart wrote: > Thanks. I've made a couple of small changes, but otherwise I think this > one is just about ready. I forgot to rename one thing. Here's a v13 with that fixed. -- Nathan Bossart Amazon Web Services: https://aws.amazon.com >From

Re: Fix output of zero privileges in psql

2023-10-09 Thread Tom Lane
Laurenz Albe writes: > On Mon, 2023-10-09 at 09:30 -0700, David G. Johnston wrote: >> My point with the second paragraph is that we could, instead of documenting >> the >> caveat about null printing as empty strings is to instead issue an implicit >> "\pset null ''" as part of these commands,

Re: Request for comment on setting binary format output per session

2023-10-09 Thread Dave Cramer
On Mon, 9 Oct 2023 at 15:00, Robert Haas wrote: > On Mon, Oct 9, 2023 at 11:09 AM Jelte Fennema wrote: > > Since the protocol already returns OIDs in the ParameterDescription > > and RowDescription messages I don't see why using OIDs for this GUC > > would cause any additional problems. > >

Re: Pre-proposal: unicode normalized text

2023-10-09 Thread Robert Haas
On Fri, Oct 6, 2023 at 3:07 PM Jeff Davis wrote: > On Fri, 2023-10-06 at 13:33 -0400, Robert Haas wrote: > > What I think people really want is a whole column in > > some encoding that isn't the normal one for that database. > > Do people really want that? I'd be curious to know why. Because

Re: Request for comment on setting binary format output per session

2023-10-09 Thread Robert Haas
On Mon, Oct 9, 2023 at 11:09 AM Jelte Fennema wrote: > Since the protocol already returns OIDs in the ParameterDescription > and RowDescription messages I don't see why using OIDs for this GUC > would cause any additional problems. ...but then... > With Citus the same user defined type can have

Re: Fix output of zero privileges in psql

2023-10-09 Thread Laurenz Albe
On Mon, 2023-10-09 at 09:30 -0700, David G. Johnston wrote: > On Mon, Oct 9, 2023 at 1:29 AM Laurenz Albe wrote: > > On Sun, 2023-10-08 at 19:58 -0700, David G. Johnston wrote: > > > > > The built-in default privileges are only in effect if the object has not > > > been > > > the target of a

Re: UUID v7

2023-10-09 Thread Andrey Borodin
On Mon, Oct 9, 2023 at 11:11 PM Jelte Fennema wrote: > > I think using `now()` is quite prone to sequence rollover. With the > current patch inserting more than 2^18~=0.26M rows into a table with > `gen_uuid_v7()` as the default in a single transaction would already > cause sequence rollover.

Re: UUID v7

2023-10-09 Thread Jelte Fennema
On Mon, 9 Oct 2023 at 18:46, Nick Babadzhanian wrote: > > On Thu, 31 Aug 2023 at 23:10, Andrey M. Borodin wrote: > > Well, as far as I know, RFC discourages extracting timestamps from UUIDs. > > But we still can have such functions...maybe as an extension? > > Do you know of any reason for

Re: Making aggregate deserialization (and WAL receive) functions slightly faster

2023-10-09 Thread Tom Lane
David Rowley writes: > On Mon, 9 Oct 2023 at 21:17, David Rowley wrote: >> Here are some more thoughts on how we could improve this: >> >> 1. Adjust the definition of StringInfoData.maxlen to define that -1 >> means the StringInfoData's buffer is externally managed. >> 2. Adjust

Re: UUID v7

2023-10-09 Thread Nick Babadzhanian
On Thu, 31 Aug 2023 at 23:10, Andrey M. Borodin wrote: > Well, as far as I know, RFC discourages extracting timestamps from UUIDs. But > we still can have such functions...maybe as an extension? Do you know of any reason for that? > However, so far I haven't figured out how to implement

Re: Fix output of zero privileges in psql

2023-10-09 Thread David G. Johnston
On Mon, Oct 9, 2023 at 1:29 AM Laurenz Albe wrote: > On Sun, 2023-10-08 at 19:58 -0700, David G. Johnston wrote: > > > The built-in default privileges are only in effect if the object has not > been > > the target of a GRANT or REVOKE and also has not had its default > privileges > > modified

Re: Add a new BGWORKER_BYPASS_ROLELOGINCHECK flag

2023-10-09 Thread Tom Lane
Michael Paquier writes: > Another thing is that we cannot rely on the PID returned by launch() > as it could fail, so $worker3_pid needs to disappear. If we do that, > I'd rather just switch to a specific database for the tests with > ALLOWCONN rather than reuse "mydb" that could have other

Re: should frontend tools use syncfs() ?

2023-10-09 Thread Nathan Bossart
On Mon, Oct 09, 2023 at 01:12:16PM +0300, Maxim Orlov wrote: > On Fri, 6 Oct 2023 at 22:35, Nathan Bossart > wrote: >> From a quick skim, this one looks pretty good to me. Would you mind adding >> it to the commitfest so that it doesn't get lost? I will aim to take a >> closer look at it next

Re: Logging parallel worker draught

2023-10-09 Thread Imseih (AWS), Sami
Hi, This thread has been quiet for a while, but I'd like to share some thoughts. +1 to the idea of improving visibility into parallel worker saturation. But overall, we should improve parallel processing visibility, so DBAs can detect trends in parallel usage ( is the workload doing more

Re: pg_resetwal: Corrections around -c option

2023-10-09 Thread Alvaro Herrera
On 2023-Sep-28, Peter Eisentraut wrote: > Branching off from [0], here is a for-discussion patch about some > corrections for the pg_resetwal -c (--commit-timestamp-ids) option. > > First, in the documentation for finding a manual value for the -c option > based on the files present in the data

Re: Request for comment on setting binary format output per session

2023-10-09 Thread Jelte Fennema
On Fri, 6 Oct 2023 at 13:11, Peter Eisentraut wrote: > > On 04.10.23 20:30, Dave Cramer wrote: > > We need to > > figure out what is the right way to globally identify types, like > > either > > by fully-qualified name, by base name, some combination, how does it > > work with

Re: Request for comment on setting binary format output per session

2023-10-09 Thread Jelte Fennema
On Wed, 4 Oct 2023 at 21:10, Robert Haas wrote: > > On Wed, Oct 4, 2023 at 10:17 AM Peter Eisentraut wrote: > > I think intuitively, this facility ought to work like client_encoding. > > I hadn't really considered client_encoding as a precedent for this > setting. A lot of my discomfort with the

Re: On login trigger: take three

2023-10-09 Thread Alexander Korotkov
Hi! On Tue, Oct 3, 2023 at 8:35 PM Alexander Korotkov wrote: > Thank you for the interesting ideas. I'd like to try to revive the > version with the flag in pg_database. Will use other ideas as backup > if no success. I've revived the patch version with pg_database.dathasloginevt flag. I took

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

2023-10-09 Thread Alexander Lakhin
Hi, 13.08.2023 00:00, Andres Freund wrote: Hi, On 2023-08-12 15:50:24 +1200, Thomas Munro wrote: Thanks. I realised that it's easy enough to test that theory about cleanup locks by hacking ConditionalLockBufferForCleanup() to return false randomly. Then the test occasionally fails as

Re: ALTER COLUMN ... SET EXPRESSION to alter stored generated column's expression

2023-10-09 Thread Amul Sul
On Fri, Oct 6, 2023 at 6:03 PM Peter Eisentraut wrote: > On 28.08.23 11:54, Amul Sul wrote: > > Thanks for the review comments, I have fixed those in the attached > > version. In > > addition to that, extended syntax to have the STORE keyword as suggested > by > > Vik. > > An additional comment:

Re: Draft LIMIT pushdown to Append and MergeAppend patch

2023-10-09 Thread Michał Kłeczek
> On 9 Oct 2023, at 15:04, Ashutosh Bapat wrote: > > On Mon, Oct 9, 2023 at 4:33 PM David Rowley > wrote: >> >> What are there benefits if the paths are already ordered? e.g if it's >> an index scan then we'll only pull the tuples we need from it. >> > >

Re: Draft LIMIT pushdown to Append and MergeAppend patch

2023-10-09 Thread Ashutosh Bapat
On Mon, Oct 9, 2023 at 4:33 PM David Rowley wrote: > > On Mon, 9 Oct 2023 at 23:35, Ashutosh Bapat > wrote: > > > > On Mon, Oct 9, 2023 at 6:25 AM David Rowley wrote: > > > > > > However, it may also be worth you reading over [3] and the ultimate > > > reason I changed my mind on that being a

Re: Synchronizing slots from primary to standby

2023-10-09 Thread shveta malik
On Mon, Oct 2, 2023 at 4:29 PM Hayato Kuroda (Fujitsu) wrote: > > Dear Shveta, > > Thank you for updating the patch! Thanks for the feedback Kuroda-san. I have addressed most of these in v22. Please find my comments inline. > > I found another ERROR due to the slot removal. Is this a real

Re: Crash in add_paths_to_append_rel

2023-10-09 Thread David Rowley
On Mon, 9 Oct 2023 at 22:49, Richard Guo wrote: > I came across a crash in add_paths_to_append_rel() with the query below. > It was introduced by commit a8a968a8 where we referenced > cheapest_startup_path->param_info without first checking that we have a > valid cheapest_startup_path. Thank

Re: Draft LIMIT pushdown to Append and MergeAppend patch

2023-10-09 Thread David Rowley
On Mon, 9 Oct 2023 at 23:35, Ashutosh Bapat wrote: > > On Mon, Oct 9, 2023 at 6:25 AM David Rowley wrote: > > > > However, it may also be worth you reading over [3] and the ultimate > > reason I changed my mind on that being a good idea. Pushing LIMITs > > below an Append seems quite incomplete

Re: typo in couple of places

2023-10-09 Thread Amit Kapila
On Sat, Oct 7, 2023 at 8:28 AM vignesh C wrote: > > On Fri, 6 Oct 2023 at 20:50, Dagfinn Ilmari Mannsåker > wrote: > > > > vignesh C writes: > > > > > Hi, > > > > > > I noticed a couple of typos in code. "the the" should have been "the", > > > attached patch has the changes for the same. > > >

Re: Making aggregate deserialization (and WAL receive) functions slightly faster

2023-10-09 Thread David Rowley
On Mon, 9 Oct 2023 at 21:17, David Rowley wrote: > Here are some more thoughts on how we could improve this: > > 1. Adjust the definition of StringInfoData.maxlen to define that -1 > means the StringInfoData's buffer is externally managed. > 2. Adjust enlargeStringInfo() to add a check for maxlen

Re: Synchronizing slots from primary to standby

2023-10-09 Thread shveta malik
On Mon, Oct 9, 2023 at 3:24 AM Peter Smith wrote: > > On Fri, Oct 6, 2023 at 7:37 PM Alvaro Herrera wrote: > > > > On 2023-Sep-27, Peter Smith wrote: > > > > > 3. get_local_synced_slot_names > > > > > > + for (int i = 0; i < max_replication_slots; i++) > > > + { > > > + ReplicationSlot *s =

Re: Draft LIMIT pushdown to Append and MergeAppend patch

2023-10-09 Thread Ashutosh Bapat
On Mon, Oct 9, 2023 at 6:25 AM David Rowley wrote: > > However, it may also be worth you reading over [3] and the ultimate > reason I changed my mind on that being a good idea. Pushing LIMITs > below an Append seems quite incomplete when we don't yet push sorts > below Appends, which is what that

Re: Synchronizing slots from primary to standby

2023-10-09 Thread shveta malik
On Wed, Oct 4, 2023 at 8:53 AM Peter Smith wrote: > > Here are some review comments for v20-0002. > Thanks Peter for the feedback. Comments from 31 till end are addressed in v22. First 30 comments will be addressed in the next version. > == > 1. GENERAL - errmsg/elog messages > > There are

Re: Two Window aggregate node for logically same over clause

2023-10-09 Thread "Anitha S"

Re: Remove distprep

2023-10-09 Thread Peter Eisentraut
On 06.10.23 20:50, Andres Freund wrote: The only thing I wonder is whether we ought to keep a maintainer-clean target (as an alias to distclean), so that extensions that added things to maintainer-clean continue to work. The patch does do that.

Re: UUID v7

2023-10-09 Thread Chris Travers
So I am in the process of reviewing the patch and hopefully can provide something there soon. However I want to address in the mean time the question of timestamp functions. I know that is outside the scope of this patch but I would be in favor of adding them generally, not just as an

Re: should frontend tools use syncfs() ?

2023-10-09 Thread Maxim Orlov
On Fri, 6 Oct 2023 at 22:35, Nathan Bossart wrote: > From a quick skim, this one looks pretty good to me. Would you mind adding > it to the commitfest so that it doesn't get lost? I will aim to take a > closer look at it next week. > Sounds good, thanks a lot!

Re: Check each of base restriction clauses for constant-FALSE-or-NULL

2023-10-09 Thread Ashutosh Bapat
On Sat, Oct 7, 2023 at 3:14 PM Richard Guo wrote: > > In relation_excluded_by_constraints() when we're trying to figure out > whether the relation need not be scanned, one of the checks we do is to > detect constant-FALSE-or-NULL restriction clauses. Currently we perform > this check only when

Crash in add_paths_to_append_rel

2023-10-09 Thread Richard Guo
I came across a crash in add_paths_to_append_rel() with the query below. create table t (a int); create table inh (b int); create table inh_child() inherits(inh); explain (costs off) select * from t left join lateral (select t.a from inh) on true limit 1; server closed the connection

Re: Add a new BGWORKER_BYPASS_ROLELOGINCHECK flag

2023-10-09 Thread Michael Paquier
On Sun, Oct 08, 2023 at 05:48:55PM -0400, Tom Lane wrote: > There have been intermittent failures on various buildfarm machines > since this went in. After seeing one on my own animal mamba [1], > I tried to reproduce it manually on that machine, and it does > indeed fail about one time in two.

Re: FDW LIM IT pushdown

2023-10-09 Thread Ashutosh Bapat
Hi Michal, On Fri, Oct 6, 2023 at 9:34 PM Michał Kłeczek wrote: > > Hello hackers, > > First timer here with a question: > > I’ve searched through various e-mail threads and documents and could not find > if pushdown of LIMIT clauses to FDW is implemented. > Seen some conversation about that a

Re: [PoC/RFC] Multiple passwords, interval expirations

2023-10-09 Thread Gurjeet Singh
On Sun, Oct 8, 2023 at 1:01 PM Gurjeet Singh wrote: > > On Fri, Oct 6, 2023 at 1:29 PM Jeff Davis wrote: > > > > On Thu, 2023-10-05 at 14:28 -0700, Gurjeet Singh wrote: > > > > > This way there's a notion of a 'new' and 'old' passwords. > > > > IIUC, you are proposing that there are exactly two

Re: Clean up some pg_dump tests

2023-10-09 Thread Alvaro Herrera
I tried this out. I agree it's a good change. BTW, this made me realize that "unlike" is not a good name: maybe it should be called "except". On 2023-Oct-02, Peter Eisentraut wrote: > + if (!defined($tests{$test}->{like})) > + { > + diag "missing

Re: [PoC] pg_upgrade: allow to upgrade publisher nodeHayato Kuroda (Fujitsu)

2023-10-09 Thread vignesh C
On Fri, 6 Oct 2023 at 18:30, Hayato Kuroda (Fujitsu) wrote: > > Dear hackers, > > Based on comments, I revised my patch. PSA the file. > > > > > > Today, I discussed this problem with Andres at PGConf NYC and he > > > suggested as following. To verify, if there is any pending unexpected > > > WAL

Re: Checks in RegisterBackgroundWorker.()

2023-10-09 Thread Heikki Linnakangas
On 06/10/2023 13:13, Thomas Munro wrote: On Thu, Sep 28, 2023 at 9:46 AM Heikki Linnakangas wrote: Subject: [PATCH v2 3/3] Fix misleading comment on StartBackgroundWorker(). LGTM. Hmm, maybe I would have called that function "BackgroundWorkerMain()" like several other similar things, but

Re: Where can I find the doxyfile?

2023-10-09 Thread Stefan Kaltenbrunner
On 07.10.23 00:23, Bohdan Mart wrote: On 07.10.23 00:29, postg...@coyotebush.net wrote: Sometime earlier, I created a filter to annotate regular C comments as doxy comments.  I'll attach it along with a sample doxyfile for running it.  Just in case it looks useful. I've never been a big fan

Re: Fix output of zero privileges in psql

2023-10-09 Thread Laurenz Albe
On Sun, 2023-10-08 at 19:58 -0700, David G. Johnston wrote: > For us, I would suggest the following wording: > > In addition to the situation of printing all acl items, the Access and Column > privileges columns report two other situations specially.  In the rare case > where all privileges for

Re: Making aggregate deserialization (and WAL receive) functions slightly faster

2023-10-09 Thread David Rowley
On Mon, 9 Oct 2023 at 17:37, Tom Lane wrote: > Sorry for not having paid more attention to this thread ... but > I'm pretty desperately unhappy with the patch as-pushed. I agree > with the criticism that this is a very repetitive coding pattern > that could have used a macro. But my real

Re: Fix output of zero privileges in psql

2023-10-09 Thread Laurenz Albe
On Mon, 2023-10-09 at 03:53 +0200, Erik Wienhold wrote: > On 2023-10-08 06:14 +0200, Laurenz Albe write: > > On Sat, 2023-10-07 at 20:41 +0200, Erik Wienhold wrote: > > > > If you are happy enough with my patch, shall we mark it as ready for > > > > committer? > > > > > > I amended your patch to

Re: PGDOCS - add more links in the pub/sub reference pages

2023-10-09 Thread Peter Smith
On Mon, Oct 9, 2023 at 3:32 PM Amit Kapila wrote: > > On Fri, Oct 6, 2023 at 12:15 PM Peter Smith wrote: > > > > Here is a patch to add the 2 missing references: > > > > ref/alter_subscription.sgml ==> added more ids > > ref/alter_publication.sgml ==> added link to > >