Re: Change COPY ... ON_ERROR ignore to ON_ERROR ignore_row

2024-01-29 Thread Yugo NAGATA
On Fri, 26 Jan 2024 08:08:29 -0700 "David G. Johnston" wrote: > Hi, > > The option choice of "ignore" in the COPY ON_ERROR clause seems overly > generic. There would seem to be two relevant ways to ignore bad column > input data - drop the entire row or just set the column value to null. I >

Re: Synchronizing slots from primary to standby

2024-01-29 Thread Bertrand Drouvot
Hi, On Mon, Jan 29, 2024 at 10:24:11AM +0530, shveta malik wrote: > On Sat, Jan 27, 2024 at 12:02 PM Zhijie Hou (Fujitsu) > wrote: > > > > Attach the V70 patch set which addressed above comments and Bertrand's > > comments in [1] > > > > Since v70-0001 is pushed, rebased and attached v70_2

Returning non-terminated string in ECPG Informix-compatible function

2024-01-29 Thread o . tselebrovskiy
Greetings, everyone! While analyzing output of Svace static analyzer [1] I've found a bug. In function intoasc(interval * i, char *str) from file src/interfaces/ecpg/compatlib/informix.c we return a non-terminated string since we use memcpy on tmp which is itself NULL-teminated but last zero

Re: scalability bottlenecks with (many) partitions (and more)

2024-01-29 Thread Ronan Dunklau
Le dimanche 28 janvier 2024, 22:57:02 CET Tomas Vondra a écrit : Hi Tomas ! I'll comment on glibc-malloc part as I studied that part last year, and proposed some things here: https://www.postgresql.org/message-id/ 3424675.QJadu78ljV%40aivenlaptop > FWIW where does the malloc overhead come

Re: Synchronizing slots from primary to standby

2024-01-29 Thread Amit Kapila
On Mon, Jan 29, 2024 at 2:22 PM Bertrand Drouvot wrote: > > On Mon, Jan 29, 2024 at 10:24:11AM +0530, shveta malik wrote: > > On Sat, Jan 27, 2024 at 12:02 PM Zhijie Hou (Fujitsu) > > wrote: > > > > > > Attach the V70 patch set which addressed above comments and Bertrand's > > > comments in [1]

Incorrect cost for MergeAppend

2024-01-29 Thread Alexander Kuzmenkov
Hello hackers, While investigating some query plans, I noticed some code that seems to be wrong: when create_merge_append_path() estimates the cost of sorting an input, it calls cost_sort() passing subpath->parent->tuples as the number of tuples. Shouldn't it use subpath->parent->rows or even

Re: RFC: Logging plan of the running query

2024-01-29 Thread torikoshia
Hi, Updated the patch to fix typos and move ProcessLogQueryPlanInterruptActive from errfinish() to AbortTransaction. BTW since the thread is getting long, I list the some points of the discussion so far: # Safety concern ## Catalog access inside CFI - it seems safe if the CFI call is

Re: Should we remove -Wdeclaration-after-statement?

2024-01-29 Thread Jelte Fennema-Nio
I feel like this is the type of change where there's not much discussion to be had. And the only way to resolve it is to use some voting to gauge community opinion. So my suggestion is for people to respond with -1, -0.5, +-0, +0.5, or +1 to indicate support against/for the change. I'll start:

Re: separating use of SerialSLRULock

2024-01-29 Thread Alvaro Herrera
On 2024-Jan-29, Alvaro Herrera wrote: > In Dilip's patch to improve SLRU concurrency, there's a requirement to > prevent predicate.c's SLRU control lock from being used to control > access to another shared memory structure, SerialControlData. This > struct is used to keep track of the areas of

Re: Use of backup_label not noted in log

2024-01-29 Thread David Steele
On 1/28/24 20:09, Michael Paquier wrote: On Fri, Jan 26, 2024 at 12:08:46PM +0900, Michael Paquier wrote: Well, I'm OK with this consensus on 1d35f705e if folks think this is useful enough for all the stable branches. I have done that down to REL_15_STABLE for now as this is able to apply

Re: scalability bottlenecks with (many) partitions (and more)

2024-01-29 Thread Tomas Vondra
On 1/29/24 15:15, Ronan Dunklau wrote: > Le lundi 29 janvier 2024, 13:17:07 CET Tomas Vondra a écrit : >>> Did you try running an strace on the process ? That may give you some >>> hindsights into what malloc is doing. A more sophisticated approach would >>> be using stap and plugging it into

Re: Should we remove -Wdeclaration-after-statement?

2024-01-29 Thread Mark Dilger
> On Jan 29, 2024, at 7:35 AM, Isaac Morland wrote: > > On Mon, 29 Jan 2024 at 10:31, Mark Dilger > wrote: > > -Infinity for refactoring the entire codebase and backpatching. > > I don't think anybody is proposing re-working the existing codebase. I > understand this to be only about

Re: scalability bottlenecks with (many) partitions (and more)

