Re: Avoid overflow with simplehash

2023-07-06 Thread Ranier Vilela
Em qui., 6 de jul. de 2023 às 12:00, Daniel Gustafsson escreveu: > > On 6 Jul 2023, at 16:42, Ranier Vilela wrote: > > Em qui., 6 de jul. de 2023 às 11:37, Daniel Gustafsson > escreveu: > > > #define SH_MAX_SIZE (((uint64) PG_UINT32_MAX) + 1) > > This is Assert, that

Re: Avoid overflow with simplehash

2023-07-06 Thread Tom Lane
Ranier Vilela writes: > See the comments: > "Search for the first empty element." > If the empty element is not found, startelem has PG_UINT64_MAX value, > which do not fit in uint32. I think the point of that assertion is exactly that we're required to have an empty element (because max

Re: Problems with estimating OR conditions, IS NULL on LEFT JOINs

2023-07-06 Thread Tomas Vondra
On 7/6/23 15:51, Alena Rybakina wrote: > Hi, all! > > On 26.06.2023 12:22, Andrey Lepikhov wrote: >> On 24/6/2023 17:23, Tomas Vondra wrote: >>> I really hope what I just wrote makes at least a little bit of sense. >> Throw in one more example: >> >> SELECT i AS id INTO l FROM

Re: Avoid overflow with simplehash

2023-07-06 Thread Tom Lane
Andres Freund writes: > On 2023-07-06 11:16:26 -0400, Tom Lane wrote: >> It does seem like we could do >> uint64 startelem = SH_MAX_SIZE; >> ... >> Assert(startelem < SH_MAX_SIZE); >> which'd make it a little clearer that the expectation is for >> startelem to have changed

Re: [PATCH] Add support function for containment operators

2023-07-06 Thread Laurenz Albe
On Sat, 2023-04-29 at 17:07 +0200, Kim Johan Andersson wrote: > I had noticed that performance wasn't great when using the @> or <@ > operators when examining if an element is contained in a range. > Based on the discussion in [1] I would like to suggest the following > changes: > > This patch

Re: Avoid overflow with simplehash

2023-07-06 Thread Andres Freund
Hi, On 2023-07-06 13:40:00 -0300, Ranier Vilela wrote: > I still have doubts about this. > > see: > #include > #include > #include > > #define SH_MAX_SIZE1 (((unsigned long long) 0xU) + 1) > #define SH_MAX_SIZE2 (((unsigned long long) 0xU) - 1) > > int main() > { >

Avoid overflow with simplehash

2023-07-06 Thread Ranier Vilela
Hi, SimpleHash. The function SH_START_ITERATE can trigger some overflow. See: typedef struct SH_ITERATOR { uint32 cur; /* current element */ uint32 end; bool done; /* iterator exhausted? */ } SH_ITERATOR; The cur field is uint32 size and currently can be stored a uint64, which obviously does

Re: Avoid overflow with simplehash

2023-07-06 Thread Daniel Gustafsson
> On 6 Jul 2023, at 16:28, Ranier Vilela wrote: > The function SH_START_ITERATE can trigger some overflow. > > See: > typedef struct SH_ITERATOR > { > uint32 cur; /* current element */ > uint32 end; > bool done; /* iterator exhausted? */ > } SH_ITERATOR; > > The cur field is uint32 size and

Re: Does a cancelled REINDEX CONCURRENTLY need to be messy?

2023-07-06 Thread Peter Eisentraut
On 03.07.23 19:46, Álvaro Herrera wrote: Well, I definitely agree that it would be useful to have*something* that automatically removes debris Yeah, like "undo".

Re: MERGE ... RETURNING

2023-07-06 Thread Gurjeet Singh
On Thu, Jul 6, 2023 at 3:39 AM Alvaro Herrera wrote: > > On 2023-Jul-05, Gurjeet Singh wrote: > > I expected the .out file to have captured the stdout. I'm gradually, > > and gladly, re-learning bits of the test infrastructure. > > > > The DELETE command tag in the output does not feel

Re: UUID v7

2023-07-06 Thread Matthias van de Meent
On Thu, 6 Jul 2023 at 14:24, Daniel Gustafsson wrote: > > > On 22 Jun 2023, at 20:30, Nikolay Samokhvalov wrote: > > > Some small updates as I see them: > > - there is revision 7 now in https://github.com/ietf-wg-uuidrev/rfc4122bis > > - noticing that there is no commitfest record, I created

Re: [PATCH] psql: Add tab-complete for optional view parameters

2023-07-06 Thread Daniel Gustafsson
> On 29 Jan 2023, at 11:19, Mikhail Gribkov wrote: > The new status of this patch is: Waiting on Author This patch has been Waiting on Author since January with the thread being stale, so I am marking this as Returned with Feedback for now. Please feel free to resubmit to a future CF when

Re: Problems with estimating OR conditions, IS NULL on LEFT JOINs

