Re: Questioning an errcode and message in jsonb.c

2023-09-19 Thread Peter Eisentraut
On 18.09.23 18:55, Chapman Flack wrote: It would make me happy if the message could be changed, and maybe ERRCODE_INVALID_PARAMETER_VALUE also changed, perhaps to one of the JSON-specific ones in the 2203x range. What is an example of a statement or function call that causes this error? Then

Re: RFC: Logging plan of the running query

2023-09-19 Thread Lepikhov Andrei
On Tue, Sep 19, 2023, at 8:39 PM, torikoshia wrote: > On 2023-09-15 15:21, Lepikhov Andrei wrote: >> On Thu, Sep 7, 2023, at 1:09 PM, torikoshia wrote: >> I have explored this patch and, by and large, agree with the code. But >> some questions I want to discuss: >> 1. Maybe add a hook to give a

RE: [PoC] pg_upgrade: allow to upgrade publisher node

2023-09-19 Thread Hayato Kuroda (Fujitsu)
Dear Amit, Thank you for reviewing! PSA new version. In this version I ran pgindent again. > +#include "access/xlogdefs.h" > #include "common/relpath.h" > #include "libpq-fe.h" > > The above include is not required. I have removed that and made a few > cosmetic changes in the attached. Yes,

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

2023-09-19 Thread Kyotaro Horiguchi
At Tue, 19 Sep 2023 13:48:55 +, "Hayato Kuroda (Fujitsu)" wrote in > Dear Horiguchi-san, > > > I added the thread to next CF entry, so let's see the how cfbot says. > > At least there are several compiler warnings. E.g., > > * pgwin32_find_postmaster_pid() has "return;", but IIUC it

Re: Bug fix for psql's meta-command \ev

2023-09-19 Thread Ryoga Yoshida
On 2023-09-20 09:32, Michael Paquier wrote: Actually there was a bit more to it in the presence of \e, that could also get some unpredictible behaviors if some errors happen while editing a query, which is something unlikely, still leads to strange behaviors on failure injections. I was

Re: Using Btree to Provide Sorting on Suffix Keys with LIMIT

2023-09-19 Thread Peter Geoghegan
On Fri, Jan 18, 2019 at 12:15 PM James Coleman wrote: > I'll attempt to describe a more real world scenario: suppose we have a > schema like: > > users(id serial primary key) > orders(id serial primary key, user_id integer, created_at timestamp) > > And wanted to find the most recent N orders for

Re: Fix bug in VACUUM and ANALYZE docs

2023-09-19 Thread Michael Paquier
On Wed, Sep 20, 2023 at 09:43:15AM +0900, Shinya Kato wrote: > Thanks for the patch. > You're right. It looks good to me. Right, it feels like there has been a lot of copy-paste in this area of the docs. Applied down to 16. -- Michael signature.asc Description: PGP signature

Re: [PATCH] Clarify the behavior of the system when approaching XID wraparound

2023-09-19 Thread Peter Geoghegan
On Sun, May 14, 2023 at 6:06 PM Peter Geoghegan wrote: > BTW, Google cloud already just instruct their users to ignore the > xidStopLimit HINT about single user mode: > > https://cloud.google.com/sql/docs/postgres/txid-wraparound I read this just today, and was reminded of this thread:

Re: CREATE FUNCTION ... SEARCH { DEFAULT | SYSTEM | SESSION }

2023-09-19 Thread Maciek Sakrejda
On Tue, Sep 19, 2023 at 5:56 PM Jeff Davis wrote: >... > On Tue, 2023-09-19 at 11:41 -0400, Robert Haas wrote: > > That leads to a second idea, which is having it continue > > to be a GUC but only affect directly-entered SQL, with all > > indirectly-entered SQL either being stored as a node tree

Re: Disabling Heap-Only Tuples

2023-09-19 Thread Laurenz Albe
On Tue, 2023-09-19 at 12:52 -0400, Robert Haas wrote: > On Tue, Sep 19, 2023 at 12:30 PM Alvaro Herrera > wrote: > > I was thinking something vaguely like "a table size that's roughly what > > an optimal autovacuuming schedule would leave the table at" assuming 0.2 > > vacuum_scale_factor.  You

Re: remaining sql/json patches

2023-09-19 Thread Amit Langote
On Tue, Sep 19, 2023 at 9:00 PM Amit Langote wrote: > On Tue, Sep 19, 2023 at 7:37 PM jian he wrote: > > --- > > https://www.postgresql.org/docs/current/extend-type-system.html#EXTEND-TYPES-POLYMORPHIC > > >> When the return value of a function is declared as a polymorphic

