Re: Wrong results with grouping sets

2024-10-09 Thread David Rowley
On Tue, 10 Sept 2024 at 16:04, Richard Guo wrote: > I went ahead and pushed 0001 and 0002, and am now waiting for the > upcoming bug reports. Here's one: create table a(a int); explain select * from a where exists(Select 1 from a a2 where a.a = a2.a group by a); CREATE TABLE server closed the c

Re: not null constraints, again

2024-10-09 Thread jian he
tricky case: drop table if exists part, part0 cascade; create table part (a int not null) partition by range (a); create table part0 (a int primary key); alter table part attach partition part0 for values from (0) to (1000); alter table ONLY part add primary key(a); alter table ONLY part drop const

Re: Testing autovacuum wraparound (including failsafe)

2024-10-09 Thread Masahiko Sawada
Hi, On Tue, Oct 8, 2024 at 10:00 PM Alexander Lakhin wrote: > > Hello Masahiko-san, > > 01.12.2023 05:14, Masahiko Sawada wrote: > > FYI I've configured the buildfarm animal perentie to run regression > > tests including xid_wraparound: > > > > https://buildfarm.postgresql.org/cgi-bin/show_histor

Re: BF mamba failure

2024-10-09 Thread Kouber Saparev
Am I correct to believe this patch is fixing the "can only drop stats once" issue? It just happened to us, one of our streaming replicas decided to shut down.

Almost-bug: missed case for builtin collation provider

2024-10-09 Thread Jeff Davis
pattern_char_isalpha() doesn't check for the PG_C_UTF8 builtin collation provider, and ends up falling through to isalpha() for characters in the ascii range. I don't think this is an actual correctness bug, because: (a) For all locales I tested on linux and mac, isalpha() has identical behavi

Re: Set AUTOCOMMIT to on in script output by pg_dump

2024-10-09 Thread Shinya Kato
Thank you all for the comments! On 2024-10-09 15:15, Yugo Nagata wrote: On Tue, 8 Oct 2024 21:37:38 -0700 "David G. Johnston" wrote: On Tuesday, October 8, 2024, Tom Lane wrote: > "David G. Johnston" writes: > > On Tuesday, October 8, 2024, Yugo Nagata wrote: > >> On Wed, 09 Oct 2024 11:1

Re: \watch 0 or \watch 0.00001 doesn't do what I want

2024-10-09 Thread Andrey M. Borodin
> On 10 Oct 2024, at 04:49, Michael Paquier wrote: > > How about something like the simple patch attached? Let’s add a comment to tight-loop if statement. And a test for the case. Best regards, Andrey Borodin. v2-0001-Prevent-psql-haning-in-watch-with-submillisecond-.patch Description: Bin

Re: Pgoutput not capturing the generated columns

2024-10-09 Thread Peter Smith
Here are some comments for TAP test patch v37-0003. I’m not in favour of the removal of such a large number of 'combination' and other 'misc' tests. In the commit message, please delete me as a "co-author" of this patch. == 1. Any description or comment that still mentions "all combinations"

Re: replace strtok()

2024-10-09 Thread Alexander Lakhin
Hello Peter, 23.07.2024 15:38, Peter Eisentraut wrote: This has been committed.  Thanks. Please look at the SCRAM secret, which breaks parse_scram_secret(), perhaps because strsep() doesn't return NULL where strtok() did: CREATE ROLE r PASSWORD 'SCRAM-SHA-256$4096:hpFyHTUsSWcR7O9P$LgZFIt6Oqd

Re: Doc: typo in config.sgml

2024-10-09 Thread Tom Lane
Bruce Momjian writes: > Can we use Unicode in the SGML files? I believe we've been doing it for contributors' names that require non-ASCII letters, but not in any other places. regards, tom lane

Re: Add contrib/pg_logicalsnapinspect

2024-10-09 Thread Bertrand Drouvot
Hi, On Wed, Oct 09, 2024 at 10:21:31AM -0700, Masahiko Sawada wrote: > On Wed, Oct 9, 2024 at 1:12 AM Bertrand Drouvot > wrote: > > One option could be (did not test it) to add this switch in > > construct_array_builtin(): > > > > + case XIDOID: > > + elmlen =

Re: [PATCH] Add some documentation on how to call internal functions

2024-10-09 Thread Pavel Stehule
Hi st 9. 10. 2024 v 20:54 odesílatel Florents Tselai napsal: > Here's a v2 > - note on NULL args/returns > - ref PointerGetDatum > - used your example. Started adding some comments but don't think they're > really necessary. The reader gets the point as-is I think. > Now, I don't see any issue

Re: Allow default \watch interval in psql to be configured

2024-10-09 Thread Pavel Stehule
čt 10. 10. 2024 v 2:02 odesílatel Michael Paquier napsal: > On Wed, Oct 09, 2024 at 04:24:27PM +0200, Daniel Gustafsson wrote: > > Fixed. > > -doublesleep = 2; > +doublesleep = pset.watch_interval; > > This forces the use of seconds as unit. The interval values I