2024-01-29 Thread Ronan Dunklau
Le lundi 29 janvier 2024, 15:59:04 CET Tomas Vondra a écrit : > I'm not sure work_mem is a good parameter to drive this. It doesn't say > how much memory we expect the backend to use - it's a per-operation > limit, so it doesn't work particularly well with partitioning (e.g. with > 100 partitions,

Re: [EXTERNAL] Re: Add non-blocking version of PQcancel

2024-01-29 Thread Jelte Fennema-Nio
On Mon, 29 Jan 2024 at 12:44, Alvaro Herrera wrote: > Thanks! I committed 0001 now. I also renamed the new > pq_parse_int_param to pqParseIntParam, for consistency with other > routines there. Please rebase the other patches. Awesome! Rebased, and renamed pq_release_conn_hosts to

Re: Functions to return random numbers in a given range

2024-01-29 Thread Dean Rasheed
On Thu, 28 Dec 2023 at 07:34, jian he wrote: > > Your patch works. > performance is the best amount for other options in [0]. > I don't have deep knowledge about which one is more random. > Thanks for testing. > Currently we have to explicitly mention the lower and upper bound. > but can we do

Re: PG versus libxml2 2.12.x

2024-01-29 Thread Andrew Dunstan
On 2024-01-27 Sa 14:04, Tom Lane wrote: Buildfarm member caiman has been failing build for a couple weeks now. The reason turns out to be that recent libxml2 has decided to throw a "const" into the signature required for custom error handlers. (API compatibility? What's that?) I don't mind

Re: psql: add \create_function command

2024-01-29 Thread Andrew Dunstan
On 2024-01-26 Fr 15:17, Tom Lane wrote: Pavel Stehule writes: I don't know, maybe I have a problem with the described use case. I cannot imagine holding the body and head of PL routines in different places and I don't understand the necessity to join it. It seems a little weird to me too,

RE: Synchronizing slots from primary to standby

2024-01-29 Thread Zhijie Hou (Fujitsu)
On Monday, January 29, 2024 9:17 PM Zhijie Hou (Fujitsu) wrote: > > On Monday, January 29, 2024 7:30 PM Amit Kapila > wrote: > > > > On Mon, Jan 29, 2024 at 3:11 PM shveta malik > > wrote: > > > > > > PFA v71 patch set with above changes. > > > > > > > Few comments on 0001 > > Thanks for the

Re: to_regtype() Raises Error

2024-01-29 Thread David E. Wheeler
Hey there, coming back to this. I poked at the logs in the master branch and saw no mention of to_regtype; did I miss it? On Sep 17, 2023, at 10:58 PM, David G. Johnston wrote: > Parses a string of text, extracts a potential type name from it, and > translates that name into an OID. Failure

Re: Should we remove -Wdeclaration-after-statement?

2024-01-29 Thread Ranier Vilela
Em seg., 29 de jan. de 2024 às 12:03, Jelte Fennema-Nio escreveu: > I feel like this is the type of change where there's not much > discussion to be had. And the only way to resolve it is to use some > voting to gauge community opinion. > > So my suggestion is for people to respond with -1,

Re: psql: add \create_function command

2024-01-29 Thread Pavel Stehule
po 29. 1. 2024 v 17:54 odesílatel Steve Chavez napsal: > > I like your ideas upthread about \file_read and :{filename} > > Great ideas! :{filename} looks more convenient to use than \file_read just > because it's one less command to execute. > > However, :{?variable_name} is already taken by

Re: [PATCH] Add native windows on arm64 support

2024-01-29 Thread Andrew Dunstan
On 2024-01-26 Fr 09:18, Dave Cramer wrote: On Fri, 26 Jan 2024 at 07:36, Andrew Dunstan wrote: On 2024-01-25 Th 20:32, Michael Paquier wrote: > On Thu, Jan 25, 2024 at 04:52:30PM -0500, Dave Cramer wrote: >> On Thu, 25 Jan 2024 at 16:32, Andrew Dunstan wrote: >>> On

Re: Should we remove -Wdeclaration-after-statement?

2024-01-29 Thread Isaac Morland
On Mon, 29 Jan 2024 at 10:31, Mark Dilger wrote: > > > > On Jan 29, 2024, at 7:03 AM, Jelte Fennema-Nio > wrote: > > > > So my suggestion is for people to respond with -1, -0.5, +-0, +0.5, or > > +1 to indicate support against/for the change. > > -1 for me. > > -Infinity for refactoring the

Re: Flushing large data immediately in pqcomm

2024-01-29 Thread Heikki Linnakangas
On 20/11/2023 14:21, Melih Mutlu wrote: Hi hackers I've been looking into ways to reduce the overhead we're having in pqcomm and I'd like to propose a small patch to modify how socket_putmessage works. Currently socket_putmessage copies any input data into the pqcomm send buffer

Re: [PATCH] Add native windows on arm64 support

2024-01-29 Thread Dave Cramer
Dave Cramer www.postgres.rocks On Mon, 29 Jan 2024 at 11:16, Andrew Dunstan wrote: > > On 2024-01-26 Fr 09:18, Dave Cramer wrote: > > > > On Fri, 26 Jan 2024 at 07:36, Andrew Dunstan wrote: > >> >> On 2024-01-25 Th 20:32, Michael Paquier wrote: >> > On Thu, Jan 25, 2024 at 04:52:30PM -0500,

Re: Should we remove -Wdeclaration-after-statement?

2024-01-29 Thread Isaac Morland
On Mon, 29 Jan 2024 at 10:42, Mark Dilger wrote: > I don't think anybody is proposing re-working the existing codebase. I > understand this to be only about allowing new code to use the newer style. > Personally, I like, as much as possible, to use initializations to const > variables and avoid

Re: Functions to return random numbers in a given range

2024-01-29 Thread Dean Rasheed
On Fri, 26 Jan 2024 at 20:44, David Zhang wrote: > > Thank you for the patch. > > I applied this patch manually to the master branch, resolving a conflict > in `numeric.h`. It successfully passed both `make check` and `make > check-world`. > Thanks for testing. Interestingly, the cfbot didn't

RE: Synchronizing slots from primary to standby

2024-01-29 Thread Zhijie Hou (Fujitsu)
On Monday, January 29, 2024 7:30 PM Amit Kapila wrote: > > On Mon, Jan 29, 2024 at 3:11 PM shveta malik > wrote: > > > > PFA v71 patch set with above changes. > > > > Few comments on 0001 Thanks for the comments. > === > 1. > parse_subscription_options() > { > ... > /* > *

RE: Finding every use of a built-in function

2024-01-29 Thread Kurlaev Jaroslav
> plpgsq_check can show dependencies > https://github.com/okbob/plpgsql_check#dependency-list That's not exactly what I was looking for, but it's a useful tool that could help me anyway. Thanks!

Re: PG versus libxml2 2.12.x

2024-01-29 Thread Tom Lane
Peter Eisentraut writes: > On 27.01.24 20:04, Tom Lane wrote: >> I don't mind adopting the "const" --- it's a good idea in isolation. >> The trouble is in fixing our code to work with both old and new >> libxml2 versions. We could thrash around with a configure test or >> something, but I think

Re: Should we remove -Wdeclaration-after-statement?

2024-01-29 Thread Mark Dilger
> On Jan 29, 2024, at 7:03 AM, Jelte Fennema-Nio wrote: > > So my suggestion is for people to respond with -1, -0.5, +-0, +0.5, or > +1 to indicate support against/for the change. -1 for me. -Infinity for refactoring the entire codebase and backpatching. — Mark Dilger EnterpriseDB:

Re: psql: add \create_function command

2024-01-29 Thread Steve Chavez
> I like your ideas upthread about \file_read and :{filename} Great ideas! :{filename} looks more convenient to use than \file_read just because it's one less command to execute. However, :{?variable_name} is already taken by psql to test whether a variable is defined or not. It might be

Re: Should we remove -Wdeclaration-after-statement?

2024-01-29 Thread Robert Haas
On Mon, Jan 29, 2024 at 10:03 AM Jelte Fennema-Nio wrote: > I feel like this is the type of change where there's not much > discussion to be had. And the only way to resolve it is to use some > voting to gauge community opinion. > > So my suggestion is for people to respond with -1, -0.5, +-0,

Re: UUID v7

2024-01-29 Thread Jelte Fennema-Nio
On Thu, 25 Jan 2024 at 13:31, Aleksander Alekseev wrote: > PFA v14. +uuidv4 () uuid + + Both functions return a version 4 (random) UUID. This is the most commonly + used type of UUID and is appropriate when random distribution of keys does + not affect performance of an application. +

Re: scalability bottlenecks with (many) partitions (and more)

2024-01-29 Thread Tomas Vondra
On 1/29/24 09:53, Ronan Dunklau wrote: > Le dimanche 28 janvier 2024, 22:57:02 CET Tomas Vondra a écrit : > > Hi Tomas ! > > I'll comment on glibc-malloc part as I studied that part last year, and > proposed some things here: https://www.postgresql.org/message-id/ >

Re: UUID v7

2024-01-29 Thread Junwang Zhao
On Mon, Jan 29, 2024 at 7:38 PM Jelte Fennema-Nio wrote: > > tl;dr I believe we should remove the uuidv7(timestamp) function from > this patchset. > > On Thu, 25 Jan 2024 at 18:04, Sergey Prokhorenko > wrote: > > In this case the documentation must state that the functions > >

Re: Wrong buffer limits check

2024-01-29 Thread Daniel Gustafsson
> On 29 Jan 2024, at 14:37, Mikhail Gribkov wrote: > I have tried to analyse Postgres code with Svace static analyzer [1] and > found something I think is a real bug. > > In pgp-decrypt.c, in prefix_init function the following check: > if (len > sizeof(tmpbuf)) > > seem to be erroneous and

Re: PG versus libxml2 2.12.x

2024-01-29 Thread Peter Eisentraut
On 27.01.24 20:04, Tom Lane wrote: Buildfarm member caiman has been failing build for a couple weeks now. The reason turns out to be that recent libxml2 has decided to throw a "const" into the signature required for custom error handlers. (API compatibility? What's that?) I don't mind adopting

Re: Race condition in FetchTableStates() breaks synchronization of subscription tables

2024-01-29 Thread vignesh C
On Fri, 26 Jan 2024 at 11:30, Alexander Lakhin wrote: > > Hello hackers, > > After determining a possible cause for intermittent failures of the test > subscription/031_column_list [1], I was wondering what makes another > subscription test (014_binary) fail on the buildfarm: >

Re: scalability bottlenecks with (many) partitions (and more)

2024-01-29 Thread Ronan Dunklau
Le lundi 29 janvier 2024, 13:17:07 CET Tomas Vondra a écrit : > > Did you try running an strace on the process ? That may give you some > > hindsights into what malloc is doing. A more sophisticated approach would > > be using stap and plugging it into the malloc probes, for example > >

Re: Should we remove -Wdeclaration-after-statement?

2024-01-29 Thread Nathan Bossart
On Mon, Jan 29, 2024 at 10:23:38AM -0500, Tom Lane wrote: > Jelte Fennema-Nio writes: >> I feel like this is the type of change where there's not much >> discussion to be had. And the only way to resolve it is to use some >> voting to gauge community opinion. > >> So my suggestion is for people

Re: Report planning memory in EXPLAIN ANALYZE

2024-01-29 Thread Alvaro Herrera
Okay, so I gave this another look and concluded that I definitely didn't like the whole business of having one level open the explain group and return outwards whether it had been done so that the other level would close it. So I made the code do what I said I thought it should do (adding a new

separating use of SerialSLRULock

2024-01-29 Thread Alvaro Herrera
Hello In Dilip's patch to improve SLRU concurrency, there's a requirement to prevent predicate.c's SLRU control lock from being used to control access to another shared memory structure, SerialControlData. This struct is used to keep track of the areas of the SLRU that are valid. Dilip just

Re: Should we remove -Wdeclaration-after-statement?

2024-01-29 Thread Tom Lane
Jelte Fennema-Nio writes: > I feel like this is the type of change where there's not much > discussion to be had. And the only way to resolve it is to use some > voting to gauge community opinion. > So my suggestion is for people to respond with -1, -0.5, +-0, +0.5, or > +1 to indicate support

Re: [PATCH] Add native windows on arm64 support

2024-01-29 Thread Andrew Dunstan
On 2024-01-26 Fr 09:18, Dave Cramer wrote: On Fri, 26 Jan 2024 at 07:36, Andrew Dunstan wrote: On 2024-01-25 Th 20:32, Michael Paquier wrote: > On Thu, Jan 25, 2024 at 04:52:30PM -0500, Dave Cramer wrote: >> On Thu, 25 Jan 2024 at 16:32, Andrew Dunstan wrote: >>> On

Re: CREATE INDEX CONCURRENTLY on partitioned index

2024-01-29 Thread Alexander Pyhalov
Hi. I've rebased patch on master and it'seems to me there's one more issue - when we call DefineIndexConcurrentInternal() in partitioned case, it waits for transactions, locking tableId, not tabrelid - heaprelid LockRelId is constructed for parent index relation, not for child index

Wrong buffer limits check

2024-01-29 Thread Mikhail Gribkov
Hi hackers, I have tried to analyse Postgres code with Svace static analyzer [1] and found something I think is a real bug. In pgp-decrypt.c, in prefix_init function the following check: if (len > sizeof(tmpbuf)) seem to be erroneous and should really look this way: if (len > PGP_MAX_BLOCK)

Re: Refactoring backend fork+exec code

2024-01-29 Thread reid . thompson
On Thu, 2024-01-25 at 01:51 +0200, Heikki Linnakangas wrote: > > And here we go. BackendID is now a 1-based index directly into the > PGPROC array. > Would it be worthwhile to also note in this comment FIRST_AUX_PROC's and IsAuxProcess()'s dependency on B_ARCHIVER and it's location in the enum

Re: PG versus libxml2 2.12.x

2024-01-29 Thread Tom Lane
I wrote: > Peter Eisentraut writes: >> In PL/Tcl, we used to have these CONST84 and CONST86 things, for similar >> reasons. Maybe that would be another approach. > Yeah, if the simple cast approach turns out to create warnings, > we'll have to fall back on using actually different

Optmize bitmapword macros calc (src/backend/nodes/bitmapset.c)

2024-01-29 Thread Ranier Vilela
Hi, IMO I believe that bitmapset can obtain an optimization in the calculation of the WORDNUM and BITNUM macros. As you know, in bitmapset, negative members are not allowed. if (x < 0) elog(ERROR, "negative bitmapset member not allowed"); Then, allow the compiler to optimize and do the

Re: psql: add \create_function command

2024-01-29 Thread Tom Lane
Steve Chavez writes: > However, :{?variable_name} is already taken by psql to test whether a > variable is defined or not. It might be confusing to use the same syntax. Hmm. Maybe we could go with :{+...} or the like? > How about using the convention of interpreting an identifier as a file

Re: Change GUC hashtable to use simplehash?

2024-01-29 Thread Ants Aasma
On Sun, 21 Jan 2024 at 03:06, Jeff Davis wrote: > Yes, thank you. I don't think we need to change the algorithm. Jumping in here at a random point just to share my findings from poking around this on and off. I am concentrating here on cstring hashing as that is the most complicated one. One

Re: cleanup patches for incremental backup

2024-01-29 Thread Nathan Bossart
On Mon, Jan 29, 2024 at 03:18:50PM -0500, Robert Haas wrote: > I'm wondering if what we need to do is run pg_walsummary on both > summary files in that case. If we just pick one or the other, how do > we know which one to pick? Even if we do that, isn't it possible that none of the summaries will

Re: Should we remove -Wdeclaration-after-statement?

2024-01-29 Thread Tom Lane
Andres Freund writes: > On 2024-01-29 15:01:06 -0500, Robert Haas wrote: >> And it still baffles me why we allow everyone to pick their own system for >> capitalizing identifiers out of a hat, without even insisting on consistency >> from one end of the same identifier to the other. > Yes.

Re: Flushing large data immediately in pqcomm

2024-01-29 Thread Robert Haas
On Mon, Jan 29, 2024 at 11:12 AM Heikki Linnakangas wrote: > Agreed, that's silly. +1. > If there's already some data in PqSendBuffer, I wonder if it would be > better to fill it up with data, flush it, and then send the rest of the > data directly. Instead of flushing the partial data first.

Re: Schema variables - new implementation for Postgres 15

2024-01-29 Thread Dmitry Dolgov
> On Mon, Jan 29, 2024 at 08:57:42AM +0100, Pavel Stehule wrote: > Hi > > ne 28. 1. 2024 v 19:00 odesílatel Dmitry Dolgov <9erthali...@gmail.com> > napsal: > > > Thanks for the update, smaller patches looks promising. > > > > Off the list Pavel has mentioned that the first two patches contain a >

Re: meson + libpq_pipeline

2024-01-29 Thread Tristan Partin
On Mon Jan 29, 2024 at 11:37 AM CST, Alvaro Herrera wrote: I just realized while looking at Jelte's patch for the new nonblocking query cancel stuff that the Meson build doesn't run the libpq_pipeline tests :-( Is there any way to wire the tests to make it work? I can try to take a look for

Re: Things I don't like about \du's "Attributes" column

2024-01-29 Thread Pavel Luzanov
On 28.01.2024 22:51, Pavel Luzanov wrote: On 23.01.2024 04:18, Tom Lane wrote: I think expecting the pg_roles view to change for this is problematic. You can't have that in the back branches, so with this patch psql will show something different against a pre-17 server than later versions. At

Re: meson + libpq_pipeline

2024-01-29 Thread Jelte Fennema-Nio
On Mon, 29 Jan 2024 at 19:37, Tristan Partin wrote: > > On Mon Jan 29, 2024 at 11:37 AM CST, Alvaro Herrera wrote: > > I just realized while looking at Jelte's patch for the new nonblocking > > query cancel stuff that the Meson build doesn't run the libpq_pipeline > > tests :-( > > > > Is there

Re: Streaming read-ready sequential scan code

2024-01-29 Thread Melanie Plageman
On Mon, Jan 29, 2024 at 4:24 PM David Rowley wrote: > > On Tue, 30 Jan 2024 at 10:17, Melanie Plageman > wrote: > > Though logically the performance with 0001 and 0002 should be the same > > as master (no new non-inline function calls, no additional looping), > > I've done a bit of profiling

Re: Hide exposed impl detail of wchar.c

2024-01-29 Thread Nathan Bossart
On Fri, Jan 26, 2024 at 01:24:19PM -0500, Tom Lane wrote: > Nathan Bossart writes: >> I see that I was planning on back-patching this to v16, but since >> is_valid_ascii() was introduced in v15, I'm wondering if it'd be better to >> back-patch it there so that is_valid_ascii() lives in the same

Re: Should we remove -Wdeclaration-after-statement?

2024-01-29 Thread Euler Taveira
On Mon, Jan 29, 2024, at 12:03 PM, Jelte Fennema-Nio wrote: > I feel like this is the type of change where there's not much > discussion to be had. And the only way to resolve it is to use some > voting to gauge community opinion. > > So my suggestion is for people to respond with -1, -0.5, +-0,

Re: Optmize bitmapword macros calc (src/backend/nodes/bitmapset.c)

2024-01-29 Thread Nathan Bossart
On Mon, Jan 29, 2024 at 04:43:32PM -0300, Ranier Vilela wrote: > Em seg., 29 de jan. de 2024 às 16:32, Nathan Bossart < > nathandboss...@gmail.com> escreveu: >> -#define WORDNUM(x) ((x) / BITS_PER_BITMAPWORD) >> -#define BITNUM(x) ((x) % BITS_PER_BITMAPWORD) >> +#define WORDNUM(x)

Re: Streaming read-ready sequential scan code

2024-01-29 Thread David Rowley
On Tue, 30 Jan 2024 at 10:17, Melanie Plageman wrote: > Though logically the performance with 0001 and 0002 should be the same > as master (no new non-inline function calls, no additional looping), > I've done a bit of profiling anyway. I created a large multi-GB table, > read it all into shared

Re: psql: add \create_function command

2024-01-29 Thread Pavel Stehule
po 29. 1. 2024 v 18:11 odesílatel Tom Lane napsal: > Steve Chavez writes: > > However, :{?variable_name} is already taken by psql to test whether a > > variable is defined or not. It might be confusing to use the same syntax. > > Hmm. Maybe we could go with :{+...} or the like? > > > How about

Re: [17] CREATE SUBSCRIPTION ... SERVER

2024-01-29 Thread Bharath Rupireddy
On Mon, Jan 29, 2024 at 11:11 PM Bharath Rupireddy wrote: > > On Wed, Jan 24, 2024 at 7:15 AM Jeff Davis wrote: > > > > On Tue, 2024-01-23 at 15:21 +0530, Ashutosh Bapat wrote: > > > I am with the prefix. The changes it causes make review difficult. If > > > you can separate those changes into a

Re: cleanup patches for incremental backup

2024-01-29 Thread Robert Haas
On Mon, Jan 29, 2024 at 1:21 PM Nathan Bossart wrote: > > Ah, I think this query: > > > > SELECT tli, start_lsn, end_lsn from pg_available_wal_summaries() > > WHERE tli = $summarized_tli AND end_lsn > '$summarized_lsn' > > > > is returning more than one row in some cases. I

Re: Should we remove -Wdeclaration-after-statement?

2024-01-29 Thread Andres Freund
Hi, On 2024-01-29 15:01:06 -0500, Robert Haas wrote: > And it still baffles me why we allow everyone to pick their own system for > capitalizing identifiers out of a hat, without even insisting on consistency > from one end of the same identifier to the other. Yes. Please. I hate some

Re: UUID v7

2024-01-29 Thread Jelte Fennema-Nio
On Mon, 29 Jan 2024 at 19:32, Andrey M. Borodin wrote: > Even if the developer pass constant time to uuidv7(T) they will get what they > asked for - unique identifier. Moreover - it still will be keeping locality. > There will be no negative consequences at all. It will be significantly "less

Streaming read-ready sequential scan code

2024-01-29 Thread Melanie Plageman
Hi, Last year, David and I worked on a round of refactoring for heapgettup() and heapgettup_pagemode() [1]. Now that the streaming read API has been proposed [2], there is a bit more refactoring that can be done on master to prepare sequential scan to support streaming reads. Patches 0001 and

Re: Optmize bitmapword macros calc (src/backend/nodes/bitmapset.c)

2024-01-29 Thread Nathan Bossart
On Tue, Jan 30, 2024 at 11:23:57AM +1300, David Rowley wrote: > On Tue, 30 Jan 2024 at 08:32, Nathan Bossart wrote: >> I'm currently +0.1 for this change. I don't see any huge problem with >> trimming a few instructions, but I'm dubious there's any measurable impact. >> However, a cycle saved is

Re: [17] CREATE SUBSCRIPTION ... SERVER

2024-01-29 Thread Bharath Rupireddy
On Wed, Jan 24, 2024 at 7:15 AM Jeff Davis wrote: > > On Tue, 2024-01-23 at 15:21 +0530, Ashutosh Bapat wrote: > > I am with the prefix. The changes it causes make review difficult. If > > you can separate those changes into a patch that will help. > > I ended up just removing the dummy FDW. Real

Re: cleanup patches for incremental backup

2024-01-29 Thread Nathan Bossart
On Sat, Jan 27, 2024 at 10:31:09AM -0600, Nathan Bossart wrote: > On Sat, Jan 27, 2024 at 11:00:01AM +0300, Alexander Lakhin wrote: >> I'm discouraged by "\n1" in the file name and in the >> "examining summary..." message. >> regress_log_002_blocks from the following successful test run on the

Re: Should we remove -Wdeclaration-after-statement?

2024-01-29 Thread Heikki Linnakangas
On 29/01/2024 19:07, Robert Haas wrote: On Mon, Jan 29, 2024 at 10:03 AM Jelte Fennema-Nio wrote: I feel like this is the type of change where there's not much discussion to be had. And the only way to resolve it is to use some voting to gauge community opinion. So my suggestion is for people

Re: Should we remove -Wdeclaration-after-statement?

2024-01-29 Thread Robert Haas
On Mon, Jan 29, 2024 at 1:38 PM Heikki Linnakangas wrote: > -0.5 from me, for exactly those reasons Robert said. I wouldn't mind > removing the compiler flag as long as we mostly keep the current style > of declarations at top, with exceptions when it really makes sense. But > in practice it

Re: Optmize bitmapword macros calc (src/backend/nodes/bitmapset.c)

2024-01-29 Thread David Rowley
On Tue, 30 Jan 2024 at 08:32, Nathan Bossart wrote: > I'm currently +0.1 for this change. I don't see any huge problem with > trimming a few instructions, but I'm dubious there's any measurable impact. > However, a cycle saved is a cycle earned... FWIW, In [1] and subsequent replies, there are

Re: Make documentation builds reproducible

2024-01-29 Thread Peter Smith
On Thu, Jan 25, 2024 at 9:12 AM Peter Smith wrote: > > On Tue, Jan 23, 2024 at 12:32 PM Peter Smith wrote: > > > > On Tue, Jan 23, 2024 at 12:13 PM Tom Lane wrote: > > > > > > Peter Smith writes: > > > > I usually the HTML documentation locally using command: > > > > make STYLE=website html >

Re: UUID v7

2024-01-29 Thread Andrey M. Borodin
> On 25 Jan 2024, at 22:04, Sergey Prokhorenko > wrote: > > Aleksander, > > In this case the documentation must state that the functions > uuid_extract_time() and uuidv7(T) are against the RFC requirements, and that > developers may use these functions with caution at their own risk, and

Re: Schema variables - new implementation for Postgres 15

2024-01-29 Thread Pavel Stehule
po 29. 1. 2024 v 19:36 odesílatel Dmitry Dolgov <9erthali...@gmail.com> napsal: > > On Mon, Jan 29, 2024 at 08:57:42AM +0100, Pavel Stehule wrote: > > Hi > > > > ne 28. 1. 2024 v 19:00 odesílatel Dmitry Dolgov <9erthali...@gmail.com> > > napsal: > > > > > Thanks for the update, smaller patches

Re: Optmize bitmapword macros calc (src/backend/nodes/bitmapset.c)

2024-01-29 Thread Nathan Bossart
On Mon, Jan 29, 2024 at 01:30:47PM -0300, Ranier Vilela wrote: > IMO I believe that bitmapset can obtain an optimization in the calculation > of the WORDNUM and BITNUM macros. > > As you know, in bitmapset, negative members are not allowed. > > if (x < 0) > elog(ERROR, "negative bitmapset member

Re: Optmize bitmapword macros calc (src/backend/nodes/bitmapset.c)

2024-01-29 Thread Ranier Vilela
Em seg., 29 de jan. de 2024 às 16:32, Nathan Bossart < nathandboss...@gmail.com> escreveu: > On Mon, Jan 29, 2024 at 01:30:47PM -0300, Ranier Vilela wrote: > > IMO I believe that bitmapset can obtain an optimization in the > calculation > > of the WORDNUM and BITNUM macros. > > > > As you know,

meson + libpq_pipeline

2024-01-29 Thread Alvaro Herrera
I just realized while looking at Jelte's patch for the new nonblocking query cancel stuff that the Meson build doesn't run the libpq_pipeline tests :-( Is there any way to wire the tests to make it work? -- Álvaro Herrera 48°01'N 7°57'E — https://www.EnterpriseDB.com/ "I can't

Re: Should we remove -Wdeclaration-after-statement?

2024-01-29 Thread Andres Freund
Hi, On January 29, 2024 2:09:23 PM PST, Tom Lane wrote: >Andres Freund writes: >> On 2024-01-29 15:01:06 -0500, Robert Haas wrote: >>> And it still baffles me why we allow everyone to pick their own system for >>> capitalizing identifiers out of a hat, without even insisting on consistency >>>

Re: Should we remove -Wdeclaration-after-statement?

2024-01-29 Thread Andres Freund
Hi, On 2023-12-27 12:48:40 +0100, Jelte Fennema-Nio wrote: > Postgres currently requires all variables to be declared at the top of > the function, because it specifies -Wdeclaration-after-statement. One > of the reasons that we had this warning was because C89 required this > style of

Re: Should we remove -Wdeclaration-after-statement?

2024-01-29 Thread Andrew Dunstan
On 2024-01-29 Mo 14:58, Andres Freund wrote: Hi, On 2023-12-27 12:48:40 +0100, Jelte Fennema-Nio wrote: Postgres currently requires all variables to be declared at the top of the function, because it specifies -Wdeclaration-after-statement. One of the reasons that we had this warning was

Re: pg_column_toast_chunk_id: a function to get a chunk ID of a TOASTed value

2024-01-29 Thread jian he
On Tue, Jan 30, 2024 at 12:35 PM Yugo NAGATA wrote: > > > Sorry, I also attached a wrong file. > Attached is the correct one. I think you attached the wrong file again. also please name it as v4.

Re: pg_column_toast_chunk_id: a function to get a chunk ID of a TOASTed value

2024-01-29 Thread Yugo NAGATA
On Tue, 30 Jan 2024 13:47:45 +0800 jian he wrote: > On Tue, Jan 30, 2024 at 12:35 PM Yugo NAGATA wrote: > > > > > > Sorry, I also attached a wrong file. > > Attached is the correct one. > I think you attached the wrong file again. also please name it as v4. Opps..sorry, again. I attached the

Re: Transaction timeout

2024-01-29 Thread Andrey M. Borodin
> On 26 Jan 2024, at 19:58, Japin Li wrote: > > Thanks for updating the patch. Here are some comments for v24. > > + > +Terminate any session that spans longer than the specified amount of > +time in transaction. The limit applies both to explicit transactions > +

Re: Support "Right Semi Join" plan shapes

2024-01-29 Thread Alena Rybakina
Hi! Thank you for your work on this subject. I have reviewed your patch and I think it is better to add an Assert for JOIN_RIGHT_SEMI to the ExecMergeJoin and ExecNestLoop functions to prevent the use of RIGHT_SEMI for these types of connections (NestedLoop and MergeJoin). Mostly I'm

Re: tablecmds.c/MergeAttributes() cleanup

2024-01-29 Thread Ashutosh Bapat
Hi Alexander, On Sun, Jan 28, 2024 at 1:30 PM Alexander Lakhin wrote: > > Hello Peter, > > 26.01.2024 16:42, Peter Eisentraut wrote: > > > > I have committed all this. These are great improvements. > > > > Please look at the segmentation fault triggered by the following query since > 4d969b2f8:

Re: UUID v7

2024-01-29 Thread Andrey M. Borodin
> On 30 Jan 2024, at 01:38, Jelte Fennema-Nio wrote: > > Yeah, I liked the feature to generate UUIDv7 based on timestamp too. > But following the spec seems more important than a nice feature to me. PFA v15. Changes: removed timestamp argument, incorporated Jelte’s documentation addons.

Re: Returning non-terminated string in ECPG Informix-compatible function

2024-01-29 Thread Ashutosh Bapat
On Mon, Jan 29, 2024 at 2:17 PM wrote: > > Greetings, everyone! > > While analyzing output of Svace static analyzer [1] I've found a bug. > > In function intoasc(interval * i, char *str) from file > src/interfaces/ecpg/compatlib/informix.c > we return a non-terminated string since we use memcpy

Re: Synchronizing slots from primary to standby

2024-01-29 Thread Peter Smith
Here are some review comments for v72-0001 == doc/src/sgml/ref/alter_subscription.sgml 1. + parameter value of the subscription. Otherwise, the slot on the + publisher may behave differently from what subscription's + failover + option says. The slot on the publisher

Re: Opportunistically pruning page before update

2024-01-29 Thread James Coleman
On Fri, Jan 26, 2024 at 8:33 PM James Coleman wrote: > > On Tue, Jan 23, 2024 at 2:46 AM Dilip Kumar wrote: > > > > On Tue, Jan 23, 2024 at 7:18 AM James Coleman wrote: > > > > > > On Mon, Jan 22, 2024 at 8:21 PM James Coleman wrote: > > > > > > > > See rebased patch attached. > > > > > > I

Re: subscription disable_on_error not working after ALTER SUBSCRIPTION set bad conninfo

2024-01-29 Thread Peter Smith
On Fri, Jan 19, 2024 at 7:21 PM Masahiko Sawada wrote: > > On Thu, Jan 18, 2024 at 6:54 PM Amit Kapila wrote: > > > > On Thu, Jan 18, 2024 at 11:15 AM Peter Smith wrote: > > > > > > On Thu, Jan 18, 2024 at 12:55 PM Masahiko Sawada > > > wrote: > > > > > > > ... > > > > > > > > Although we can

Re: pg_column_toast_chunk_id: a function to get a chunk ID of a TOASTed value

2024-01-29 Thread jian he
On Fri, Jan 26, 2024 at 8:42 AM Yugo NAGATA wrote: > > On Tue, 2 Jan 2024 08:00:00 +0800 > jian he wrote: > > > On Mon, Nov 6, 2023 at 8:00 AM jian he wrote: > > > > > > minor doc issues. > > > Returns the chunk id of the TOASTed value, or NULL if the value is not > > > TOASTed. > > > Should

Re: Reducing memory consumed by RestrictInfo list translations in partitionwise join planning

2024-01-29 Thread Ashutosh Bapat
On Sat, Jan 27, 2024 at 8:26 AM vignesh C wrote: > > On Tue, 31 Oct 2023 at 10:48, Ashutosh Bapat > wrote: > > > > On Thu, Sep 14, 2023 at 4:39 PM Ashutosh Bapat > > wrote: > > > > > > The patch set is thus > > > 0001 - patch used to measure memory used during planning > > > > > > 0002 - Patch

Re: UUID v7

2024-01-29 Thread Sergey Prokhorenko
Andrey, I think this phrase is outdated: "This function can optionally accept a timestamp used instead of current time.This allows implementation of k-way sotable identifiers." This phrase is wrong: "Both functions return a version 4 (random) UUID." For this phrase the reason is unclear and the

Re: Memory consumed by child SpecialJoinInfo in partitionwise join planning

2024-01-29 Thread Ashutosh Bapat
On Fri, Jan 26, 2024 at 8:42 PM vignesh C wrote: > > On Wed, 4 Oct 2023 at 04:02, Ashutosh Bapat > wrote: > > > > On Fri, Sep 29, 2023 at 8:36 AM Amit Langote > > wrote: > > > IOW, something > > > like the following would have sufficed: .. snip... > > > > Works for me. PFA patchset with these

Re: Synchronizing slots from primary to standby

2024-01-29 Thread Amit Kapila
On Mon, Jan 29, 2024 at 6:47 PM Zhijie Hou (Fujitsu) wrote: > > On Monday, January 29, 2024 7:30 PM Amit Kapila > wrote: > > > > > === > > 1. > > parse_subscription_options() > > { > > ... > > /* > > * We've been explicitly asked to not connect, that requires some > > *

  1   2   >