Re: pg_rewind with cascade standby doesn't work well

2023-09-19 Thread Michael Paquier
On Wed, Sep 20, 2023 at 11:46:45AM +0900, Kuwamura Masaki wrote: > I also found a bug (maybe). If we call `CreateRestartPoint()` during > crash-recovery, the assertion fails at ComputeXidHorizon() in procarray.c. > It's inherently orthogonal to the problem I already reported. So you can >

Re: Disabling Heap-Only Tuples

2023-09-19 Thread Laurenz Albe
On Tue, 2023-09-19 at 14:50 -0400, Robert Haas wrote: > But I know people will try to use it for instant compaction too, and > there it's worth remembering why we removed old-style VACUUM FULL. The > main problem is that it was mind-bogglingly slow. The other really bad > problem is that it caused

Re: pg_rewind with cascade standby doesn't work well

2023-09-19 Thread Kuwamura Masaki
>> IMO a test is needed that makes sure no one is going to break this in >> the future. > > You definitely need more complex test scenarios for that. If you can > come up with new ways to make the TAP tests of pg_rewind mode modular > in handling more complicated node setups, that would be a nice

Re: Inefficiency in parallel pg_restore with many tables

2023-09-19 Thread Nathan Bossart
On Mon, Sep 18, 2023 at 02:22:32PM -0700, Nathan Bossart wrote: > For now, I've committed 0001 and 0002. I intend to commit the others soon. I've committed the rest of the patches. -- Nathan Bossart Amazon Web Services: https://aws.amazon.com

Re: Move global variables of pgoutput to plugin private scope.

2023-09-19 Thread Peter Smith
Hi Hou-san. Given there are some issues raised about the 0001 patch [1] I am skipping that one until I see the replies. Meanwhile, here are some review comments for the patches v1-0002 and v1-0003 v1-0002 == Commit message 1. The pgoutput module uses a global

Re: Fix bug in VACUUM and ANALYZE docs

2023-09-19 Thread Shinya Kato
On 2023-09-19 17:59, Ryoga Yoshida wrote: Hi, Issue1: VACUUM and ANALYZE docs explain that the parameter of BUFFER_USAGE_LIMIT is optional as follows. But this is not true. The argument, size, is required for BUFFER_USAGE_LIMIT. So the docs should be fixed this issue. BUFFER_USAGE_LIMIT [ size

Re: pg_upgrade and logical replication

2023-09-19 Thread Michael Paquier
On Tue, Sep 19, 2023 at 07:14:49PM +0530, vignesh C wrote: > Here is a patch to set max_logical_replication_workers as 0 while the > server is started to prevent the launcher from being started. Since > this configuration is present from v10, no need for any version check. > I have done upgrade

Re: Bug fix for psql's meta-command \ev

2023-09-19 Thread Michael Paquier
On Tue, Sep 19, 2023 at 01:23:54PM +0300, Aleksander Alekseev wrote: > You are right, I missed it. Your patch is correct while the original > one is not quite so. Actually there was a bit more to it in the presence of \e, that could also get some unpredictible behaviors if some errors happen

Re: CREATE FUNCTION ... SEARCH { DEFAULT | SYSTEM | SESSION }

2023-09-19 Thread Jeff Davis
On Tue, 2023-09-19 at 11:41 -0400, Robert Haas wrote: > I agree this is a mess, and that documenting the mess better would be > good. But instead of saying not to do something, we need to say what > will happen if you do the thing. I'm regularly annoyed when somebody > reports that "I tried to do

Re: dikkop seems unhappy because of openssl stuff (FreeBSD 14-BETA1)

2023-09-19 Thread Tom Lane
Tomas Vondra writes: > bsd@freebsd:~ $ tclsh8.6 > % clock scan "1/26/2010" > time value too large/small to represent In hopes of replicating this, I tried installing FreeBSD 14-BETA2 aarch64 on my Pi 3B. This test case works fine: $ tclsh8.6 % clock scan "1/26/2010" 1264482000 $ tclsh8.7 %

Re: [PATCH] Add native windows on arm64 support

2023-09-19 Thread Michael Paquier
On Tue, Sep 19, 2023 at 01:35:17PM +0100, Anthony Roberts wrote: > Was there an explicit request for something there? I was under the > impression that this was all just suggestion/theory at the moment. Yes. The addition of a buildfarm member registered into the community facilities, so as it is

Re: [PATCH] Add inline comments to the pg_hba_file_rules view

2023-09-19 Thread Jim Jones
Hi Michael On 16.09.23 06:18, Michael Paquier wrote: That was the idea. I forgot about strpos(), but if you do that, do we actually need a function in core to achieve that? I guess it depends who you ask :) I personally think it would be a good addition to the view, as it would provide a more