Re: Doc: typo in config.sgml

2024-10-09 Thread Bruce Momjian
On Wed, Oct 9, 2024 at 11:49:29AM +0900, Tatsuo Ishii wrote: > >> On Mon, Sep 30, 2024 at 11:59:48AM +0200, Daniel Gustafsson wrote: > >> > > On 30 Sep 2024, at 11:03, Tatsuo Ishii wrote: > >> > > > >> > I think there's an unnecessary underscore in config.sgml. > >> > > > >> > > I was wron

Re: First draft of PG 17 release notes

2024-10-09 Thread Bruce Momjian
On Tue, Oct 8, 2024 at 11:57:19AM +0530, Amit Kapila wrote: > On Tue, Oct 8, 2024 at 6:25 AM Bruce Momjian wrote: > > > > On Sun, Sep 29, 2024 at 06:33:29PM +0530, Amit Kapila wrote: > > > > > It is better to write the above statement as: > > > > > "pg_upgrade now preserves replication slots on >

Re: First draft of PG 17 release notes

2024-10-09 Thread Bruce Momjian
On Tue, Oct 8, 2024 at 07:51:23PM +0900, Yugo NAGATA wrote: > On Mon, 7 Oct 2024 20:00:45 -0400 > Bruce Momjian wrote: > > > On Mon, Oct 7, 2024 at 07:25:11PM -0400, Bruce Momjian wrote: > > > > Yes. This change on CREATE INDEX was introduced by 2af07e2f7 together > > > > with > > > > other co

Re: general purpose array_sort

2024-10-09 Thread Junwang Zhao
On Wed, Oct 9, 2024 at 11:46 PM Junwang Zhao wrote: > > On Wed, Oct 9, 2024 at 10:10 PM Junwang Zhao wrote: > > > > Hi Amit, > > > > On Thu, Oct 3, 2024 at 2:22 PM Amit Langote wrote: > > > > > > Hi Junwang, > > > > > > On Wed, Oct 2, 2024 at 11:46 PM Junwang Zhao wrote: > > > > On Wed, Oct 2,

Re: Allow pushdown of HAVING clauses with grouping sets

2024-10-09 Thread Richard Guo
On Wed, Sep 11, 2024 at 11:43 AM Richard Guo wrote: > In some cases, we may want to transfer a HAVING clause into WHERE in > hopes of eliminating tuples before aggregation instead of after. > > Previously, we couldn't do this if there were any nonempty grouping > sets, because we didn't have a way

Re: Why don't we consider explicit Incremental Sort?

2024-10-09 Thread Richard Guo
On Sun, Sep 22, 2024 at 1:38 PM David Rowley wrote: > Just looking at the commit message: > > > The rationale is based on the assumption that incremental sort is > > always faster than full sort when there are presorted keys, a premise > > that has been applied in various parts of the code. This

Re: Inconsistent RestrictInfo serial numbers

2024-10-09 Thread Richard Guo
On Wed, Oct 9, 2024 at 9:30 PM Ashutosh Bapat wrote: > On Wed, Oct 9, 2024 at 7:45 AM Richard Guo wrote: > > On Tue, Oct 8, 2024 at 9:02 PM Ashutosh Bapat > > wrote: > > > But I don't see any relation specific information being > > > considered while deciding whether the clause is constant false

ECPG Refactor: move sqlca variable in ecpg_log()

2024-10-09 Thread Yuto Sasaki (Fujitsu)
The sqlca variable in the ecpg_log() was declared with an unnecessarily wide scope, so I moved to the appropriate place. Please see attached. scope.diff Description: scope.diff

Re: not null constraints, again

2024-10-09 Thread jian he
I did some refactoring on transformColumnDefinition since transformColumnDefinition only deals with a single ColumnDef. and serial/primary/identity cannot allow not-null no inherit. We can preliminary iterate through ColumnDef->constraints to check that ColumnDef can allow not-null no inherit or no

Re: [PATCH] Move clause_sides_match_join() into pathnode.h

2024-10-09 Thread David Rowley
On Thu, 10 Oct 2024 at 08:38, James Hunter wrote: > We had two almost-identical copies of the utility function > clause_sides_match_join() -- one in joinpath.c, and one in > analyzejoins.c. Both copies were marked "inline," so we might as well > just move the (inline) function definition into a co

Re: Allow default \watch interval in psql to be configured

2024-10-09 Thread Michael Paquier
On Wed, Oct 09, 2024 at 04:24:27PM +0200, Daniel Gustafsson wrote: > Fixed. -doublesleep = 2; +doublesleep = pset.watch_interval; This forces the use of seconds as unit. The interval values I have been using a lot myself are between 0.2s and 0.5s because I usually

Re: Use MAX_PARALLEL_WORKER_LIMIT consistently in guc_tables.c

