Re: proposal: schema variables

2024-12-06 Thread jian he
On Thu, Dec 5, 2024 at 2:52 PM Pavel Stehule wrote: > > Hi > > only rebase hi. disclaimer, i *only* applied v20241205-0001-Enhancing-catalog-for-support-session-variables-and-.patch. create variable v2 as text; alter variable v2 rename to v2; ERROR: session variable "v2" already exists in schem

Re: Using Expanded Objects other than Arrays from plpgsql

2024-12-06 Thread Michel Pelletier
On Tue, Dec 3, 2024 at 4:42 PM Tom Lane wrote: > Michel Pelletier writes: > > Here's a WIP patch for a pgexpanded example in src/test/modules. > > I didn't look at your patch yet, but in the meantime here's an update > that takes the next step towards what I promised. > Awesome! I made a suppo

Re: Statistics Import and Export

2024-12-06 Thread Jeff Davis
On Wed, 2024-11-27 at 00:08 -0500, Corey Huinker wrote: > > 0003 - Re-enabling in-place updates because catalog bloat bad. Attached is my version of this patch, which I intend to commit soon. I added docs and tests, and I refactored a bit to check the arguments first. Also, I separated the mvcc

inconsistent use of SearchSysCacheCopy

2024-12-06 Thread Jeff Davis
When modifying catalog contents, some callers use SearchSysCacheN() and some use SearchSysCacheCopyN(). for instance, these callers use SearchSysCacheN(): - AggregateCreate() - ProcedureCreate() while these callers that use SearchSysCacheCopyN(): - OperatorCreate() - TypeCreate() I gen

Re: Remove dependence on integer wrapping

2024-12-06 Thread Nathan Bossart
On Fri, Dec 06, 2024 at 10:22:44AM -0600, Nathan Bossart wrote: > On Thu, Dec 05, 2024 at 09:58:29PM -0600, Nathan Bossart wrote: >> Thanks for reviewing. In v28, I fixed a silly mistake revealed by cfbot's >> Windows run. I also went ahead and tried to fix most of the issues >> reported in a nea

Re: Giving the shared catalogues a defined encoding

2024-12-06 Thread Tom Lane
Thomas Munro writes: > Problem #1: You can have two databases with different encodings, and > they both pretend that pg_database, pg_authid, pg_db_role_setting etc > are in the local database encoding. That doesn't work too well: > non-ASCII text can be reinterpreted in the wrong encoding. > Th

Unable to Recover a Deleted Database Using PITR

2024-12-06 Thread Scott Taylor
Created database randomdata with one table for test purposes of point in time recovery. However, the database did not fully restore. This consistently does not work. Am I missing a step or concept about how PITR works or can you not restore a delete database using PITR? I am using postgres version:

Re: Proposal to add a new URL data type.

2024-12-06 Thread Matthias van de Meent
On Thu, 5 Dec 2024 at 15:02, Alexander Borisov wrote: > What is the main difference between WHATWG and RFC 3986? [snip] > [host] > Source: https://exаmple.com/ (а — U+0430) > RFC 3986: https://exаmple.com/. > WHATWG: https://xn--exmple-4nf.com/. [snip] > [path] > Source: https://example.com/a/./b/

Re: Proposal to add a new URL data type.

2024-12-06 Thread Alexander Borisov
Hi Daniel, 06.12.2024 16:46, Daniel Gustafsson пишет: On 6 Dec 2024, at 13:59, Alexander Borisov wrote: As I've written before, there is a difference between parsing URLs according to the RFC 3986 specification and WHATWG URLs. This is especially true for host. Here are a couple more examp

Re: meson missing test dependencies

2024-12-06 Thread Peter Eisentraut
On 05.12.24 21:10, Andres Freund wrote: Hi, On 2024-12-05 20:08:24 +0100, Peter Eisentraut wrote: On 03.12.24 17:01, Andres Freund wrote: On 2024-12-02 11:10:56 +0100, Peter Eisentraut wrote: That's unfortunately a very partial fix - because we insist on tests being run against a temporary ins

Re: Proposal to Enable/Disable Index using ALTER INDEX (with patch)