Re: Disabling Heap-Only Tuples

2023-09-19 Thread Robert Haas
On Tue, Sep 19, 2023 at 2:20 PM Matthias van de Meent wrote: > Mostly agreed, but I think there's a pitfall here. You seem to assume > we have a perfect oracle that knows the optimal data size, but we > already know that our estimates can be significantly off. I don't > quite trust the statistics

Re: Extensible storage manager API - SMGR hook Redux

2023-09-19 Thread Tristan Partin
Found these warnings while compiling while only 0001 is applied. [1166/2337] Compiling C object src/backend/postgres_lib.a.p/storage_smgr_md.c.o ../src/backend/storage/smgr/md.c: In function ‘mdexists’: ../src/backend/storage/smgr/md.c:224:28: warning: passing argument 1 of ‘mdopenfork’ from

Re: Improving btree performance through specializing by key shape, take 2

2023-09-19 Thread Peter Geoghegan
On Tue, Sep 19, 2023 at 6:28 AM Matthias van de Meent wrote: > > To be clear, page deletion does what I described here (it does an > > in-place update of the downlink to the deleted page, so the same pivot > > tuple now points to its right sibling, which is our page of concern), > > in addition

Re: dikkop seems unhappy because of openssl stuff (FreeBSD 14-BETA1)

2023-09-19 Thread Tomas Vondra
On 9/19/23 18:45, Tom Lane wrote: > Tomas Vondra writes: >> I have no experience with tcl, but I tried this in the two tclsh >> versions installed no the system (8.6 and 8.7): > >> bsd@freebsd:~ $ tclsh8.7 >> % clock scan "1/26/2010" >> time value too large/small to represent > >>

Re: Disabling Heap-Only Tuples

2023-09-19 Thread Andres Freund
Hi, On 2023-09-19 19:33:22 +0200, Matthias van de Meent wrote: > On Tue, 19 Sept 2023 at 18:56, Andres Freund wrote: > > > > Hi, > > > > On 2023-09-19 18:30:44 +0200, Alvaro Herrera wrote: > > > This makes me think that maybe the logic needs to be a little more > > > complex to avoid the problem

Re: Disabling Heap-Only Tuples

2023-09-19 Thread Robert Haas
On Tue, Sep 19, 2023 at 12:56 PM Andres Freund wrote: > Yea, a setting like what's discussed here seems, uh, not particularly useful > for achieving the goal of compacting tables. I don't think guiding this > through SQL makes a lot of sense. For decent compaction you'd want to scan the > table

Re: Disabling Heap-Only Tuples

2023-09-19 Thread Matthias van de Meent
On Tue, 19 Sept 2023 at 18:52, Robert Haas wrote: > > On Tue, Sep 19, 2023 at 12:30 PM Alvaro Herrera > wrote: > > I was thinking something vaguely like "a table size that's roughly what > > an optimal autovacuuming schedule would leave the table at" assuming 0.2 > > vacuum_scale_factor. You

Re: GenBKI emits useless open;close for catalogs without rows

2023-09-19 Thread Heikki Linnakangas
On 18/09/2023 17:50, Matthias van de Meent wrote: (initdb takes about 73ms locally with syncing disabled) That's impressive. It takes about 600 ms on my laptop. Of which about 140 ms goes into processing the BKI file. And that's with "initdb -no-sync" option. Various methods of reducing

Re: Projection pushdown to index access method

2023-09-19 Thread Tom Lane
Robert Haas writes: > On Tue, Sep 19, 2023 at 12:35 PM Chris Cleveland > wrote: >> I'm working on an index access method. I have a function which can appear in >> a projection list which should be evaluated by the access method itself. >> Example: >> ... >> How do I get the system to pull the

Re: Disabling Heap-Only Tuples

2023-09-19 Thread Matthias van de Meent
On Tue, 19 Sept 2023 at 18:56, Andres Freund wrote: > > Hi, > > On 2023-09-19 18:30:44 +0200, Alvaro Herrera wrote: > > This makes me think that maybe the logic needs to be a little more > > complex to avoid the problem you describe: if an UPDATE is prevented > > from being HOT because of this

Re: Projection pushdown to index access method