2024-10-09 Thread Michael Paquier
On Wed, Oct 09, 2024 at 10:28:05PM +0800, Zhang Mingli wrote: > On Oct 9, 2024 at 20:35 +0800, Matthias van de Meent , > wrote: >> PFA a trivial one-line patch that makes that a bit more consistent. > > LGTM. Makes sense to me as well. Thanks for the patch. -- Michael signature.asc Description

Re: \watch 0 or \watch 0.00001 doesn't do what I want

2024-10-09 Thread Michael Paquier
On Wed, Oct 09, 2024 at 11:03:03AM -0400, Tom Lane wrote: > in the loop, which I bet some cowboy added to fix the zero-wait > problem you complained of. But it's doing the wrong thing because > it checks sleep not sleep_ms. > > We should change this to test sleep_ms, and we should probably > fix

Re: Official devcontainer config

2024-10-09 Thread Tristan Partin
On Sat Aug 3, 2024 at 9:00 PM CDT, Junwang Zhao wrote: On Fri, Aug 2, 2024 at 12:29 AM Jelte Fennema-Nio wrote: It might make sense to install Tristan (ccd) his Postgres Hacker extension for vscode to make this a bit more userfriendly: https://marketplace.visualstudio.com/items?itemName=trista

Re: sunsetting md5 password support