2024-12-06 Thread Shayon Mukherjee
On Mon, Nov 25, 2024 at 6:19 PM David Rowley wrote: > Another safer option could be to disallow the enable/disable ALTER > TABLE if indcheckxmin is true. We do have and use > ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE for these sorts of issues. > There are other existing failure modes relating to i

Re: Remove dependence on integer wrapping

2024-12-06 Thread Nathan Bossart
On Thu, Dec 05, 2024 at 09:58:29PM -0600, Nathan Bossart wrote: > Thanks for reviewing. In v28, I fixed a silly mistake revealed by cfbot's > Windows run. I also went ahead and tried to fix most of the issues > reported in a nearby thread [0]. The only one I haven't tracked down yet > is the "IS

Re: refactor AlterDomainAddConstraint (alter domain add constraint)

2024-12-06 Thread jian he
On Fri, Dec 6, 2024 at 10:48 PM Alvaro Herrera wrote: > > On 2024-Dec-06, jian he wrote: > > > basically processCASbits > > from > > processCASbits($3, @3, "NOT NULL") > > processCASbits($5, @5, "CHECK") > > to > > processCASbits($3, @3, "DOMAIN with NOT NULL") > > processCASbits($5, @5, "DOMAIN w

Re: Potential null pointer dereference in postgres.c

2024-12-06 Thread Maxim Orlov
I'm glad you are bringing up this issue. By the way, there are two more annoying places in postmaster.c for pg16 and older. See, strdup() also may fail if insufficient memory available. PFA patch for a REL_16_STABLE. It also applies to older versions. -- Best regards, Maxim Orlov. v2-0001-Use-

Re: Popcount optimization using SVE for ARM

2024-12-06 Thread Nathan Bossart
I suggest we move this discussion to the existing thread on this subject: https://www.postgresql.org/message-id/flat/010101936e4aaa70-b474ab9e-b9ce-474d-a3ba-a3dc223d295c-00%40us-west-2.amazonses.com -- nathan

Re: refactor AlterDomainAddConstraint (alter domain add constraint)

2024-12-06 Thread Alvaro Herrera
On 2024-Dec-06, jian he wrote: > basically processCASbits > from > processCASbits($3, @3, "NOT NULL") > processCASbits($5, @5, "CHECK") > to > processCASbits($3, @3, "DOMAIN with NOT NULL") > processCASbits($5, @5, "DOMAIN with CHECK") This doesn't actually work from a translation point of view,

Re: Pass ParseState as down to utility functions.

2024-12-06 Thread Alvaro Herrera
On 2024-Dec-06, jian he wrote: > From 6bf657c3b62b7460b317c42ce2f4fa0988acf1a0 Mon Sep 17 00:00:00 2001 > From: jian he > Date: Fri, 6 Dec 2024 16:37:18 +0800 > Subject: [PATCH v6 1/1] print out error position for some DDL command > > doing this by passing the source_string to the existing Parse

Re: Proposal to add a new URL data type.

2024-12-06 Thread Daniel Gustafsson
> On 6 Dec 2024, at 13:59, Alexander Borisov wrote: > As I've written before, there is a difference between parsing URLs > according to the RFC 3986 specification and WHATWG URLs. This is > especially true for host. Here are a couple more examples. As someone who wears another open-source hat

Re: why there is not VACUUM FULL CONCURRENTLY?

2024-12-06 Thread Alvaro Herrera
On 2024-Oct-09, Antonin Houska wrote: > diff --git a/doc/src/sgml/ref/vacuum.sgml b/doc/src/sgml/ref/vacuum.sgml > index 9110938fab..f1008f5013 100644 > --- a/doc/src/sgml/ref/vacuum.sgml > +++ b/doc/src/sgml/ref/vacuum.sgml > @@ -61,8 +62,12 @@ VACUUM [ ( class="parameter">option [, ...] ) ] [

Re: Proposal to add a new URL data type.

2024-12-06 Thread Alexander Borisov
05.12.2024 17:59, Peter Eisentraut пишет: On 05.12.24 15:01, Alexander Borisov wrote: Postgres users often store URLs in the database.  As an example, they provide links to their pages on the web, analyze users posts and get links for further storage and analysis.  Naturally, there is a need to

Re: logical replication: patch to ensure timely cleanup of aborted transactions in ReorderBuffer

2024-12-06 Thread Ashutosh Bapat
Hi Vaijayanti, On Fri, Dec 6, 2024 at 2:50 PM Vaijayanti Bharadwaj wrote: > > Hello, > > This patch is a proposed fix for an issue that can occur in logical > replication where: > 1. streaming of transactions is disabled. > 2. First, say there is a transaction that's PREPAREd. This prepared >

Re: 64 bit numbers vs format strings

2024-12-06 Thread Alvaro Herrera
On 2024-Dec-06, Thomas Munro wrote: > And no doubt .po file churn ... > I don't know what tooling is used for that sort of stuff but I imagine > that automated replacement might go a long way. There's a msgfilter utility that can be used for automated updates. I documented one usage a few years

Re: Why we need to check for local buffers in BufferIsExclusiveLocked and BufferIsDirty?

2024-12-06 Thread Nazir Bilal Yavuz
Hi, On Fri, 6 Dec 2024 at 07:03, Srinath Reddy Sadipiralla wrote: > > > On Thu, 05 Dec 2024 21:11:42 +0530 Andres Freund > > wrote --- > > > Hi, > > > On 2024-12-05 18:38:16 +0530, Srinath Reddy Sadipiralla wrote: > >> Why we need to check for local buffers in BufferIsExclusiveLocked and >

Re: postgres_fdw: Provide better emulation of READ COMMITTED behavior

2024-12-06 Thread Andy Fan
Robert Haas writes: > On Thu, Dec 5, 2024 at 4:41 AM Etsuro Fujita wrote: >> Comments welcome! Maybe I am missing something, though. > > I have a hard time seeing how this would work if cursors are in use on > the main server. Say I do this: > > DECLARE foo CURSOR FOR SELECT * FROM ft1 UNION AL

[BUG] temp_table_max_size parameter may entail an error within ReadBuffer function

2024-12-06 Thread Daniil Davydov
Hi, I noticed that this sequence of actions (for temporary table) leads to an error, if temp_table_max_size parameter is set : *** LockRelationForExtension(relation, ExclusiveLock); buf = ReadBuffer(relation, P_NEW); *** Error occurs during total temporary table size calculation (find_total_temp_r

Re: Track the amount of time waiting due to cost_delay

2024-12-06 Thread Bertrand Drouvot
Hi, On Thu, Dec 05, 2024 at 10:43:51AM +, Bertrand Drouvot wrote: > Yeah, people would likely use this new field to monitor long running vacuum. > Long enough that this error should be acceptable. Do you agree? OTOH, adding the 100% accuracy looks as simple as v9-0002 attached (0001 is same a

Re: Make pg_stat_io view count IOs as bytes instead of blocks

2024-12-06 Thread Nazir Bilal Yavuz
Hi, On Thu, 5 Dec 2024 at 12:13, Bertrand Drouvot wrote: > > Hi, > > On Wed, Dec 04, 2024 at 02:49:11PM +0300, Nazir Bilal Yavuz wrote: > > On Thu, 28 Nov 2024 at 16:39, Bertrand Drouvot > > wrote: > > > > > You are right, no need to have this check; it can not be less than 0. > > I completely r

Re: Popcount optimization using SVE for ARM

2024-12-06 Thread Kirill Reshke
I did not yet look into this in detail, but please note that PostgreSQL comments style is /**/ not //. Also, please, do not top post on this list

Re: Popcount optimization using SVE for ARM

2024-12-06 Thread devanga.susmi...@fujitsu.com
Hi Kirill, This work has been conducted independently and is not connected to https://www.postgresql.org/message-id/010101936e4aaa70-b474ab9e-b9ce-474d-a3ba-a3dc223d295c-00%40us-west-2.amazonses.com. Our patch uses the existing infrastructure, i.e. the "choose_popcount_functions" method, to

logical replication: patch to ensure timely cleanup of aborted transactions in ReorderBuffer

2024-12-06 Thread Vaijayanti Bharadwaj
Hello, This patch is a proposed fix for an issue that can occur in logical replication where: 1. streaming of transactions is disabled. 2. First, say there is a transaction that's PREPAREd. This prepared transaction is not resolved for some time. It holds back the oldestRunningXid. 3. Large transa

Re: NOT ENFORCED constraint feature

2024-12-06 Thread Amul Sul
On Thu, Dec 5, 2024 at 11:02 AM jian he wrote: > > hi. > accidentally hit segfault. > create table c11 (a int not enforced); > create table c11 (a int enforced); > we can solve it via the following or changing SUPPORTS_ATTRS accordingly. > > diff --git a/src/backend/parser/parse_utilcmd.c > b/src/

Re: Fix tiny memory leaks

2024-12-06 Thread Daniel Gustafsson
> On 6 Dec 2024, at 09:38, Tofig Aliev wrote: > There is a memory leak in functions check_application_name() and > check_cluster_name(). > Functions are located in src/backend/commands/variable.c LGTM. -- Daniel Gustafsson

Re: Pass ParseState as down to utility functions.

2024-12-06 Thread jian he
hi. extensive test for ATExecAddOf DefineType ATPrepAlterColumnType ATExecAlterColumnType DefineDomain AlterType transformAlterTableStmt only AlterType, ATExecAlterColumnType function code change no tests. AlterType doesn't have location info, can not print it out. ATExecAlterColumnType is unreac

Fix tiny memory leaks

2024-12-06 Thread Tofig Aliev
Hi, hackers! There is a memory leak in functions check_application_name() and check_cluster_name(). Functions are located in src/backend/commands/variable.c The leak can be triggered using SQL command: SET application_name=new_name; You can run pgbench with this command for a long time by pas

refactor AlterDomainAddConstraint (alter domain add constraint)

2024-12-06 Thread jian he
hi. attached patch refactor AlterDomainAddConstraint * change the error message: alter domain d_int add constraint nn not null no inherit; from ERROR: NOT NULL constraints cannot be marked NO INHERIT to ERROR: DOMAIN with NOT NULL constraints cannot be marked NO INHERIT basically processCASbits

Re: generic plans and "initial" pruning

2024-12-06 Thread Amit Langote
On Thu, Dec 5, 2024 at 10:53 PM Tomas Vondra wrote: > On 12/5/24 07:53, Amit Langote wrote: > > On Thu, Dec 5, 2024 at 2:20 AM Tomas Vondra wrote: > >> ... > >> > What if an > extension doesn't do that? What weirdness will happen? > >>> > >>> The QueryDesc.planstate won't contain a Plan

RE: Memory leak in WAL sender with pgoutput (v10~)

2024-12-06 Thread Zhijie Hou (Fujitsu)
On Thursday, December 5, 2024 11:39 PM Euler Taveira wrote: > Thanks for taking care of it. I suggest 2 small adjustments: (a) use > ALLOCSET_SMALL_SIZES instead of ALLOCSET_DEFAULT_SIZES and (b) replace > pubmemcxt with pubmemctx (that's the same abbreviation used by > cachectx). I think you co

RE: Memory leak in WAL sender with pgoutput (v10~)

2024-12-06 Thread Zhijie Hou (Fujitsu)
On Thursday, December 5, 2024 12:52 PM Michael Paquier wrote: Hi, > > On Thu, Dec 05, 2024 at 04:31:56AM +, Zhijie Hou (Fujitsu) wrote: > > I realized that this patch cannot be backpatched because it introduces > > a new field into the public PGOutputData structure. Therefore, I think > >

Re: generic plans and "initial" pruning

2024-12-06 Thread Amit Langote
On Thu, Dec 5, 2024 at 11:07 PM Tomas Vondra wrote: > On 12/5/24 12:28, Amit Langote wrote: > > On Thu, Dec 5, 2024 at 3:53 PM Amit Langote wrote: > >> On Thu, Dec 5, 2024 at 2:20 AM Tomas Vondra wrote: > >>> Sure, changing the APIs is allowed, I'm just wondering if maybe there > >>> might be a

Re: Considering fractional paths in Append node

2024-12-06 Thread Andrei Lepikhov
On 12/6/24 13:48, Andrei Lepikhov wrote: On 11/2/24 01:18, Nikita Malakhov wrote: I've corrected failing test and created a patch at Commitfest: https://commitfest.postgresql.org/51/5361/ commitfest.postgresql.org/51/5361/> I have played around with this feature, which looks promising for such a