2023-09-19 Thread Robert Haas
On Tue, Sep 19, 2023 at 12:35 PM Chris Cleveland wrote: > I'm working on an index access method. I have a function which can appear in > a projection list which should be evaluated by the access method itself. > Example: > > SELECT title, my_special_function(body) > FROM books > WHERE book_id

Re: Disabling Heap-Only Tuples

2023-09-19 Thread Andres Freund
Hi, On 2023-09-19 18:30:44 +0200, Alvaro Herrera wrote: > This makes me think that maybe the logic needs to be a little more > complex to avoid the problem you describe: if an UPDATE is prevented > from being HOT because of this setting, but then it goes and consults > FSM and it gives the update

Re: Disabling Heap-Only Tuples

2023-09-19 Thread Robert Haas
On Tue, Sep 19, 2023 at 12:30 PM Alvaro Herrera wrote: > I was thinking something vaguely like "a table size that's roughly what > an optimal autovacuuming schedule would leave the table at" assuming 0.2 > vacuum_scale_factor. You would determine the absolute minimum size for > the table given

Re: dikkop seems unhappy because of openssl stuff (FreeBSD 14-BETA1)

2023-09-19 Thread Tom Lane
Tomas Vondra writes: > I have no experience with tcl, but I tried this in the two tclsh > versions installed no the system (8.6 and 8.7): > bsd@freebsd:~ $ tclsh8.7 > % clock scan "1/26/2010" > time value too large/small to represent > bsd@freebsd:~ $ tclsh8.6 > % clock scan "1/26/2010" > time

Re: Disabling Heap-Only Tuples

2023-09-19 Thread Alvaro Herrera
On 2023-Sep-19, Robert Haas wrote: > On Tue, Sep 19, 2023 at 6:26 AM Alvaro Herrera > wrote: > > Second, I think we should make it auto-reset. That is, have the user > > set some value; later, when some condition triggers (say, the table size > > is 1.2x the limit value you configured), then

Re: Fixing tab-complete for dollar-names

2023-09-19 Thread Heikki Linnakangas
On 27/06/2023 02:47, Vik Fearing wrote: On 6/26/23 22:10, Mikhail Gribkov wrote: Hi hackers, As not much preliminary interest seem to be here, I'm sending the patch to the upcoming commitfest I have added myself as reviewer. I already had taken a look at it, and it seemed okay, but I have

Re: dikkop seems unhappy because of openssl stuff (FreeBSD 14-BETA1)

2023-09-19 Thread Tomas Vondra
On 9/18/23 20:52, Tom Lane wrote: > Tomas Vondra writes: >> it seems dikkop is unhappy again, this time because of some OpenSSL >> stuff. I'm not sure it's our problem - it might be issues with the other >> packages, or maybe something FreeBSD specific, not sure. >> ... >> Both 11 and 12

Re: dikkop seems unhappy because of openssl stuff (FreeBSD 14-BETA1)

2023-09-19 Thread Tomas Vondra
On 9/19/23 04:25, Thomas Munro wrote: > On Tue, Sep 19, 2023 at 2:04 PM Michael Paquier wrote: >> On Mon, Sep 18, 2023 at 03:11:27PM +0200, Tomas Vondra wrote: >>> Both 11 and 12 failed with a weird openssl segfaults in plpython tests, >>> see [2] and [3]. And 13 is stuck in some openssl stuff in

Re: Disabling Heap-Only Tuples

2023-09-19 Thread Robert Haas
On Tue, Sep 19, 2023 at 6:26 AM Alvaro Herrera wrote: > Second, I think we should make it auto-reset. That is, have the user > set some value; later, when some condition triggers (say, the table size > is 1.2x the limit value you configured), then the local_update_limit is > automatically

Re: Checks in RegisterBackgroundWorker.()

2023-09-19 Thread Heikki Linnakangas
On 25/08/2023 00:00, Thomas Munro wrote: On Fri, Aug 25, 2023 at 3:15 AM Heikki Linnakangas wrote: In summary, RegisterBackgroundWorker() is doing some questionable and useless work, when a shared preload library is loaded to a backend process in EXEC_BACKEND mode. Yeah. When I was working

Re: CREATE FUNCTION ... SEARCH { DEFAULT | SYSTEM | SESSION }

2023-09-19 Thread Robert Haas
On Mon, Sep 18, 2023 at 4:51 PM Jeff Davis wrote: > I don't want to make an argument of the form "the status quo is really > bad, and therefore my proposal is good". That line of argument is > suspect for good reason. +1. > But if my proposal isn't good enough, and we don't have a clear >

Relation bulk write facility