2023-07-06 Thread Alena Rybakina
Hi, all! On 26.06.2023 12:22, Andrey Lepikhov wrote: On 24/6/2023 17:23, Tomas Vondra wrote: I really hope what I just wrote makes at least a little bit of sense. Throw in one more example: SELECT i AS id INTO l FROM generate_series(1,10) i; CREATE TABLE r (id int8, v text); INSERT INTO

Re: pg_basebackup check vs Windows file path limits

2023-07-06 Thread Daniel Gustafsson
> On 5 Jul 2023, at 14:49, Andrew Dunstan wrote: > On 2023-07-04 Tu 16:54, Daniel Gustafsson wrote: >>> On 4 Jul 2023, at 20:19, Andrew Dunstan >>> wrote: >>> >>> But sadly we're kinda back where we started. fairywren is failing on >>> REL_16_STABLE. Before the changes the failure occurred

Re: [PATCH] Add GitLab CI to PostgreSQL

2023-07-06 Thread Peter Eisentraut
On 06.07.23 13:32, Andrew Dunstan wrote: This seems very RedHat-centric, which I'm not sure is a good idea. Also, shouldn't at least some of these recipes call dnf and dnf-builddep instead of yum and yum-build-dep? I don't think it's bad to add an automated test suite for redhat-based images?

Re: pgsql: Fix search_path to a safe value during maintenance operations.

2023-07-06 Thread Nathan Bossart
On Thu, Jul 06, 2023 at 12:55:14AM -0700, Jeff Davis wrote: > It was difficult to review standalone, so I tried a quick version > myself and ended up with very similar results. Thanks for taking a look. > The only substantial > difference was that I put back: > > > + if

Re: Reducing connection overhead in pg_upgrade compat check phase

2023-07-06 Thread Daniel Gustafsson
> On 4 Jul 2023, at 21:08, Nathan Bossart wrote: > > I put together a rebased version of the patch for cfbot. Thanks for doing that, much appreciated! I was busy looking at other peoples patches and hadn't gotten to my own yet =) > On 13 Mar 2023, at 19:21, Nathan Bossart wrote: > I noticed

Re: UUID v7

2023-07-06 Thread Daniel Gustafsson
> On 22 Jun 2023, at 20:30, Nikolay Samokhvalov wrote: > Some small updates as I see them: > - there is revision 7 now in https://github.com/ietf-wg-uuidrev/rfc4122bis > - noticing that there is no commitfest record, I created one: I will actually go ahead and close this entry in the current

Re: Parallel CREATE INDEX for BRIN indexes

2023-07-06 Thread Tomas Vondra
On 7/5/23 16:33, Matthias van de Meent wrote: > ... > >> Maybe. I wasn't that familiar with what parallel tuplesort can and can't >> do, and the little I knew I managed to forget since I wrote this patch. >> Which similar features do you have in mind? > > I was referring to the feature that is

Re: [PATCH] Add support function for containment operators

2023-07-06 Thread Kim Johan Andersson
Any thoughts on this change?

Commitfest 2023-07 has started

2023-07-06 Thread Daniel Gustafsson
We are now a few days in on Commitfest 2023-07, so it seems about time to send the (by now) customary statistics email on how we are doing, and where we ideally want go. There are 350 patches registered in this commitfest, with 150 of those having been moved from the past commitfest. If it's not

Re: pg_recvlogical prints bogus error when interrupted

2023-07-06 Thread Tristan Partin
On Thu Apr 27, 2023 at 12:54 AM CDT, Bharath Rupireddy wrote: > Thanks for reviewing. I removed the (void) casts like elsewhere in the > code, however, I didn't change such casts in prepareToTerminate() to > not create a diff. > > I'm attaching the v4 patch for further review. Bharath, I signed

Re: pg_basebackup check vs Windows file path limits

2023-07-06 Thread Andrew Dunstan
On 2023-07-06 Th 09:50, Daniel Gustafsson wrote: On 5 Jul 2023, at 14:49, Andrew Dunstan wrote: On 2023-07-04 Tu 16:54, Daniel Gustafsson wrote: On 4 Jul 2023, at 20:19, Andrew Dunstan wrote: But sadly we're kinda back where we started. fairywren is failing on REL_16_STABLE. Before the

Re: UUID v7

2023-07-06 Thread Peter Eisentraut
On 06.07.23 16:02, Tom Lane wrote: Daniel Gustafsson writes: On 6 Jul 2023, at 15:29, Matthias van de Meent wrote: Sure, it's earlier than the actual release of the standard, but that wasn't a blocker for SQL features that were considered finalized either. I can't speak for any SQL

Re: MERGE ... RETURNING

2023-07-06 Thread Gurjeet Singh
On Thu, Jul 6, 2023 at 4:07 AM jian he wrote: > > On Thu, Jul 6, 2023 at 1:13 PM Gurjeet Singh wrote: > > I think the name of function pg_merge_when_clause() can be improved. > > How about pg_merge_when_clause_ordinal(). > > another idea: pg_merge_action_ordinal() Since there can be many

Re: UUID v7

