Re: meson and check-tests

2024-06-02 Thread Nazir Bilal Yavuz
Hi, On Sun, 2 Jun 2024 at 07:06, jian he wrote: > > On Sun, Jun 2, 2024 at 4:48 AM Tristan Partin wrote: > > > > On Fri May 31, 2024 at 12:02 PM CDT, Ashutosh Bapat wrote: > > > Hi Tristan, > > > Using make I can run only selected tests under src/test/regress using > > > TESTS=... make check-tes

walsender.c comment with no context is hard to understand

2024-06-02 Thread Peter Smith
Hi, I was looking at this code comment and wondered what it meant. AFAICT over time code has been moved around causing comments to lose their original context, so now it is hard to understand what they are saying. ~~~ After a 2017 patch [1] the code in walsender.c function logical_read_xlog_page

Re: cannot drop intarray extension

2024-06-02 Thread jian he
On Mon, Jun 3, 2024 at 12:14 PM jian he wrote: > > hi. > > setup > drop table if exist test__int cascade; > create extension intarray; > > CREATE TABLE test__int( a int[] ); > CREATE INDEX text_idx on test__int using gist (a gist__intbig_ops(siglen = > 1)); > drop extension intarray cascade;

Re: pgsql: Add more SQL/JSON constructor functions

2024-06-02 Thread Tom Lane
Peter Eisentraut writes: > On 29.05.24 18:44, Tom Lane wrote: >> Yeah, I too think this is a cast, and truncation is the spec-defined >> behavior for casting to varchar with a specific length limit. > The SQL standard says essentially that the output of json_serialize() is > some string that whe

Re: cannot drop intarray extension

2024-06-02 Thread Kashif Zeeshan
Hi Jian On Mon, Jun 3, 2024 at 9:14 AM jian he wrote: > hi. > > setup > drop table if exist test__int cascade; > create extension intarray; > > CREATE TABLE test__int( a int[] ); > CREATE INDEX text_idx on test__int using gist (a gist__intbig_ops(siglen = > 1)); > drop extension intarray ca

cannot drop intarray extension

2024-06-02 Thread jian he
hi. setup drop table if exist test__int cascade; create extension intarray; CREATE TABLE test__int( a int[] ); CREATE INDEX text_idx on test__int using gist (a gist__intbig_ops(siglen = 1)); drop extension intarray cascade; NOTICE: drop cascades to index text_idx 2024-06-03 11:53:32.629 CST

Re: Improve the connection failure error messages

2024-06-02 Thread Peter Smith
Hi, just by visual inspection of the v4/v5 patch diffs, the latest v5 LGTM. == Kind Regards, Peter Smith. Fujitsu Australia

Re: Fix overflow hazard in interval rounding

2024-06-02 Thread Joseph Koshakow
Hi Andres, Sorry for such a late reply. On Tue, Feb 13, 2024 at 2:14 PM Andres Freund wrote: > Random, mildly related thought: I wonder if it's time to, again, look at > enabling -ftrapv in assert enabled builds.I had looked at that a few years > back, and fixed a number of instances, but not a

Re: pltcl crashes due to a syntax error

2024-06-02 Thread Tom Lane
Erik Wienhold writes: > Tcl_GetVar returns null if errorInfo does not exist. Omitting econtext > from errcontext in that case looks like the proper fix to me. Yeah, that was the conclusion I came to last night while sitting in the airport, but I didn't have time to prepare a cleaned-up patch. T

Re: Schema variables - new implementation for Postgres 15

2024-06-02 Thread Peter Eisentraut
On 25.05.24 12:50, Pavel Stehule wrote: It looks odd - It is not intuitive, it introduces new inconsistency inside Postgres, or with solutions in other databases. No other database has a similar rule, so users coming from Oracle, Db2, or MSSQL, Firebird will be confused. Users that use PL/pgSQL

Re: Switch background worker on/off in runtime.

2024-06-02 Thread Peter Eisentraut
On 31.05.24 11:28, ISHAN CHHANGANI . wrote: Is it possible to switch on/off a background worker in runtime? worker.bgw_flags =BGWORKER_SHMEM_ACCESS; worker.bgw_start_time =BgWorkerStart_PostmasterStart; I want to switch off the worker based on some flag value, etc, either from the main proces

Re: pgsql: Add more SQL/JSON constructor functions

2024-06-02 Thread Peter Eisentraut
On 29.05.24 18:44, Tom Lane wrote: Amit Langote writes: On Mon, May 27, 2024 at 7:10 PM Alvaro Herrera wrote: On 2024-May-27, Alvaro Herrera wrote: I just noticed this behavior, which looks like a bug to me: select json_serialize('{"a":1, "a":2}' returning varchar(5)); json_serialize ───