2023-09-19 Thread Heikki Linnakangas
Several places bypass the buffer manager and use direct smgrextend() calls to populate a new relation: Index AM build methods, rewriteheap.c and RelationCopyStorage(). There's fair amount of duplicated code to WAL-log the pages, calculate checksums, call smgrextend(), and finally call

Projection pushdown to index access method

2023-09-19 Thread Chris Cleveland
I'm working on an index access method. I have a function which can appear in a projection list which should be evaluated by the access method itself. Example: SELECT title, my_special_function(body) FROM books WHERE book_id <===> 42; "<===>" is the operator that invokes the access method. The

Re: pg_resetwal tests, logging, and docs update

2023-09-19 Thread Peter Eisentraut
On 13.09.23 16:36, Aleksander Alekseev wrote: All in all the patch looks OK but I have a couple of nitpicks. ``` + working on a data directory in an unclean shutdown state or with a corrupt + control file. ``` ``` + After running this command on a data directory with corrupted WAL or a +

Re: Add pg_basetype() function to obtain a DOMAIN base type

2023-09-19 Thread Steve Chavez
Just to give a data point for the need of this function: https://dba.stackexchange.com/questions/231879/how-to-get-the-basetype-of-a-domain-in-pg-type This is also a common use case for services/extensions that require postgres metadata for their correct functioning, like postgREST or

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

2023-09-19 Thread torikoshia
On 2023-09-15 19:02, Damir Belyalov wrote: Since v5 patch failed applying anymore, updated the patch. Thank you for updating the patch . I made a little review on it where corrected some formatting. Thanks for your review and update! I don't have objections the modification of the codes and

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

2023-09-19 Thread Hayato Kuroda (Fujitsu)
Dear Horiguchi-san, > I added the thread to next CF entry, so let's see the how cfbot says. At least there are several compiler warnings. E.g., * pgwin32_find_postmaster_pid() has "return;", but IIUC it should be "exit(1)" * When DWORD is printed, "%lx" should be used. * The variable "flags"

Re: pg_upgrade and logical replication

2023-09-19 Thread vignesh C
On Tue, 19 Sept 2023 at 11:49, Michael Paquier wrote: > > On Fri, Sep 15, 2023 at 04:51:57PM +0530, vignesh C wrote: > > Another approach to solve this as suggested by one of my colleague > > Hou-san would be to set max_logical_replication_workers = 0 while > > upgrading. I will evaluate this and

Re: RFC: Logging plan of the running query

2023-09-19 Thread torikoshia
On 2023-09-15 15:21, Lepikhov Andrei wrote: On Thu, Sep 7, 2023, at 1:09 PM, torikoshia wrote: On 2023-09-06 11:17, James Coleman wrote: It seems that we can know what queries were running from the stack traces you shared. As described above, I suspect a lock which was acquired prior to

Re: Improving btree performance through specializing by key shape, take 2

2023-09-19 Thread Matthias van de Meent
On Tue, 19 Sept 2023 at 03:56, Peter Geoghegan wrote: > > On Mon, Sep 18, 2023 at 6:29 PM Peter Geoghegan wrote: > > I also have significant doubts about your scheme for avoiding > > invalidating the bounds of the page based on its high key matching the > > parent's separator. The subtle dynamic

Re: tablecmds.c/MergeAttributes() cleanup

2023-09-19 Thread Peter Eisentraut
On 29.08.23 13:20, Alvaro Herrera wrote: On 2023-Aug-29, Peter Eisentraut wrote: @@ -3278,13 +3261,16 @@ MergeAttributes(List *schema, List *supers, char relpersistence, * * constraints is a list of CookedConstraint structs for previous constraints. * - * Returns true if merged

Re: [PATCH] Add native windows on arm64 support

2023-09-19 Thread Anthony Roberts
Hi, This was covered earlier in the thread - I have taken this on in Niyas' stead. Was there an explicit request for something there? I was under the impression that this was all just suggestion/theory at the moment. Thanks, Anthony On 19/09/2023 09:33, Peter Eisentraut wrote: On

Re: remaining sql/json patches

2023-09-19 Thread Erik Rijkers
Op 9/19/23 om 13:56 schreef Amit Langote: On Tue, Sep 19, 2023 at 7:18 PM Alvaro Herrera wrote: 0001: I wonder why you used Node for the ErrorSaveContext pointer instead of the specific struct you want. I propose the attached, for some extra type-safety. Or did you have a reason to do it

Re: [PoC] pg_upgrade: allow to upgrade publisher node

2023-09-19 Thread Amit Kapila
On Tue, Sep 19, 2023 at 11:47 AM Hayato Kuroda (Fujitsu) wrote: > > Dear Amit, > > Thank you for reviewing! PSA new version! > * +#include "access/xlogdefs.h" #include "common/relpath.h" #include "libpq-fe.h" The above include is not required. I have removed that and made a few cosmetic

Re: Add last_commit_lsn to pg_stat_database

2023-09-19 Thread Aleksander Alekseev
Hi, > [...] > As I was thinking about how to improve things, I realized that this > information (since it's for monitoring anyway) fits more naturally > into the stats system. I'd originally thought of exposing it in > pg_stat_wal, but that's per-cluster rather than per-database (indeed, > this

Re: remaining sql/json patches

2023-09-19 Thread Amit Langote
On Tue, Sep 19, 2023 at 7:37 PM jian he wrote: > On Mon, Sep 18, 2023 at 7:51 PM Erik Rijkers wrote: > > > > and FYI: None of these crashes occur when I leave off the 'WITH WRAPPER' > > clause. > > > > > > > > Erik > > > > > if specify with wrapper, then default behavior is keep quotes, so >

Re: Standardize type of variable when extending Buffers

2023-09-19 Thread Ranier Vilela
Em ter., 19 de set. de 2023 às 05:07, Peter Eisentraut escreveu: > On 10.07.23 13:08, Ranier Vilela wrote: > > > > Em seg., 10 de jul. de 2023 às 03:27, Kyotaro Horiguchi > > mailto:horikyota@gmail.com>> escreveu: > > > > At Fri, 7 Jul 2023 11:29:16 -0700, Gurjeet Singh >

Re: Infinite Interval

2023-09-19 Thread Dean Rasheed
On Sat, 16 Sept 2023 at 01:00, jian he wrote: > > I refactor the avg(interval), sum(interval), so moving aggregate, > plain aggregate both work with +inf/-inf. > no performance degradation, in fact, some performance gains. > I haven't reviewed this part in any detail yet, but I can confirm that

Re: CHECK Constraint Deferrable

2023-09-19 Thread Dean Rasheed
On Fri, 15 Sept 2023 at 08:00, vignesh C wrote: > > On Thu, 14 Sept 2023 at 15:33, Himanshu Upadhyaya > wrote: > > > > On Thu, Sep 14, 2023 at 9:57 AM vignesh C wrote: > >> > >> postgres=*# SET CONSTRAINTS tbl_chk_1 DEFERRED; > >> SET CONSTRAINTS > >> postgres=*# INSERT INTO tbl values (1); >

Re: Should we use MemSet or {0} for struct initialization?

2023-09-19 Thread Richard Guo
On Tue, Sep 19, 2023 at 5:37 PM Peter Eisentraut wrote: > On 31.08.23 10:32, Richard Guo wrote: > > While working on a bug in expandRecordVariable() I noticed that in the > > switch statement for case RTE_SUBQUERY we initialize struct ParseState > > with {0} while for case RTE_CTE we do that

Re: remaining sql/json patches

2023-09-19 Thread jian he
On Mon, Sep 18, 2023 at 7:51 PM Erik Rijkers wrote: > > and FYI: None of these crashes occur when I leave off the 'WITH WRAPPER' > clause. > > > > > Erik > > if specify with wrapper, then default behavior is keep quotes, so jexpr->omit_quotes will be false, which make val_string NULL. in

Re: pg16: XX000: could not find pathkey item to sort

2023-09-19 Thread Richard Guo
On Mon, Sep 18, 2023 at 10:02 PM Justin Pryzby wrote: > This fails since 1349d2790b > > commit 1349d2790bf48a4de072931c722f39337e72055e > Author: David Rowley > Date: Tue Aug 2 23:11:45 2022 +1200 > > Improve performance of ORDER BY / DISTINCT aggregates > > ts=# CREATE TABLE t (a int, b

Re: Disabling Heap-Only Tuples

2023-09-19 Thread Alvaro Herrera
On 2023-Sep-18, Robert Haas wrote: > On Tue, Sep 5, 2023 at 11:15 PM Laurenz Albe wrote: > > I don't think that is a good comparison. While most people probably > > never need to touch "local_update_limit", "work_mem" is something everybody > > has to consider. > > > > And it is not so hard to

Re: Bug fix for psql's meta-command \ev

2023-09-19 Thread Aleksander Alekseev
Hi Michael, > The patch looks incorrect to me. In case you've not noticed, we'd > still have the same problem if do_edit() fails [...] You are right, I missed it. Your patch is correct while the original one is not quite so. -- Best regards, Aleksander Alekseev

Re: remaining sql/json patches

2023-09-19 Thread Alvaro Herrera
0001: I wonder why you used Node for the ErrorSaveContext pointer instead of the specific struct you want. I propose the attached, for some extra type-safety. Or did you have a reason to do it that way? -- Álvaro HerreraBreisgau, Deutschland — https://www.EnterpriseDB.com/ "How

Re: Move bki file pre-processing from initdb to bootstrap

2023-09-19 Thread Peter Eisentraut
On 01.09.23 10:01, Krishnakumar R wrote: This patch moves the pre-processing for tokens in the bki file from initdb to bootstrap. With these changes the bki file will only be opened once in bootstrap and parsing will be done by the bootstrap parser. I did some rough performance tests on this.

Re: Improvements in pg_dump/pg_restore toc format and performances

2023-09-19 Thread Pierre Ducroquet
On Monday, September 18, 2023 11:54:42 PM CEST Nathan Bossart wrote: > On Mon, Sep 18, 2023 at 02:52:47PM -0700, Nathan Bossart wrote: > > On Thu, Jul 27, 2023 at 10:51:11AM +0200, Pierre Ducroquet wrote: > >> I ended up writing several patches that shaved some time for pg_restore > >> -l, > >>

Re: Should we use MemSet or {0} for struct initialization?

2023-09-19 Thread Peter Eisentraut
On 31.08.23 10:32, Richard Guo wrote: While working on a bug in expandRecordVariable() I noticed that in the switch statement for case RTE_SUBQUERY we initialize struct ParseState with {0} while for case RTE_CTE we do that with MemSet.  I understand that there is nothing wrong with this, just

Re: Improve the log message output of basic_archive when basic_archive.archive_directory parameter is not set

2023-09-19 Thread bt23nguyent
On 2023-09-15 23:38, Nathan Bossart wrote: On Fri, Sep 15, 2023 at 02:48:55PM +0200, Daniel Gustafsson wrote: On 15 Sep 2023, at 12:49, Alvaro Herrera wrote: On 2023-Sep-15, Daniel Gustafsson wrote: -basic_archive_configured(ArchiveModuleState *state)

Re: Sync scan & regression tests

2023-09-19 Thread Heikki Linnakangas
On 19/09/2023 01:57, Andres Freund wrote: On 2023-09-18 13:49:24 +0300, Heikki Linnakangas wrote: d) Copy fewer rows to the table in the test. If we copy only 6 rows, for example, the table will have only two pages, regardless of shared_buffers. I'm leaning towards d). The whole test is a

Fix bug in VACUUM and ANALYZE docs

2023-09-19 Thread Ryoga Yoshida
Hi, Issue1: VACUUM and ANALYZE docs explain that the parameter of BUFFER_USAGE_LIMIT is optional as follows. But this is not true. The argument, size, is required for BUFFER_USAGE_LIMIT. So the docs should be fixed this issue. BUFFER_USAGE_LIMIT [ size ]

Re: Fix GIST readme on LSN vs NSN

2023-09-19 Thread Heikki Linnakangas
On 18/09/2023 14:53, Daniel Gustafsson wrote: On 18 Sep 2023, at 13:09, Heikki Linnakangas wrote: I propose the attached patch to reword the sentence a little more. LGTM, +1 Committed, thanks! -- Heikki Linnakangas Neon (https://neon.tech)

Re: [PATCH] Add native windows on arm64 support

2023-09-19 Thread Peter Eisentraut
On 14.09.23 11:39, Daniel Gustafsson wrote: On 13 Sep 2023, at 21:12, Peter Eisentraut wrote: On 31.08.23 06:44, Tom Lane wrote: I agree. I'm really uncomfortable with claiming support for Windows-on-ARM if we don't have a buildfarm member testing it. For other platforms that have a track

Re: pgbnech: allow to cancel queries during benchmark

2023-09-19 Thread Yugo NAGATA
On Wed, 6 Sep 2023 20:13:34 +0900 Yugo NAGATA wrote: > I attached the updated patch v3. The changes since the previous > patch includes the following; > > I removed the unnecessary condition (&& false) that you > pointed out in [1]. > > The test was rewritten by using IPC::Run signal() and

Re: Improvements in pg_dump/pg_restore toc format and performances

2023-09-19 Thread Pierre Ducroquet
On Monday, September 18, 2023 11:54:42 PM CEST Nathan Bossart wrote: > On Mon, Sep 18, 2023 at 02:52:47PM -0700, Nathan Bossart wrote: > > On Thu, Jul 27, 2023 at 10:51:11AM +0200, Pierre Ducroquet wrote: > >> I ended up writing several patches that shaved some time for pg_restore > >> -l, > >>

Re: [PoC] Reducing planning time when tables have many partitions

2023-09-19 Thread Andrey Lepikhov
On 25/8/2023 14:39, Yuya Watari wrote: Hello, On Wed, Aug 9, 2023 at 8:54 PM David Rowley wrote: I think the best way to move this forward is to explore not putting partitioned table partitions in EMs and instead see if we can translate to top-level parent before lookups. This might just be

Re: Standardize type of variable when extending Buffers

2023-09-19 Thread Peter Eisentraut
On 10.07.23 13:08, Ranier Vilela wrote: Em seg., 10 de jul. de 2023 às 03:27, Kyotaro Horiguchi mailto:horikyota@gmail.com>> escreveu: At Fri, 7 Jul 2023 11:29:16 -0700, Gurjeet Singh mailto:gurj...@singh.im>> wrote in > On Fri, Jul 7, 2023 at 6:12 AM Ranier Vilela

Re: Fix error handling in be_tls_open_server()

2023-09-19 Thread Sergey Shinderuk
On 19.09.2023 03:54, Michael Paquier wrote: One doubt that I have is if we shouldn't let X509_NAME_print_ex() be as it is now, and not force a failure on the bio if this calls fails. If malloc fails inside X509_NAME_print_ex, then we will be left with empty port->peer_dn. Here is a gdb

Re: Questioning an errcode and message in jsonb.c

2023-09-19 Thread Andy Fan
Hi, Thanks for raising this issue in a more public way:) On Tue, Sep 19, 2023 at 12:55 AM Chapman Flack wrote: > > It would make me happy if the message could be changed, and maybe > ERRCODE_INVALID_PARAMETER_VALUE also changed, perhaps to one of > the JSON-specific ones in the 2203x range. >

Re: Bug fix for psql's meta-command \ev

2023-09-19 Thread Ryoga Yoshida
On 2023-09-19 15:29, Ryoga Yoshida wrote: You can see attached file. I didn't notice that Michael attached the patch file. Just ignore my file. I apologize for the inconvenience. Ryoga Yoshida

Re: Better help output for pgbench -I init_steps

2023-09-19 Thread Peter Eisentraut
On 12.07.23 15:41, Alvaro Herrera wrote: On 2023-Jul-12, Gurjeet Singh wrote: The init-steps are severely under-documented in pgbench --help output. I think at least a pointer to the the pgbench docs should be mentioned in the pgbench --help output; an average user may not rush to read the

Re: information_schema and not-null constraints

2023-09-19 Thread Peter Eisentraut
On 14.09.23 10:20, Peter Eisentraut wrote: On 06.09.23 19:52, Alvaro Herrera wrote: +    SELECT current_database()::information_schema.sql_identifier AS constraint_catalog, +   rs.nspname::information_schema.sql_identifier AS constraint_schema, +  

Re: Bug fix for psql's meta-command \ev

2023-09-19 Thread Ryoga Yoshida
On 2023-09-19 12:53, Michael Paquier wrote: Adding a comment looks important to me once we consider the edit as a path that can fail and the edited query is only executed then reset when we have PSQL_CMD_NEWEDIT as status. I would suggest the patch attached instead, taking care of the error

Re: pg_upgrade and logical replication

2023-09-19 Thread Michael Paquier
On Fri, Sep 15, 2023 at 04:51:57PM +0530, vignesh C wrote: > Another approach to solve this as suggested by one of my colleague > Hou-san would be to set max_logical_replication_workers = 0 while > upgrading. I will evaluate this and update the next version of patch > accordingly. In the context

RE: [PoC] pg_upgrade: allow to upgrade publisher node

2023-09-19 Thread Hayato Kuroda (Fujitsu)
Dear Amit, Thank you for reviewing! PSA new version! > > Sorry, wrong patch attached. PSA the correct ones. > > There is a possibility that XLOG_PARAMETER_CHANGE may be generated, > when GUC > > parameters are changed just before doing the upgrade. Added to list. > > > > You forgot to update

Re: [PATCH] fastpacth-locks compile time options

2023-09-19 Thread Sergey Sergey
Thank you for response. On Tue, Sep 19, 2023 at 2:52 AM Michael Paquier wrote: > On Mon, Sep 18, 2023 at 05:49:51PM +0300, Sergey Sergey wrote: > > Hope this patch will be usefull/ > > -uint64 fpLockBits;/* lock modes held for each fast-path > slot */ > +uint8