2023-07-06 Thread Tom Lane
Daniel Gustafsson writes: > On 6 Jul 2023, at 15:29, Matthias van de Meent > wrote: >> Sure, it's earlier than the actual release of >> the standard, but that wasn't a blocker for SQL features that were >> considered finalized either. > I can't speak for any SQL standard features we've

Re: Avoid overflow with simplehash

2023-07-06 Thread Ranier Vilela
Em qui., 6 de jul. de 2023 às 11:37, Daniel Gustafsson escreveu: > > On 6 Jul 2023, at 16:28, Ranier Vilela wrote: > > > The function SH_START_ITERATE can trigger some overflow. > > > > See: > > typedef struct SH_ITERATOR > > { > > uint32 cur; /* current element */ > > uint32 end; > > bool

Re: Example Table AM implementation

2023-07-06 Thread Hannu Krosing
Thanks a lot Mark, I will take a look at this and get back to you if I find anything unclear --- Hannu On Tue, Jul 4, 2023 at 10:14 PM Mark Dilger wrote: > > Hackers, > > Over in [1], Hannu Krosing asked me to create and post several Table Access > Methods for testing/example purposes. I am

Re: Avoid overflow with simplehash

2023-07-06 Thread Ranier Vilela
Em qui., 6 de jul. de 2023 às 13:52, Andres Freund escreveu: > Hi, > > On 2023-07-06 13:40:00 -0300, Ranier Vilela wrote: > > I still have doubts about this. > > > > see: > > #include > > #include > > #include > > > > #define SH_MAX_SIZE1 (((unsigned long long) 0xU) + 1) > > #define

Re: Add more sanity checks around callers of changeDependencyFor()

2023-07-06 Thread Andres Freund
Hi, On 2023-07-05 14:10:42 +0900, Michael Paquier wrote: > On Tue, Jul 04, 2023 at 02:40:04PM -0400, Tom Lane wrote: > > Alvaro Herrera writes: > >> Hmm, shouldn't we disallow moving the function to another schema, if the > >> function's schema was originally determined at extension creation

Re: Avoid overflow with simplehash

2023-07-06 Thread Andres Freund
Hi, I pushed changing i to uint32 and adding Tom's comment to 11-HEAD. On 2023-07-06 14:01:55 -0300, Ranier Vilela wrote: > > > then will it iterate forwards? > > > > No, it'd still iterate backwards, but starting from the wrong place - but > > there is no correct place to start iterating from

Re: UUID v7

2023-07-06 Thread Daniel Gustafsson
> On 6 Jul 2023, at 15:29, Matthias van de Meent > wrote: > > On Thu, 6 Jul 2023 at 14:24, Daniel Gustafsson wrote: >> >>> On 22 Jun 2023, at 20:30, Nikolay Samokhvalov wrote: >> >>> Some small updates as I see them: >>> - there is revision 7 now in

Re: Avoid unused value (src/fe_utils/print.c)

2023-07-06 Thread Karina Litskevich
> > > >> But >> it's not obvious, so I also have doubts about removing this line. If >> someday >> print options are changed, for example to support printing footers and not >> printing headers, or anything else changes in this function, the output >> might >> be unexpected with this line removed.

Re: pgindent vs. pgperltidy command-line arguments

2023-07-06 Thread Andrew Dunstan
On 2023-06-21 We 07:35, Andrew Dunstan wrote: On 2023-06-21 We 05:09, Peter Eisentraut wrote: On 20.06.23 17:38, Andrew Dunstan wrote: +1, although I wonder if we shouldn't follow pgindent's new lead and require some argument(s). That makes sense to me.  Here is a small update with this

Re: Add SPLIT PARTITION/MERGE PARTITIONS commands

2023-07-06 Thread Daniel Gustafsson
This patch no longer applies to master, please submit a rebased version to the thread. I've marked the CF entry as waiting for author in the meantime. -- Daniel Gustafsson

Re: check_strxfrm_bug()

2023-07-06 Thread Peter Eisentraut
On 05.07.23 00:15, Thomas Munro wrote: On Tue, Jul 4, 2023 at 2:52 AM Tristan Partin wrote: The patch looks good to me as well. Happy to rebase my other patch on this one. Thanks. Here is a slightly tidier version. It passes on CI[1] including the optional extra MinGW64/Meson task, and the

Re: Fix last unitialized memory warning

2023-07-06 Thread Tristan Partin
On Thu Jul 6, 2023 at 3:21 AM CDT, Peter Eisentraut wrote: > On 05.07.23 23:06, Tristan Partin wrote: > > Thanks for following up. My system is Fedora 38. I can confirm this is > > still happening on master. > > > > $ gcc --version > > gcc (GCC) 13.1.1 20230614 (Red Hat 13.1.1-4) > > Copyright

Re: Avoid overflow with simplehash

2023-07-06 Thread Daniel Gustafsson
> On 6 Jul 2023, at 16:42, Ranier Vilela wrote: > Em qui., 6 de jul. de 2023 às 11:37, Daniel Gustafsson > escreveu: > #define SH_MAX_SIZE (((uint64) PG_UINT32_MAX) + 1) > This is Assert, that is, in production this test is not done. Correct, which implies that it's a

Re: [Patch] Use *other* indexes on the subscriber when REPLICA IDENTITY is FULL

2023-07-06 Thread Önder Kalacı
Hi Hayato, > BTW, I have doubt that the restriction is not related with your commit. > In other words, if the table has attributes which the datatype is not for > operator > class of Btree, we could not use REPLICA IDENTITY FULL. IIUC it is not > documented. > Please see attched script to

Re: Avoid overflow with simplehash

2023-07-06 Thread Andres Freund
Hi, On 2023-07-06 11:16:26 -0400, Tom Lane wrote: > Ranier Vilela writes: > > See the comments: > > "Search for the first empty element." > > If the empty element is not found, startelem has PG_UINT64_MAX value, > > which do not fit in uint32. > > I think the point of that assertion is exactly

Re: Avoid overflow with simplehash

2023-07-06 Thread Ranier Vilela
Em qui., 6 de jul. de 2023 às 12:16, Tom Lane escreveu: > Ranier Vilela writes: > > See the comments: > > "Search for the first empty element." > > If the empty element is not found, startelem has PG_UINT64_MAX value, > > which do not fit in uint32. > > Hi Tom, > I think the point of that

Re: Add more sanity checks around callers of changeDependencyFor()

2023-07-06 Thread Peter Eisentraut
On 29.06.23 01:36, Michael Paquier wrote: While working on a different patch, I have noted three code paths that call changeDependencyFor() but don't check that they do not return errors. In all the three cases (support function, extension/schema and object/schema), it seems to me that only one

Re: [PoC] Federated Authn/z with OAUTHBEARER

2023-07-06 Thread Jacob Champion
On Wed, Jul 5, 2023 at 3:07 PM Thomas Munro wrote: > I guess there are a couple of ways to do it if we give up the goal of > no-code-change-for-the-client: > > 1. Generalised PQsocket(), that so that a client can call something like: > > int PQpollset(const PGConn *conn, struct pollfd fds[], int

Re: [PATCH] Add support function for containment operators

2023-07-06 Thread Laurenz Albe
> On Sat, 2023-04-29 at 17:07 +0200, Kim Johan Andersson wrote: > > I had noticed that performance wasn't great when using the @> or <@ > > operators when examining if an element is contained in a range. > > Based on the discussion in [1] I would like to suggest the following > > changes: > > >

Re: Fix last unitialized memory warning

2023-07-06 Thread Andres Freund
Hi, On 2023-07-06 10:21:44 +0200, Peter Eisentraut wrote: > On 05.07.23 23:06, Tristan Partin wrote: > > Thanks for following up. My system is Fedora 38. I can confirm this is > > still happening on master. > > > > $ gcc --version > > gcc (GCC) 13.1.1 20230614 (Red Hat 13.1.1-4) > > Copyright

Re: HOT readme missing documentation on summarizing index handling

2023-07-06 Thread Tomas Vondra
Yeah, README.HOT should have been updated, and I see no reason not to backpatch this to v16. Barring objections, I'll do that tomorrow. I have two suggesting regarding the README.HOT changes: 1) I'm not entirely sure it's very clear what "referential integrity of indexes across tuple updates"

Re: Avoid overflow with simplehash

2023-07-06 Thread Ranier Vilela
Em qui., 6 de jul. de 2023 às 14:33, Andres Freund escreveu: > Hi, > > I pushed changing i to uint32 and adding Tom's comment to 11-HEAD. > Thank you. regards, Ranier Vilela

Re: Avoid unncessary always true test (src/backend/storage/buffer/bufmgr.c)

2023-07-06 Thread Gurjeet Singh
On Thu, Jul 6, 2023 at 8:01 AM Karina Litskevich wrote: > > >> EB_SMGR and EB_REL are macros for making new structs. >> IMO these are buggy, once make new structs without initializing all fields. >> Attached a patch to fix this and make more clear when rel or smgr is NULL. > > > As long as a

Re: doc: improve the restriction description of using indexes on REPLICA IDENTITY FULL table.

2023-07-06 Thread Peter Smith
Hi, Here are my review comments for patch v2. == 1. doc/src/sgml/logical-replication.sgml Candidate indexes must be btree, non-partial, and have at least one column reference to the published table column at the leftmost column (i.e. cannot consist of only expressions). ~ There is only one

Re: [PATCH] Add GitLab CI to PostgreSQL

2023-07-06 Thread Gurjeet Singh
On Wed, Jul 5, 2023 at 6:22 AM Andrew Dunstan wrote: > > > On 2023-07-04 Tu 19:44, Newhouse, Robin wrote: > > Hello! > > > > I propose the attached patch to be applied on the 'master' branch > > of PostgreSQL to add GitLab CI automation alongside Cirrus CI in the > PostgreSQL repository. > > > >

Re: [PATCH] Add GitLab CI to PostgreSQL

2023-07-06 Thread Daniel Gustafsson
> On 6 Jul 2023, at 20:10, Gurjeet Singh wrote: > I can > imagine if cfbot was developed against some other CI, it's very likely > that we'd be using that other CI instead of Cirrus. The CFBot originally used Travis, but switched in late 2020 when Travis almost over night become hard to use for

Re: Avoid unncessary always true test (src/backend/storage/buffer/bufmgr.c)

2023-07-06 Thread Ranier Vilela
Em qui., 6 de jul. de 2023 às 16:06, Gurjeet Singh escreveu: > On Thu, Jul 6, 2023 at 8:01 AM Karina Litskevich > wrote: > > > > > >> EB_SMGR and EB_REL are macros for making new structs. > >> IMO these are buggy, once make new structs without initializing all > fields. > >> Attached a patch to

Clean up some signal usage mainly related to Windows

2023-07-06 Thread Tristan Partin
Windows has support for some signals[0], like SIGTERM and SIGINT. SIGINT must be handled with care on Windows since it is handled in a separate thread. SIGTERM however can be handled in a similar way to UNIX-like systems. I audited a few pqsignal calls that were blocked by WIN32 to see if they

Re: warn if GUC set to an invalid shared library

2023-07-06 Thread Justin Pryzby
On Sat, Oct 29, 2022 at 10:40 AM Justin Pryzby wrote: > > > > On Fri, Sep 02, 2022 at 05:24:58PM -0500, Justin Pryzby wrote: > > > > > It caused no issue when I changed: > > > > > > > > > > /* Check that it's acceptable for the > > > > > indicated parameter */ > > > > >

Re: EBCDIC sorting as a use case for ICU rules

2023-07-06 Thread Jeff Davis
On Thu, 2023-07-06 at 11:32 +0200, Peter Eisentraut wrote: > CREATE COLLATION ebcdic (provider='icu', locale='und', > rules=$$ > & ' ' < '.' < '<' < '(' < '+' < \| > < '&' < '!' < '$' < '*' < ')' < ';' > < '-' < '/' < ',' < '%' < '_' < '>' < '?' > < '`' < ':' < '#' < '@' < \' < '=' < '"' > < a < b

Re: [PoC] Federated Authn/z with OAUTHBEARER

2023-07-06 Thread Thomas Munro
On Fri, Jul 7, 2023 at 4:57 AM Jacob Champion wrote: > On Wed, Jul 5, 2023 at 3:07 PM Thomas Munro wrote: > > 2. Convert those events into new libpq events like 'I want you to > > call me back in 100ms', and 'call me back when socket #42 has data', > > and let clients handle that by managing

Re: [PATCH] Add GitLab CI to PostgreSQL

2023-07-06 Thread Gurjeet Singh
On Thu, Jul 6, 2023 at 11:27 AM Daniel Gustafsson wrote: > > > On 6 Jul 2023, at 20:10, Gurjeet Singh wrote: > > > I can > > imagine if cfbot was developed against some other CI, it's very likely > > that we'd be using that other CI instead of Cirrus. > > The CFBot originally used Travis, but

Re: Disabling Heap-Only Tuples

2023-07-06 Thread Matthias van de Meent
On Wed, 5 Jul 2023 at 19:55, Thom Brown wrote: > > On Wed, 5 Jul 2023 at 18:05, Matthias van de Meent > wrote: > > So what were you thinking of? A session GUC? A table option? > > Both. Here's a small patch implementing a new table option max_local_update (name very much bikesheddable). Value

Re: Autogenerate some wait events code and documentation

2023-07-06 Thread Andres Freund
Hi, On 2023-07-06 09:36:12 +0900, Michael Paquier wrote: > On Wed, Jul 05, 2023 at 02:59:39PM -0700, Andres Freund wrote: > > Rebasing a patch over this I was a bit confused because I got a bunch of > > ""unable to parse wait_event_names.txt" errors. Took me a while to figure > > out > > that

Re: Fix search_path for all maintenance commands

2023-07-06 Thread Jeff Davis
On Fri, 2023-05-26 at 16:21 -0700, Jeff Davis wrote: > Maintenance commands (ANALYZE, CLUSTER, REFRESH MATERIALIZED VIEW, > REINDEX, and VACUUM) currently run as the table owner, and as a > SECURITY_RESTRICTED_OPERATION. > > I propose that we also fix the search_path to "pg_catalog, pg_temp" >

Re: [PATCH] Add GitLab CI to PostgreSQL

2023-07-06 Thread Andres Freund
Hi, On 2023-07-04 23:44:45 +, Newhouse, Robin wrote: > I propose the attached patch to be applied on the 'master' branch > of PostgreSQL to add GitLab CI automation alongside Cirrus CI in the > PostgreSQL repository. > > It is not intended to be a replacement for Cirrus CI, but simply

Re: Setting restrictedtoken in pg_regress

2023-07-06 Thread Daniel Gustafsson
> On 14 Jun 2023, at 13:02, Andrew Dunstan wrote: > On 2023-06-12 Mo 19:43, Nathan Bossart wrote: >> On Tue, Jun 13, 2023 at 08:29:19AM +0900, Michael Paquier wrote: >> >>> I am actually a bit confused with the return value of >>> CreateRestrictedProcess() on failures in restricted_token.c.

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

2023-07-06 Thread Andrey Lepikhov
On 6/7/2023 03:06, Alena Rybakina wrote: The test was performed on the same benchmark database generated by 2 billion values. I corrected this constant in the patch. In attempt to resolve some issues had mentioned in my previous letter I used op_mergejoinable to detect mergejoinability of a

Add hint message for check_log_destination()

2023-07-06 Thread Japin Li
Hi, hackers When I try to change log_destination using ALTER SYSTEM with the wrong value, it complains of the "Unrecognized key word" without available values. This patch tries to add a hint message that provides available values for log_destination. Any thoughts? -- Regrads, Japin Li.

Re: Autogenerate some wait events code and documentation

2023-07-06 Thread Michael Paquier
On Thu, Jul 06, 2023 at 06:19:43PM -0700, Andres Freund wrote: > On 2023-07-06 09:36:12 +0900, Michael Paquier wrote: >> So you mean renaming the existing events like WalSenderWaitForWAL to >> WalSenderWaitForWal? > > Yes. > >> The impact on existing monitoring queries is not zero because any

Re: pgsql: Fix search_path to a safe value during maintenance operations.

2023-07-06 Thread Nathan Bossart
Here is a new version of the patch that I think is ready for commit (except it still needs a catversion bump). The only real difference from v1 is in AdjustUpgrade.pm. From my cross-version pg_upgrade testing, I believe we can remove the other "privilege-set discrepancy" rule as well. Since

Re: Fix search_path for all maintenance commands

2023-07-06 Thread Isaac Morland
On Thu, 6 Jul 2023 at 21:39, Jeff Davis wrote: I apologize in advance if anything I’ve written below is either too obvious or too crazy or misinformed to belong here. I hope I have something to say that is on point, but feel unsure what makes sense to say. * It might break for users who have a

Re: RFC: pg_stat_logmsg

2023-07-06 Thread Gurjeet Singh
On Thu, Jul 6, 2023 at 12:37 AM Masahiko Sawada wrote: > On Sat, Jul 1, 2023 at 8:57 AM Joe Conway wrote: > > > > The basic idea is to mirror how pg_stat_statements works, except the > > logged messages keyed by filename, lineno, and elevel are saved with a > > aggregate count. The format string

Re: Disabling Heap-Only Tuples

2023-07-06 Thread Dilip Kumar
On Fri, Jul 7, 2023 at 1:48 AM Matthias van de Meent wrote: > > On Wed, 5 Jul 2023 at 19:55, Thom Brown wrote: > > > > On Wed, 5 Jul 2023 at 18:05, Matthias van de Meent > > wrote: > > > So what were you thinking of? A session GUC? A table option? > > > > Both. > > Here's a small patch

Re: Improve logging when using Huge Pages

2023-07-06 Thread Michael Paquier
On Fri, Jun 23, 2023 at 01:57:51PM +0900, Michael Paquier wrote: > I could not resist adding two checks in the TAP tests to make sure > that we don't report unknown. Perhaps that's not necessary, but that > would provide coverage in a more broader way, and these are cheap. > > I have run one

Re: RFC: pg_stat_logmsg

2023-07-06 Thread Masahiko Sawada
Hi, On Sat, Jul 1, 2023 at 8:57 AM Joe Conway wrote: > > Greetings, > > Attached please find a tarball (rather than a patch) for a proposed new > contrib extension, pg_stat_logmsg. > > The basic idea is to mirror how pg_stat_statements works, except the > logged messages keyed by filename,

Re: Add estimated hit ratio to Memoize in EXPLAIN to explain cost adjustment

2023-07-06 Thread Daniel Gustafsson
> On 7 Mar 2023, at 10:51, David Rowley wrote: > > On Sun, 5 Mar 2023 at 13:21, Lukas Fittl wrote: >> Alternatively (or in addition) we could consider showing the "ndistinct" >> value that is calculated in cost_memoize_rescan - since that's the most >> significant contributor to the cache hit

Re: Exclusion constraints on partitioned tables

2023-07-06 Thread Peter Eisentraut
On 17.03.23 17:03, Paul Jungwirth wrote: Thank you for taking a look! I did some research on the history of the code here, and I think I understand Tom's concern about making sure the index uses the same equality operator as the partition. I was confused about his remarks about the opfamily,

Re: SQL:2011 application time

2023-07-06 Thread Peter Eisentraut
On 04.07.23 14:48, Daniel Gustafsson wrote: On 8 May 2023, at 09:10, Peter Eisentraut wrote: On 03.05.23 23:02, Paul Jungwirth wrote: Thank you again for the review. Here is a patch with most of your feedback addressed. Sorry it has taken so long! These patches are rebased up to

Re: [PATCH] ltree hash functions

2023-07-06 Thread Daniel Gustafsson
> On 19 Jun 2023, at 11:18, Tommy Pavlicek wrote: > Tommy, are you interested in extending ALTER OPERATOR to allow this, > which would also allow fixing the ltree operator? > > Yes, I can do that. I took a look over the code and email thread and it seems > like it should be relatively straight

Re: Fix order of checking ICU options in initdb and create database

2023-07-06 Thread Daniel Gustafsson
This patch has now been waiting for author since December, with the thread stalled. I am marking this returned with feedback for now, please feel free to re-submit the patch to a future CF when there is renewed interest in working on this. -- Daniel Gustafsson

Re: pgsql: Fix search_path to a safe value during maintenance operations.

2023-07-06 Thread Jeff Davis
On Thu, 2023-06-29 at 22:09 -0700, Nathan Bossart wrote: > On Thu, Jun 29, 2023 at 08:53:56PM -0400, Tom Lane wrote: > > I'm leaning to Robert's thought that we need to revert this for > > now, > > and think harder about how to make it work cleanly and safely. > > Since it sounds like this is

Re: SQL:2011 application time

2023-07-06 Thread Daniel Gustafsson
> On 6 Jul 2023, at 10:12, Peter Eisentraut > wrote: > it would make sense to either close this entry as returned with feedback, or > move it to the next commit fest as waiting on author. Fair enough, done. -- Daniel Gustafsson

Re: Add estimated hit ratio to Memoize in EXPLAIN to explain cost adjustment

2023-07-06 Thread Lukas Fittl
On Thu, Jul 6, 2023 at 12:56 AM Daniel Gustafsson wrote: > Lukas: do you have an updated patch for this commitfest to address David's > comments? > I have a draft - I should be able to post an updated patch in the next days. Thanks for checking! Thanks, Lukas -- Lukas Fittl

Re: Re: [PATCH] Add loongarch native checksum implementation.

2023-07-06 Thread huchangqi
Hi, i have a loongarch machine runing Loongnix-server (based on redhat/centos, it has gcc-8.3 on it), i am trying to test buildfarm on it, when i edit build-farm.conf it seems to need animal and secret to connect the buildfarm server. then i go to

Re: Fix last unitialized memory warning

2023-07-06 Thread Peter Eisentraut
On 05.07.23 23:06, Tristan Partin wrote: Thanks for following up. My system is Fedora 38. I can confirm this is still happening on master. $ gcc --version gcc (GCC) 13.1.1 20230614 (Red Hat 13.1.1-4) Copyright (C) 2023 Free Software Foundation, Inc. This is free software; see the source for

Re: pg_decode_message vs skip_empty_xacts and xact_wrote_changes

2023-07-06 Thread Amit Kapila
On Wed, Jul 5, 2023 at 7:20 PM Ashutosh Bapat wrote: > > On Wed, Jul 5, 2023 at 2:29 PM Amit Kapila wrote: > > > > On Wed, Jul 5, 2023 at 2:28 PM Amit Kapila wrote: > > > > > > On Mon, Jul 3, 2023 at 4:49 PM vignesh C wrote: > > > > > > > > +1 for the first version patch, I also felt the first

MarkGUCPrefixReserved() doesn't check all options

2023-07-06 Thread Karina Litskevich
Hi hackers, Ekaterina Sokolova and I have found a bug in PG 15. Since 88103567cb MarkGUCPrefixReserved() is supposed not only reporting GUCs that haven't been defined by the extension, but also removing them. However, it removes them in a wrong way, so that a GUC that goes after the removed GUC

Re: Permute underscore separated components of columns before fuzzy matching

2023-07-06 Thread Mikhail Gribkov
Hello Arne, The goal of supporting words-switching hints sounds interesting and I've tried to apply your patch. The patch was applied smoothly to the latest master and check-world reported no problems. Although I had problems after trying to test the new functionality. I tried to simply mix

Re: [PATCH] Add GitLab CI to PostgreSQL

2023-07-06 Thread Andrew Dunstan
On 2023-07-05 We 11:58, Matthias van de Meent wrote: On Wed, 5 Jul 2023 at 15:22, Andrew Dunstan wrote: On 2023-07-04 Tu 19:44, Newhouse, Robin wrote: Hello! I propose the attached patch to be applied on the 'master' branch of PostgreSQL to add GitLab CI automation alongside Cirrus CI in

HOT readme missing documentation on summarizing index handling

2023-07-06 Thread Matthias van de Meent
Hi, With PG16's 19d8e230, we got rid of BRIN's blocking of HOT updates, but I just realized that we failed to update the README.HOT document with this new exception for summarizing indexes. Attached a patch that updates that document, detailing the related rationale. I'm not sure if such

Re: Bytea PL/Perl transform

2023-07-06 Thread Peter Eisentraut
On 22.06.23 22:56, Greg Sabino Mullane wrote: * Do all of these transforms need to be their own contrib modules? So much duplicated code across contrib/*_plperl already (and *plpython too for that matter) ... The reason the first transform modules were separate extensions is that they

Re: Permute underscore separated components of columns before fuzzy matching

2023-07-06 Thread Mikhail Gribkov
The following review has been posted through the commitfest application: make installcheck-world: tested, passed Implements feature: tested, passed Spec compliant: tested, failed Documentation:tested, failed Hello Arne, The goal of supporting words-switching hints

Re: Detecting use-after-free bugs using gcc's malloc() attribute

2023-07-06 Thread Peter Eisentraut
On 28.06.23 20:15, Andres Freund wrote: On 2023-06-28 10:40:22 +0200, Peter Eisentraut wrote: On 26.06.23 21:54, Andres Freund wrote: For something like pg_list.h the malloc(free) attribute is a bit awkward to use, because one a) needs to list ~30 functions that can free a list and b) the

Re: logicalrep_message_type throws an error

2023-07-06 Thread Amit Kapila
On Wed, Jul 5, 2023 at 7:54 PM Ashutosh Bapat wrote: > > On Wed, Jul 5, 2023 at 7:07 PM Euler Taveira wrote: > > > > On Wed, Jul 5, 2023, at 7:56 AM, Alvaro Herrera wrote: > > > > On 2023-Jul-05, Amit Kapila wrote: > > > > > I think after returning "???" from logicalrep_message_type(), the > > >

Re: EBCDIC sorting as a use case for ICU rules

2023-07-06 Thread Peter Eisentraut
On 30.06.23 13:08, Daniel Verite wrote: About making a doc patch from this, I've came up with the attached, which generates a CREATE COLLATION statement with rules from an arbitrary strings that just lists characters in whichever order is desired. I like adding more documentation and links

Re: [PATCH] Add loongarch native checksum implementation.

2023-07-06 Thread Daniel Gustafsson
> On 6 Jul 2023, at 09:14, huchangqi wrote: > > Hi, i have a loongarch machine runing Loongnix-server (based on > redhat/centos, it has gcc-8.3 on it), i am trying to test buildfarm on it, > when i edit build-farm.conf it seems to need animal and secret to connect the > buildfarm server. >

Re: Make ON_ERROR_STOP stop on shell script failure

2023-07-06 Thread Daniel Gustafsson
This patch hasn't applied for quite some time, has been waiting on author since December, and the thread has stalled. I'm marking this Returned with Feedback for now, please feel free to resubmit to a future CF when there is renewed interest in working on this. -- Daniel Gustafsson

Re: Latches vs lwlock contention

2023-07-06 Thread Peter Eisentraut
On 04.03.23 20:50, Thomas Munro wrote: Subject: [PATCH v3 1/6] Allow palloc_extended(NO_OOM) in critical sections. Commit 4a170ee9e0e banned palloc() and similar in critical sections, because an allocation failure would produce a panic. Make an exception for allocation with NULL on failure,

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

2023-07-06 Thread Andrey Lepikhov
On 6/7/2023 03:06, Alena Rybakina wrote: I corrected this constant in the patch. The patch don't apply cleanly: it contains some trailing spaces. Also, quick glance into the code shows some weak points; 1. transformBoolExprOr should have input type BoolExpr. 2. You can avoid the switch

Re: [PATCH] Add loongarch native checksum implementation.

2023-07-06 Thread YANG Xudong
On 2023/7/6 15:14, huchangqi wrote: Hi, i have a loongarch machine runing Loongnix-server (based on redhat/centos, it has gcc-8.3 on it), i am trying to test buildfarm on it, when i edit build-farm.conf it seems to need animal and secret to connect the buildfarm server. then i go to

Re: MERGE ... RETURNING

2023-07-06 Thread jian he
On Thu, Jul 6, 2023 at 1:13 PM Gurjeet Singh wrote: > > On Sat, Jul 1, 2023 at 4:08 AM Dean Rasheed wrote: > > > > On Mon, 13 Mar 2023 at 13:36, Dean Rasheed wrote: > > > > > > And another rebase. > > > > > > > I ran out of cycles to pursue the MERGE patches in v16, but hopefully > > I can make

Re: logicalrep_message_type throws an error

2023-07-06 Thread Amit Kapila
On Wed, Jul 5, 2023 at 10:45 PM Alvaro Herrera wrote: > > On 2023-Jul-05, Alvaro Herrera wrote: > > > On 2023-Jul-05, Euler Taveira wrote: > > > > > Isn't this numerical value already exposed in the error message (X = 88)? > > > In this example, it is: > > > > > > ERROR: invalid logical

Re: EBCDIC sorting as a use case for ICU rules

2023-07-06 Thread Peter Eisentraut
On 21.06.23 15:28, Daniel Verite wrote: A collation like the following this seems to work (the rule simply enumerates US-ASCII letters in the EBCDIC alphabet order, with adequate quoting) CREATE COLLATION ebcdic (provider='icu', locale='und', rules=$$&'

Re: MarkGUCPrefixReserved() doesn't check all options

2023-07-06 Thread Heikki Linnakangas
On 06/07/2023 12:17, Karina Litskevich wrote: Hi hackers, Ekaterina Sokolova and I have found a bug in PG 15. Since 88103567cb MarkGUCPrefixReserved() is supposed not only reporting GUCs that haven't been defined by the extension, but also removing them. However, it removes them in a wrong

  1   2   >