Re: Avoid an odd undefined behavior with memcmp (src/bin/pg_rewind/pg_rewind.c)

2024-06-02 Thread Ranier Vilela
Em qua., 29 de mai. de 2024 às 22:41, Long Song escreveu: > > Hi Ranier, > > > > > IMO, I think that pg_rewind can have a security issue, > > if two files are exactly the same, they are considered different. > > Because use of structs with padding values is unspecified. > Logically you are right.

Re: Fix possible dereference null pointer (PQprint)

2024-06-02 Thread Ranier Vilela
Em sex., 31 de mai. de 2024 às 05:03, Daniel Gustafsson escreveu: > > On 27 May 2024, at 16:52, Ranier Vilela wrote: > > > In the function *PQprint*, the variable po->fieldName can be NULL. > > Yes. > > > See the checks a few lines up. > > Indeed, let's check it. > > for (numFieldName =

Re: pltcl crashes due to a syntax error

2024-06-02 Thread Erik Wienhold
On 2024-06-02 14:32 +0200, Pierre Forstmann wrote: > I understand that Tcl_GetVar should not be used any more and should be > replaced by Tcl_GetStringResult > (but I know nothing about Tcl internals) > > Following patch : > diff postgres/src/pl/tcl/pltcl.c.orig postgres/src/pl/tcl/pltcl.c > 1373c

Re: The xversion-upgrade test fails to stop server

2024-06-02 Thread Alexander Lakhin
02.06.2024 21:39, Andrew Dunstan wrote: Maybe uploading this log file too would help to understand what is the cause of the failure... Yeah, I'll fix that. Thank you, Andrew! Could you also take a look at: https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=sungazer&dt=2024-04-21%201

Re: meson and check-tests

2024-06-02 Thread Andrew Dunstan
On 2024-06-02 Su 01:25, Tom Lane wrote: "Tristan Partin" writes: On Fri May 31, 2024 at 12:02 PM CDT, Ashutosh Bapat wrote: We talked this off-list at the conference. It seems we have to somehow avoid passing pg_regress --schedule argument and instead pass the list of tests. Any idea how to

Optimizing COPY with SIMD

2024-06-02 Thread Neil Conway
Inspired by David Rowley's work [1] on optimizing JSON escape processing with SIMD, I noticed that the COPY code could potentially benefit from SIMD instructions in a few places, eg: (1) CopyAttributeOutCSV() has 2 byte-by-byte loops (2) CopyAttributeOutText() has 1 (3) CopyReadLineText() has 1 (4

Re: The xversion-upgrade test fails to stop server

2024-06-02 Thread Andrew Dunstan
On 2024-05-30 Th 11:00, Alexander Lakhin wrote: Hello Andrew, While reviewing recent buildfarm failures, I came across this one: https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=crake&dt=2024-05-23%2004%3A11%3A03 upgrade.crake/REL_16_STABLE/REL9_5_STABLE-ctl4.log waiting for server

Re: POC: GROUP BY optimization

2024-06-02 Thread Alexander Korotkov
Hi! On Sun, Jun 2, 2024 at 10:55 AM jian he wrote: > > On Fri, May 31, 2024 at 8:12 AM Alexander Korotkov > wrote: > > > > I've revised some grammar including the sentence you've proposed. > > > > -static List *groupclause_apply_groupingset(PlannerInfo *root, List *force); > +static List *prepr

Re: pltcl crashes due to a syntax error

2024-06-02 Thread Pierre Forstmann
I can also reproduce in Alma Linux 8.10 with tcl-devel 8.6.8 gdb says: (gdb) p interp $1 = (Tcl_Interp *) 0x288a500 (gdb) p *interp $2 = {resultDontUse = 0x288a6d8 "", freeProcDontUse = 0x0, errorLineDontUse = 1} (gdb) p msg No symbol "msg" in current context. (gdb) p emsg $3 = 0x27ebe48 "list

Re: Reduce timing overhead of EXPLAIN ANALYZE using rdtsc?

2024-06-02 Thread Andres Freund
Hi, At some point this patch switched from rdtsc to rdtscp, which imo largely negates the point of it. What lead to that? Greetings, Andres Freund

Re: POC: GROUP BY optimization

2024-06-02 Thread jian he
On Fri, May 31, 2024 at 8:12 AM Alexander Korotkov wrote: > > I've revised some grammar including the sentence you've proposed. > -static List *groupclause_apply_groupingset(PlannerInfo *root, List *force); +static List *preprocess_groupclause(PlannerInfo *root, List *force); changing preprocess