2024-10-09 Thread Heikki Linnakangas
On 09/10/2024 22:55, Nathan Bossart wrote: In this message, I propose a multi-year, incremental approach to remove MD5 password support from Postgres. +1 2. In v19, allow upgrading with MD5 passwords and allow authenticating with them, but disallow creating new ones (i.e., restrict/r

Re: sunsetting md5 password support

2024-10-09 Thread Jacob Champion
On Wed, Oct 9, 2024 at 1:44 PM Jonathan S. Katz wrote: > On 10/9/24 3:55 PM, Nathan Bossart wrote: > > 1. In v18, continue to support MD5 passwords, but place several notes in > > the documentation and release notes that unambiguously indicate that > > MD5 password support is deprec

Re: Mathematical Functions and Operators

2024-10-09 Thread Marcos Pegoraro
Em qua., 9 de out. de 2024 às 18:23, David G. Johnston < david.g.johns...@gmail.com> escreveu: > > Replaceable means the user is expected to substitute an expression in that > location. One cannot specify a function name using an expression. > Sorry, I thought function parameters but said names.

Re: Mathematical Functions and Operators

2024-10-09 Thread David G. Johnston
On Wednesday, October 9, 2024, Marcos Pegoraro wrote: > > Shouldn't function names use too ? > Replaceable means the user is expected to substitute an expression in that location. One cannot specify a function name using an expression. David J.

Re: Mathematical Functions and Operators

2024-10-09 Thread Marcos Pegoraro
Em qua., 9 de out. de 2024 às 16:16, Marcos Pegoraro escreveu: > Exponentiation, Square root and Cube root operators are not formatted with > tag like others. > Paying more attention, there is no standard on any of those Comparison, String, Math, Date/Time and so on functions and operators tabl

Re: Pg17 Crash in Planning (Arrays + Casting + UDF)

2024-10-09 Thread Tom Lane
Nathan Bossart writes: > Do you mean something like this? > -else if (arrayexpr) > +else if (arrayexpr && root != NULL) > That'd at least be no worse than how it worked before > estimate_array_length() tried to use statistics, so that seems reasonable > to me. Yeah, exactly, just fall b

Re: Pg17 Crash in Planning (Arrays + Casting + UDF)

2024-10-09 Thread Nathan Bossart
On Wed, Oct 09, 2024 at 04:21:53PM -0400, Tom Lane wrote: > Paul Ramsey writes: >> This extremely odd case [2] came in via a report using a lot of PostGIS >> functions, but it can be reconfigured into a pure-PostgreSQL crasher >> [1]. > > Thanks for the report! Looks like estimate_array_length()

Re: sunsetting md5 password support

2024-10-09 Thread Jonathan S. Katz
On 10/9/24 3:55 PM, Nathan Bossart wrote: In this message, I propose a multi-year, incremental approach to remove MD5 password support from Postgres. +100; thanks for a concrete proposal. Cutting out the "well-understood" problems bit.> Given there is a battle-tested alternative to MD5, I pro

Re: sunsetting md5 password support

2024-10-09 Thread Greg Sabino Mullane
Big +1 to the idea, but it's not going to be pretty; there is a lot of baked-in MD5 stuff around. > 2. In v19, allow upgrading with MD5 passwords and allow authenticating > with them, but disallow creating new ones (i.e., restrict/remove > password_encryption and don't allow setting

Re: sunsetting md5 password support

2024-10-09 Thread Jelte Fennema-Nio
On Wed, 9 Oct 2024 at 21:55, Nathan Bossart wrote: > In this message, I propose a multi-year, incremental approach to remove MD5 > password support from Postgres. +many for the general idea I think it makes sense to also remove the "password" authentication option while we're at it (this can cur

Re: Pg17 Crash in Planning (Arrays + Casting + UDF)

2024-10-09 Thread Tom Lane
Paul Ramsey writes: > This extremely odd case [2] came in via a report using a lot of PostGIS > functions, but it can be reconfigured into a pure-PostgreSQL crasher [1]. Thanks for the report! Looks like estimate_array_length() is incautiously assuming that the "root" pointer it receives will n

Re: Pg17 Crash in Planning (Arrays + Casting + UDF)

2024-10-09 Thread Joe Conway
On 10/9/24 14:52, Paul Ramsey wrote: Hackers, This extremely odd case [2] came in via a report using a lot of PostGIS functions, but it can be reconfigured into a pure-PostgreSQL crasher [1]. CREATE TABLE n (i integer); CREATE OR REPLACE FUNCTION add(integer) RETURNS integer AS 'SEL

sunsetting md5 password support

2024-10-09 Thread Nathan Bossart
In this message, I propose a multi-year, incremental approach to remove MD5 password support from Postgres. The problems with MD5 password hashes in Postgres are well-understood, so I won't discuss them in too much detail here. But suffice it to say that MD5 has been considered to be unsuitable f

[PATCH] Move clause_sides_match_join() into pathnode.h

2024-10-09 Thread James Hunter
We had two almost-identical copies of the utility function clause_sides_match_join() -- one in joinpath.c, and one in analyzejoins.c. Both copies were marked "inline," so we might as well just move the (inline) function definition into a common header file. I chose pathnode.h, because it is already

Mathematical Functions and Operators

2024-10-09 Thread Marcos Pegoraro
Exponentiation, Square root and Cube root operators are not formatted with tag like others. https://www.postgresql.org/docs/current/functions-math.html regards Marcos patch.diff Description: Binary data

Re: [PATCH] Add some documentation on how to call internal functions

2024-10-09 Thread Florents Tselai
Here's a v2 - note on NULL args/returns - ref PointerGetDatum - used your example. Started adding some comments but don't think they're really necessary. The reader gets the point as-is I think. v2-0001-Add-some-documentation-on-how-to-call-internal-fu.patch Description: Binary data v2-0002-Add

Pg17 Crash in Planning (Arrays + Casting + UDF)

2024-10-09 Thread Paul Ramsey
Hackers, This extremely odd case [2] came in via a report using a lot of PostGIS functions, but it can be reconfigured into a pure-PostgreSQL crasher [1]. CREATE TABLE n (i integer); CREATE OR REPLACE FUNCTION add(integer) RETURNS integer AS 'SELECT 2 * $1 + 4 * $1' LANGUAGE 'sql' I

Re: Remove deprecated -H option from oid2name

2024-10-09 Thread Daniel Gustafsson
> On 9 Oct 2024, at 19:15, Nathan Bossart wrote: > Another problem is that "deprecated" may or may not imply that the feature > will be removed in the future. IMHO we should be clear about that when we > intend to remove something down the road (e.g., "this flag is deprecated > and will be remov

incorrect wal removal due to max_slot_wal_keep_size

2024-10-09 Thread Jeff Janes
I was testing logical replication over my (remarkably bad) wifi network to see what kind of throughput and lag I would get. I was using pgbench default transaction as the workload generator with all 4 tables being replicated. I had synchronous replication configured by synchronous_standby_names,

Re: Add contrib/pg_logicalsnapinspect

2024-10-09 Thread Masahiko Sawada
On Wed, Oct 9, 2024 at 1:12 AM Bertrand Drouvot wrote: > > Hi, > > On Tue, Oct 08, 2024 at 10:52:11AM -0700, Masahiko Sawada wrote: > > On Tue, Oct 8, 2024 at 9:25 AM Bertrand Drouvot > > wrote: > > > > Thank you for updating the patch! I have some comments on v12 patch: > > Thanks for looking at

Re: Remove deprecated -H option from oid2name

2024-10-09 Thread Nathan Bossart
On Wed, Oct 09, 2024 at 06:45:07PM +0200, Daniel Gustafsson wrote: >> On 9 Oct 2024, at 18:33, Nathan Bossart wrote: >> >> On Wed, Oct 09, 2024 at 10:08:31AM +0200, Daniel Gustafsson wrote: >>> The -H option to oid2name was deprecated in v12, and with v12 going out of >>> support it seems about t

Re: Pgoutput not capturing the generated columns

2024-10-09 Thread Masahiko Sawada
On Mon, Oct 7, 2024 at 11:07 PM Shubham Khanna wrote: > > On Fri, Oct 4, 2024 at 9:36 AM Peter Smith wrote: > > > > Hi Shubham, here are my review comments for v36-0001. > > > > == > > 1. General - merge patches > > > > It is long past due when patches 0001 and 0002 should've been merged. >

Re: Remove deprecated -H option from oid2name

2024-10-09 Thread Daniel Gustafsson
> On 9 Oct 2024, at 18:33, Nathan Bossart wrote: > > On Wed, Oct 09, 2024 at 10:08:31AM +0200, Daniel Gustafsson wrote: >> The -H option to oid2name was deprecated in v12, and with v12 going out of >> support it seems about time to remove it for v18. Not the most >> groundbreaking >> cleanup, b

Re: Remove deprecated -H option from oid2name

2024-10-09 Thread Nathan Bossart
On Wed, Oct 09, 2024 at 10:08:31AM +0200, Daniel Gustafsson wrote: > The -H option to oid2name was deprecated in v12, and with v12 going out of > support it seems about time to remove it for v18. Not the most groundbreaking > cleanup, but also no point in carrying it around for 5 more years. Seem

Re: Avoid possible overflow (src/port/bsearch_arg.c)

2024-10-09 Thread Ranier Vilela
Em ter., 8 de out. de 2024 às 18:28, Nathan Bossart < nathandboss...@gmail.com> escreveu: > On Tue, Oct 08, 2024 at 04:09:00PM -0300, Ranier Vilela wrote: > > The port function *bsearch_arg* mimics the C function > > *bsearch*. > > > > The API signature is: > > void * > > bsearch_arg(const void *k

Re: Should CSV parsing be stricter about mid-field quotes?

2024-10-09 Thread Andrew Dunstan
On 2024-10-09 We 11:58 AM, Tom Lane wrote: "Joel Jacobson" writes: I think it would be nicest to introduce a new "raw" FORMAT, that clearly get things right already at the top-level, instead of trying to customize any of the existing formats. FWIW, I like this idea. It makes it much clearer

Re: Should CSV parsing be stricter about mid-field quotes?

2024-10-09 Thread Tom Lane
"Joel Jacobson" writes: > I think it would be nicest to introduce a new "raw" FORMAT, > that clearly get things right already at the top-level, > instead of trying to customize any of the existing formats. FWIW, I like this idea. It makes it much clearer how to have a fast parsing path.

Re: Should CSV parsing be stricter about mid-field quotes?

2024-10-09 Thread Joel Jacobson
On Wed, Oct 9, 2024, at 14:45, Andrew Dunstan wrote: > On 2024-10-09 We 8:00 AM, Andrew Dunstan wrote: >> On 2024-10-08 Tu 3:25 AM, Joel Jacobson wrote: >>> 2b) Should we aim to only support the QUOTE NONE DELIMITER NONE >>> ESCAPE NONE case, >>> useful to the real-life scenario we've identified,

Re: general purpose array_sort

2024-10-09 Thread Junwang Zhao
On Wed, Oct 9, 2024 at 10:10 PM Junwang Zhao wrote: > > Hi Amit, > > On Thu, Oct 3, 2024 at 2:22 PM Amit Langote wrote: > > > > Hi Junwang, > > > > On Wed, Oct 2, 2024 at 11:46 PM Junwang Zhao wrote: > > > On Wed, Oct 2, 2024 at 9:51 AM jian he > > > wrote: > > > > > > > > > > > > > > > > + ty

Re: [PATCH] Check for TupleTableSlot nullness before dereferencing

2024-10-09 Thread Alexander Kuznetsov
03.10.2024 12:48, Daniel Gustafsson wrote: From a quick reading we can only reach there after evaluating an expression, so can it really be null though? This code hasn't changed all that much since 2009, if there was a reachable segfault on a null pointer deref I have a feeling we'd heard about

Re: \watch 0 or \watch 0.00001 doesn't do what I want

2024-10-09 Thread Tom Lane
Heikki Linnakangas writes: > This issue is present on newer versions still. Here's the problem: longsleep_ms = (long) (sleep * 1000); If "sleep" is less than 0.0005, sleep_ms rounds to zero, which results in the subsequent setitimer disarming rather than arming the interrupt

[PATCH] Refactor bytea_sortsupport()

2024-10-09 Thread Aleksander Alekseev
Hi, Tom (cc:'ed) recently pointed out [1] that adt/varlena.c uses common logic for sorting string types and bytea. There are several problems with this. Firstly, this is difficult to reason about. For instance, you have to keep in mind that when "C" locale is used you might be sorting not strings

Re: Use MAX_PARALLEL_WORKER_LIMIT consistently in guc_tables.c

2024-10-09 Thread Zhang Mingli
Hi, Zhang Mingli www.hashdata.xyz On Oct 9, 2024 at 20:35 +0800, Matthias van de Meent , wrote: > Hi, > > Whilst doing some digging in parallel code, I noticed that > max_parallel_maintenance_workers is registered as guc with a manual > value of 1024, while max_parallel_workers_per_gather uses >

Re: Allow default \watch interval in psql to be configured

2024-10-09 Thread Daniel Gustafsson
> On 9 Oct 2024, at 16:05, Heikki Linnakangas wrote: Thanks for looking! > I guess the '1000' was supposed to be the maximum, but ParseVariableDouble > doesn't take a maximum. Doh, I had a max parameter during hacking but removed it since I didn't see a clear usecase for it. Since it's not an

Re: general purpose array_sort

2024-10-09 Thread Junwang Zhao
Hi Amit, On Thu, Oct 3, 2024 at 2:22 PM Amit Langote wrote: > > Hi Junwang, > > On Wed, Oct 2, 2024 at 11:46 PM Junwang Zhao wrote: > > On Wed, Oct 2, 2024 at 9:51 AM jian he wrote: > > > > > > > > > > > > > + typentry = (TypeCacheEntry *) fcinfo->flinfo->fn_extra; > > > > > + if (typentry == N

Re: \watch 0 or \watch 0.00001 doesn't do what I want

2024-10-09 Thread Srinath Reddy Sadipiralla
On Wed, 09 Oct 2024 19:08:56 +0530 Heikki Linnakangas wrote ---   Then I tried setting the delay really small, but that didn't do what I wanted either: postgres=# \watch 0.1 Wed 09 Oct 2024 16:36:45 EEST (every 1e-05s) ?column? -- 1 (1 row) ^C It runs the quer

Re: Allow default \watch interval in psql to be configured

2024-10-09 Thread Heikki Linnakangas
On 09/10/2024 16:08, Daniel Gustafsson wrote: Scratching an old itch; I've long wanted to be able to set the default interval for \watch in psql since I almost never want a 2 second wait. The interval can of course be set by passing it to \watch but it's handy during testing and debugging to sav

Re: \watch 0 or \watch 0.00001 doesn't do what I want

2024-10-09 Thread Heikki Linnakangas
On 09/10/2024 16:38, Heikki Linnakangas wrote: Daniel's post [1] on \watch reminded me of this little issue I bumped into: I wanted to run a query in a tight loop, without any delay. I tried "\watch 0", but it didn't do what I wanted: postgres=# \watch 0 Correction: This changed in version

\watch 0 or \watch 0.00001 doesn't do what I want

2024-10-09 Thread Heikki Linnakangas
Daniel's post [1] on \watch reminded me of this little issue I bumped into: I wanted to run a query in a tight loop, without any delay. I tried "\watch 0", but it didn't do what I wanted: postgres=# \watch 0 Wed 09 Oct 2024 16:34:19 EEST (every 1s) ?column? -- 1 (1 row) Wed

Re: [PATCH] Add some documentation on how to call internal functions

2024-10-09 Thread Pavel Stehule
st 9. 10. 2024 v 14:39 odesílatel Florents Tselai napsal: > > > On 9 Oct 2024, at 2:57 PM, Pavel Stehule wrote: > > Hi > > I am checking this patch > > čt 12. 9. 2024 v 11:42 odesílatel Florents Tselai < > florents.tse...@gmail.com> napsal: > >> Hi, >> >> The documentation on extending using C f

Re: FOREIGN TABLE and IDENTITY columns

2024-10-09 Thread Julien Rouhaud
On Wed, 9 Oct 2024, 21:22 Ashutosh Bapat, wrote: > On Wed, Oct 9, 2024 at 4:22 AM Julien Rouhaud wrote: > > > > On Wed, Oct 9, 2024 at 12:40 AM Ashutosh Bapat > > wrote: > > > > > > On Tue, Oct 8, 2024 at 7:57 PM Julien Rouhaud > wrote: > > > > > > > > > > The rows inserted/udpated on the fore

Re: Inconsistent RestrictInfo serial numbers

2024-10-09 Thread Ashutosh Bapat
On Wed, Oct 9, 2024 at 7:45 AM Richard Guo wrote: > > On Tue, Oct 8, 2024 at 9:02 PM Ashutosh Bapat > wrote: > > But I don't see any relation specific information being > > considered while deciding whether the clause is constant false. > > Isn't rel->notnullattnums relation specific information?

Re: FOREIGN TABLE and IDENTITY columns

2024-10-09 Thread Ashutosh Bapat
On Wed, Oct 9, 2024 at 4:22 AM Julien Rouhaud wrote: > > On Wed, Oct 9, 2024 at 12:40 AM Ashutosh Bapat > wrote: > > > > On Tue, Oct 8, 2024 at 7:57 PM Julien Rouhaud wrote: > > > > > > Hi, > > > > > > I was looking at the CREATE FOREIGN TABLE documentation to see if IDENTITY > > > columns were

Re: NOT ENFORCED constraint feature

2024-10-09 Thread Andrew Dunstan
On 2024-10-09 We 5:14 AM, Joel Jacobson wrote: On Tue, Oct 8, 2024, at 11:06, Amul Sul wrote: The attached patch proposes adding the ability to define CHECK and FOREIGN KEY constraints as NOT ENFORCED. Thanks for working on this! Adding NOT ENFORCED to CHECK constraints is simple, see 0001 p

Allow default \watch interval in psql to be configured

2024-10-09 Thread Daniel Gustafsson
Scratching an old itch; I've long wanted to be able to set the default interval for \watch in psql since I almost never want a 2 second wait. The interval can of course be set by passing it to \watch but it's handy during testing and debugging to save that with just quick \watch. The attached add

Re: Should CSV parsing be stricter about mid-field quotes?

2024-10-09 Thread Andrew Dunstan
On 2024-10-09 We 8:00 AM, Andrew Dunstan wrote: On 2024-10-08 Tu 3:25 AM, Joel Jacobson wrote: On Sun, Oct 6, 2024, at 15:12, Andrew Dunstan wrote: On 2024-10-04 Fr 12:19 PM, Joel Jacobson wrote: 2. Avoid needing hacks like using E'\x01' as quoting char. Introduce QUOTE NONE and DELIMITER

Re: Proposal to Enable/Disable Index using ALTER INDEX

2024-10-09 Thread Robert Haas
On Wed, Oct 9, 2024 at 4:19 AM David Rowley wrote: > On Wed, 9 Oct 2024 at 20:07, Shayon Mukherjee wrote: > > [thinking…] Unless - we try to do support both a GUC and the ALTER INDEX > > ENABLE/DISABLE grammar + isdisabled attribute on pg_index? > > I just wanted to explain my point of view on t

Re: [PATCH] Add some documentation on how to call internal functions

2024-10-09 Thread Florents Tselai
> On 9 Oct 2024, at 2:57 PM, Pavel Stehule wrote: > > Hi > > I am checking this patch > > čt 12. 9. 2024 v 11:42 odesílatel Florents Tselai > napsal: >> Hi, >> >> The documentation on extending using C functions, >> leaves a blank on how to call other int

Use MAX_PARALLEL_WORKER_LIMIT consistently in guc_tables.c

2024-10-09 Thread Matthias van de Meent
Hi, Whilst doing some digging in parallel code, I noticed that max_parallel_maintenance_workers is registered as guc with a manual value of 1024, while max_parallel_workers_per_gather uses MAX_PARALLEL_WORKER_LIMIT (also 1024). After some archeology, the discrepancy seems to have existed ever sinc

Re: Should CSV parsing be stricter about mid-field quotes?

2024-10-09 Thread Andrew Dunstan
On 2024-10-08 Tu 3:25 AM, Joel Jacobson wrote: On Sun, Oct 6, 2024, at 15:12, Andrew Dunstan wrote: On 2024-10-04 Fr 12:19 PM, Joel Jacobson wrote: 2. Avoid needing hacks like using E'\x01' as quoting char. Introduce QUOTE NONE and DELIMITER NONE, to allow raw lines to be imported "as is" in

Re: [PATCH] Add some documentation on how to call internal functions

2024-10-09 Thread Pavel Stehule
Hi I am checking this patch čt 12. 9. 2024 v 11:42 odesílatel Florents Tselai napsal: > Hi, > > The documentation on extending using C functions, > leaves a blank on how to call other internal Postgres functions. > This can leave first-timers hanging. > > I think it’d be helpful to spend some p

Re: [PROPOSAL] : Disallow use of empty column name in (column_name '') in ALTER or CREATE of foreign table.

2024-10-09 Thread Nishant Sharma
On Mon, Oct 7, 2024 at 10:16 AM Michael Paquier wrote: > On Thu, Aug 22, 2024 at 04:00:13PM +0530, Nishant Sharma wrote: > > I may be wrong, but just wanted to share my thoughts on the differences. > > So, it > > can be considered a different issue/mistake and can be handled > separately in > > a

Re: overflow bug for inhcounts

2024-10-09 Thread Alvaro Herrera
On 2024-Oct-08, Tom Lane wrote: > Alvaro Herrera writes: > > ... This is because ColumnDef->inhcount is a 32-bit int, but > > Form_pg_attribute->attinhcount is int16, so we didn't break the overflow > > test for ColumnDef inhcount, but attinhcount has overflowed during > > assignment. > > Ugh ..

Re: Changing the state of data checksums in a running cluster

2024-10-09 Thread Tomas Vondra
On 10/8/24 22:38, Daniel Gustafsson wrote: > >> 7) controldata.c - maybe this >> >> if (oldctrl->data_checksum_version == 2) >> >> should use PG_DATA_CHECKSUM_INPROGRESS_ON_VERSION instead of the magic >> constant? For "off" we use "0" which seems somewhat acceptable, but for >> other values

Re: GUC names in messages

2024-10-09 Thread Michael Paquier
On Tue, Oct 08, 2024 at 06:57:10PM +1100, Peter Smith wrote: > As for what is left, I had made just the minimal patch to fix the > known "IntervalStyle" problem, but that assumed prior knowledge of > what were the only problem names in the first place. Your way is > better -- to always use the reco

Re: pgindent fails with perl 5.40

2024-10-09 Thread Erik Wienhold
On 2024-10-09 09:52 +0200, Daniel Gustafsson wrote: > Done, thanks for the report! Thanks for pushing! -- Erik

Re: POC, WIP: OR-clause support for indexes

2024-10-09 Thread Andrei Lepikhov
On 10/4/24 20:34, Robert Haas wrote: On Mon, Sep 23, 2024 at 7:11 AM Alexander Korotkov wrote: Makes sense. Please, check the attached patch freeing the consts list while returning NULL from match_orclause_to_indexcol(). More generally, many of the comments in this patch seem to just explain

Re: Pgoutput not capturing the generated columns

2024-10-09 Thread vignesh C
On Tue, 8 Oct 2024 at 11:37, Shubham Khanna wrote: > > On Fri, Oct 4, 2024 at 9:36 AM Peter Smith wrote: > > > > Hi Shubham, here are my review comments for v36-0001. > > > > == > > 1. General - merge patches > > > > It is long past due when patches 0001 and 0002 should've been merged. > > A

Re: NOT ENFORCED constraint feature

2024-10-09 Thread Joel Jacobson
On Tue, Oct 8, 2024, at 11:06, Amul Sul wrote: > The attached patch proposes adding the ability to define CHECK and > FOREIGN KEY constraints as NOT ENFORCED. Thanks for working on this! > Adding NOT ENFORCED to CHECK constraints is simple, see 0001 patch, I've looked at the 0001 patch and think

Re: Proposal to Enable/Disable Index using ALTER INDEX

2024-10-09 Thread David Rowley
On Wed, 9 Oct 2024 at 20:07, Shayon Mukherjee wrote: > [thinking…] Unless - we try to do support both a GUC and the ALTER INDEX > ENABLE/DISABLE grammar + isdisabled attribute on pg_index? I just wanted to explain my point of view on this. This is my opinion and is by no means authoritative. I

Re: Add contrib/pg_logicalsnapinspect

2024-10-09 Thread Bertrand Drouvot
Hi, On Tue, Oct 08, 2024 at 10:52:11AM -0700, Masahiko Sawada wrote: > On Tue, Oct 8, 2024 at 9:25 AM Bertrand Drouvot > wrote: > > Thank you for updating the patch! I have some comments on v12 patch: Thanks for looking at it! > --- > + if (ondisk.builder.committed.xcnt > 0) > + {

Remove deprecated -H option from oid2name

2024-10-09 Thread Daniel Gustafsson
The -H option to oid2name was deprecated in v12, and with v12 going out of support it seems about time to remove it for v18. Not the most groundbreaking cleanup, but also no point in carrying it around for 5 more years. -- Daniel Gustafsson v1-0001-Remove-depracated-H-option-for-host.patch Des

Re: Add contrib/pg_logicalsnapinspect

2024-10-09 Thread Bertrand Drouvot
Hi, On Wed, Oct 09, 2024 at 11:41:44AM +1100, Peter Smith wrote: > On Wed, Oct 9, 2024 at 3:25 AM Bertrand Drouvot > wrote: > > > > I don't get the point here. The examples just show another way to use the > > functions, > > the ouput is more "anecdotal" than anything else. > > > > How about do

Re: pgindent fails with perl 5.40

2024-10-09 Thread Daniel Gustafsson
> On 8 Oct 2024, at 22:56, Daniel Gustafsson wrote: > >> On 8 Oct 2024, at 22:24, Andrew Dunstan wrote: >> The patch looks fine, and should be backpatched. Looks like this is a 12 >> year old thinko. AFAICT File::Spec doesn't export anything. > > Thanks for confirming, I'll go do that in the

Re: Fix orphaned 2pc file which may casue instance restart failed

2024-10-09 Thread ChengWen Wu
Hi Michael, Is there any progress about this problem? I could give more detailed information if you need. Best wishes, Chengwen Wu -- Original -- From:

Remove an unnecessary check on semijoin_target_ok() on postgres_fdw.c

2024-10-09 Thread Tender Wang
Hi, When I debug FDW join pushdown codes, I found below codes in semijoin_target_ok(): if (bms_is_member(var->varno, innerrel->relids) && !bms_is_member(var->varno, outerrel->relids)) As far as I know, if a var belongs to the innerrel of joinrel, it's not possible that it may belong

Re: Proposal to Enable/Disable Index using ALTER INDEX

2024-10-09 Thread Shayon Mukherjee
> On Oct 7, 2024, at 4:52 PM, Robert Haas wrote: > > On Mon, Sep 23, 2024 at 11:14 AM Peter Eisentraut > wrote: >> I think a better approach would be to make the list of disabled indexes >> a GUC setting, which would then internally have an effect similar to >> enable_indexscan, meaning it w