Re: "ERROR: could not open relation with OID 16391" error was encountered when reindexing

2024-01-16 Thread feichanghong
> This is extremely nonspecific, as line numbers in our code change > constantly. Please quote a chunk of code surrounding that > and indicate which line you are trying to stop at. Thanks for the suggestion, I've refined the steps below to reproduce: 1. Initialize the data ``` DROP TABLE IF

Re: UUID v7

2024-01-16 Thread Sergey Prokhorenko
Andrey, It is not clear how to interpret uuid_v7_time(): - uuid_v7 to time() (extracting the timestamp) - time() to uuid_v7  (generation of the uuid_v7) It is worth improving the naming, for example, adding prepositions. Sergey prokhorenkosergeyprokhore...@yahoo.com.au On

New Window Function: ROW_NUMBER_DESC() OVER() ?

2024-01-16 Thread David G. Johnston
On Tuesday, January 16, 2024, Maiquel Grassi wrote: > Hi, > > Count() over() - row_number() over() > >But if my dataset is significantly large? Wouldn't calling two window > functions instead of one be much slower? >Is *count() over() - row_number() over()* faster than *row_number_desc()

Re: partitioning and identity column

2024-01-16 Thread Peter Eisentraut
On 09.01.24 15:10, Ashutosh Bapat wrote: Here's complete patch-set. Looks good! Committed.

Re: Emit fewer vacuum records by reaping removable tuples during pruning

2024-01-16 Thread Robert Haas
On Tue, Jan 16, 2024 at 11:28 AM Melanie Plageman wrote: > All LGTM. Committed. -- Robert Haas EDB: http://www.enterprisedb.com

RE: New Window Function: ROW_NUMBER_DESC() OVER() ?

2024-01-16 Thread Maiquel Grassi
I doubt it is materially different, you need that count regardless so the effort is expended no matter if you put it in an SQL expression or build it into the window function. But as you are the one arguing for the new feature demonstrating that the status quo is deficient is your job.

Re: psql JSON output format

2024-01-16 Thread Robert Haas
On Tue, Jan 16, 2024 at 11:07 AM Laurenz Albe wrote: > "Round-trip safety" is not so important. If you want to move data from > PostgreSQL to PostgreSQL, you use the plain or the binary format. > The CSV format by default renders NULL and empty strings identical, and > I don't think anybody

Re: psql JSON output format

2024-01-16 Thread Andrew Dunstan
On 2024-01-16 Tu 11:07, Laurenz Albe wrote: On Tue, 2024-01-09 at 16:51 +, Dean Rasheed wrote: On Tue, 9 Jan 2024 at 14:35, Christoph Berg wrote: Getting it print numeric/boolean without quotes was actually easy, as well as json(b). Implemented as the attached v2 patch. But: not quoting

Re: UUID v7

2024-01-16 Thread Andrey M. Borodin
> On 16 Jan 2024, at 21:49, Sergey Prokhorenko > wrote: > > It is not clear how to interpret uuid_v7_time(): > • uuid_v7 to time() (extracting the timestamp) > • time() to uuid_v7 (generation of the uuid_v7) > It is worth improving the naming, for example, adding prepositions.

Re: New Window Function: ROW_NUMBER_DESC() OVER() ?

2024-01-16 Thread Michał Kłeczek
> On 16 Jan 2024, at 16:51, Maiquel Grassi wrote: > > > Imagine I have a dataset that is returned to my front-end, and I want to > reverse enumerate them (exactly the concept of Math enumerating integers). > The row_number does the ascending enumeration, but I need the descending >

Re: index prefetching

2024-01-16 Thread Konstantin Knizhnik
On 16/01/2024 6:25 pm, Tomas Vondra wrote: On 1/16/24 09:13, Konstantin Knizhnik wrote: Hi, On 12/01/2024 6:42 pm, Tomas Vondra wrote: Hi, Here's an improved version of this patch, finishing a lot of the stuff that I alluded to earlier - moving the code from indexam.c, renaming a bunch of

Re: UUID v7

2024-01-16 Thread Jelte Fennema-Nio
On Tue, 16 Jan 2024 at 15:44, Andrey M. Borodin wrote: > > On 16 Jan 2024, at 18:00, Aleksander Alekseev > > wrote: > > Not 100% sure what this is for. Any chance this could be part of another > > patch? > Nope, it’s necessary there. Without these changes catalog functions cannot > have

RE: New Window Function: ROW_NUMBER_DESC() OVER() ?

2024-01-16 Thread Maiquel Grassi
You can do: -(ROW_NUMBER() OVER ()) AS descending (note “-“ in front) I don't have a base column to use for "order by," I think that’s the main issue: what (semantically) does row_number() mean in that case? You could equally well generate random numbers? --//-- What I want to do is

Re: UUID v7

2024-01-16 Thread Przemysław Sztoch
Andrey Borodin wrote on 1/16/2024 1:15 PM: Sergey, Przemysław, Jelte, thanks for your feedback. Here's v9. Changes: 1. Swapped type of the argument to timestamptz in gen_uuid_v7() Please update docs part about optional timestamp argument. 2. Renamed get_uuid_v7_time() to uuid_v7_time()

Re: cleanup patches for incremental backup

2024-01-16 Thread Matthias van de Meent
On Tue, 16 Jan 2024 at 16:39, Robert Haas wrote: > > On Mon, Jan 15, 2024 at 3:31 PM Matthias van de Meent > wrote: > > Off-list I was notified that the new WAL summarizer process was not > > yet added to the glossary, so PFA a patch that does that. > > In passing, it also adds "incremental

Re: Fix a possible socket leak at Windows (src/backend/port/win32/socket.c)

2024-01-16 Thread Ranier Vilela
Em seg., 15 de jan. de 2024 às 09:43, Daniel Gustafsson escreveu: > > On 13 Jan 2024, at 22:38, Ranier Vilela wrote: > > > In the pgwin32_socket function (src/backend/port/win32/socket.c), there > is a possible socket leak if the socket cannot be made non-blocking. > > I don't know Windows well

Re: UUID v7

2024-01-16 Thread Jelte Fennema-Nio
On Tue, 16 Jan 2024 at 19:17, Andrey M. Borodin wrote: > Jelte, what is your opinion on naming the function which extracts timestamp > from UUID v7? I looked at a few more datatypes: json, jsonb & hstore. The get_ prefix is not used there at all, so I'm still opposed to that. But they seem to

RE: New Window Function: ROW_NUMBER_DESC() OVER() ?

2024-01-16 Thread Maiquel Grassi
However, initially, I have one more obstacle in your feedback. If I use count(*) over() - row_number() over(), it gives me an offset of one unit. To resolve this, I need to add 1. This way, simulating a reverse row_number() becomes even more laborious. I don’t really understand why you think

Re: Add new protocol message to change GUCs for usage with future protocol-only GUCs

2024-01-16 Thread Robert Haas
On Tue, Jan 16, 2024 at 8:43 AM Jelte Fennema-Nio wrote: > I haven't removed 0008 yet, since I'd like some feedback first if that > makes sense. But I did add two new patches in the middle of the > patchset (which shift the later patch numbers by 2): > > 0007: Adds a new \parameterset

New Window Function: ROW_NUMBER_DESC() OVER() ?

2024-01-16 Thread David G. Johnston
On Tuesday, January 16, 2024, Maiquel Grassi wrote: > However, initially, I have one more obstacle in your feedback. If I use > count(*) over() - row_number() over(), it gives me an offset of one unit. > To resolve this, I need to add 1. > > > This way, simulating a reverse row_number() becomes

Re: Revise the Asserts added to bimapset manipulation functions

2024-01-16 Thread David Rowley
On Tue, 16 Jan 2024 at 21:00, Richard Guo wrote: > Thank you so much for all the work you have put into making this patch > perfect. I reviewed through the v3 patch and I do not have further > comments. I think it's in good shape now. Thanks for looking again. I pushed the patch after

Re: [PATCH] Add additional extended protocol commands to psql: \parse and \bindx

2024-01-16 Thread Jelte Fennema-Nio
Looks really good now. One thing I noticed is that \bindx doesn't call ignore_slash_options if it's not in an active branch. Afaict it should. I do realize the same is true for plain \bind, but it seems like a bug there too.

Re: Synchronizing slots from primary to standby

2024-01-16 Thread shveta malik
On Tue, Jan 16, 2024 at 12:59 PM Masahiko Sawada wrote: > > On Tue, Jan 16, 2024 at 1:07 PM Amit Kapila wrote: > > > > On Tue, Jan 16, 2024 at 9:03 AM shveta malik wrote: > > > > > > On Sat, Jan 13, 2024 at 12:54 PM Amit Kapila > > > wrote: > > > > > > > > On Fri, Jan 12, 2024 at 5:50 PM

Re: Proposal to add page headers to SLRU pages

2024-01-16 Thread Li, Yong
Rebase the patch against the latest HEAD. Regards, Yong slru_page_header_v4.patch Description: slru_page_header_v4.patch

Re: Parent/child context relation in pg_get_backend_memory_contexts()

2024-01-16 Thread Melih Mutlu
Hi, Thanks for reviewing. torikoshia , 10 Oca 2024 Çar, 09:37 tarihinde şunu yazdı: > > + > > + > role="column_definition"> > > + context_id int4 > > + > > + > > + Current context id. Note that the context id is a temporary id > > and may > > + change in

Re: Oom on temp (un-analyzed table caused by JIT) V16.1 [Fixed Already]

2024-01-16 Thread Daniel Gustafsson
> On 16 Jan 2024, at 02:53, Kirk Wolak wrote: > > On Mon, Jan 15, 2024 at 9:03 AM Daniel Gustafsson > wrote: > > On 15 Jan 2024, at 07:24, Kirk Wolak > > wrote: > > > You have a commit [1] that MIGHT fix this. > > I have a script that

Re: Revise the Asserts added to bimapset manipulation functions

2024-01-16 Thread Richard Guo
On Tue, Jan 16, 2024 at 11:08 AM David Rowley wrote: > I've now adjusted the patch to have all modifications to Bitmapsets > return a newly allocated set. There are a few cases missing in master > that need to be fixed (items 6-10 below): > > The patch now includes changes for the following: > >

Re: [PATCH] Add additional extended protocol commands to psql: \parse and \bindx

2024-01-16 Thread Anthonin Bonnefoy
Hi, Thanks for the review and comments. > One thing that I think should be added for completeness though is the > ability to deallocate the prepared statement using > PQsendClosePrepared. Other than that the changes look great. Good point, I've added the \close command. > Also a tiny nitpick:

Re: index prefetching

2024-01-16 Thread Konstantin Knizhnik
Hi, On 12/01/2024 6:42 pm, Tomas Vondra wrote: Hi, Here's an improved version of this patch, finishing a lot of the stuff that I alluded to earlier - moving the code from indexam.c, renaming a bunch of stuff, etc. I've also squashed it into a single patch, to make it easier to review. I am

Re: Synchronizing slots from primary to standby

2024-01-16 Thread Bertrand Drouvot
Hi, On Sat, Jan 13, 2024 at 12:53:50PM +0530, Amit Kapila wrote: > On Fri, Jan 12, 2024 at 5:50 PM shveta malik wrote: > > > > There are multiple approaches discussed and tried when it comes to > > starting a slot-sync worker. I am summarizing all here: > > > > 1) Make slotsync worker as an

Re: Add test module for Table Access Method

2024-01-16 Thread Aleksander Alekseev
Hi, > > I think a test module for a table AM will really help developers. Just > > to add to the above list - how about the table AM implementing a > > simple in-memory (columnar if possible) database storing tables > > in-memory and subsequently providing readers with the access to the > >

Re: ResourceOwner refactoring

2024-01-16 Thread Heikki Linnakangas
On 16/01/2024 13:23, Anton A. Melnikov wrote: Hello! Found possibly missing PGDLLIMPORT in the definition of the extern const ResourceOwnerDesc buffer_io_resowner_desc; and extern const ResourceOwnerDesc buffer_pin_resowner_desc; callbacks in the src/include/storage/buf_internals.h Please

Re: "ERROR: could not open relation with OID 16391" error was encountered when reindexing

2024-01-16 Thread Aleksander Alekseev
Hi, > This issue has been reported in the list at the link below, but > has not received a reply. > https://www.postgresql.org/message-id/18286-f6273332500c2a62%40postgresql.org > Hopefully to get some response from kernel hackers, thanks! > > Hi, > When reindex the partitioned table's index

Re: ResourceOwner refactoring

2024-01-16 Thread Anton A. Melnikov
On 16.01.2024 14:54, Heikki Linnakangas wrote: Fixed, thanks. mark_pgdllimport.pl also highlighted two new variables in walsummarizer.h, fixed those too. Thanks! Have a nice day! -- Anton A. Melnikov Postgres Professional: http://www.postgrespro.com The Russian Postgres Company

Re: Postgres Database Service Interruption

2024-01-16 Thread David G. Johnston
On Tuesday, January 16, 2024, Bablu Kumar Nayak < bablukumarnayak1...@gmail.com> wrote: > Dear PostgreSQL Team, > > > > I am writing to inform you that our PostgreSQL database service is > currently down. We are experiencing an unexpected interruption, and we are > seeking your expertise to help

Re: Fixing backslash dot for COPY FROM...CSV

2024-01-16 Thread Daniel Verite
Robert Haas wrote: > Part of my hesitancy, I suppose, is that I don't > understand why we even have this strange convention of making \. > terminate the input in the first place -- I mean, why wouldn't that be > done in some kind of out-of-band way, rather than including a special >

Re: Custom explain options

2024-01-16 Thread Tomas Vondra
On 1/15/24 21:42, Konstantin Knizhnik wrote: > > On 15/01/2024 5:08 pm, Tomas Vondra wrote: >> >> My patch does not care about prefetching internal index pages. Yes, it's >> a limitation, but my assumption is the internal pages are maybe 0.1% of >> the index, and typically very hot / cached.

Re: New Window Function: ROW_NUMBER_DESC() OVER() ?

2024-01-16 Thread David G. Johnston
On Tuesday, January 16, 2024, Maiquel Grassi wrote: > Hello David, how are you? > > Firstly, I apologize if I wasn't clear in what I intended to propose. I > used a very specific example here, and it wasn't very clear what I really > wanted to bring up for discussion. > > I understand that it's

Re: UUID v7

2024-01-16 Thread Andrey M. Borodin
Thanks for your review, Aleksander! > On 16 Jan 2024, at 18:00, Aleksander Alekseev > wrote: > > > ``` > +Datum > +pg_node_tree_in(PG_FUNCTION_ARGS) > +{ > +if (!IsBootstrapProcessingMode()) > +elog(ERROR, "cannot accept a value of type pg_node_tree_in"); > +return

RE: New Window Function: ROW_NUMBER_DESC() OVER() ?

2024-01-16 Thread Maiquel Grassi
Hello David, how are you? Firstly, I apologize if I wasn't clear in what I intended to propose. I used a very specific example here, and it wasn't very clear what I really wanted to bring up for discussion. I understand that it's possible to order the "returned dataset" using "order by ...

Re: Error "initial slot snapshot too large" in create replication slot

2024-01-16 Thread Robert Haas
On Mon, Jan 15, 2024 at 9:18 PM Kyotaro Horiguchi wrote: > Thank you for the deep insights. I have understood your points. As I > can't think of any further simple modifications on this line, I will > withdraw this CF entry. At the moment, I also lack a fundamental, > comprehensive solution, but

Re: reorganize "Shared Memory and LWLocks" section of docs

2024-01-16 Thread Nathan Bossart
On Tue, Jan 16, 2024 at 10:02:15AM +0530, Bharath Rupireddy wrote: > The v3 patch looks good to me except for a nitpick: the input > parameter for RequestAddinShmemSpace is 'Size' not 'int' > > > void RequestAddinShmemSpace(int size) > Hah, I think this mistake is nearly old enough to vote

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

2024-01-16 Thread Alexander Korotkov
Hi, > Thanks for updating the patch! You're welcome! > Here is a minor comment: > > > +/* > > + * Extract a defGetCopySaveErrorToChoice value from a DefElem. > > + */ > > Should be Extract a "CopySaveErrorToChoice"? Fixed. > BTW I'm thinking we should add a column to pg_stat_progress_copy

Re: Emit fewer vacuum records by reaping removable tuples during pruning

2024-01-16 Thread Robert Haas
On Mon, Jan 15, 2024 at 4:03 PM Melanie Plageman wrote: > It doesn't pass the number of LP_DEAD items back to the caller. It > passes a boolean. Oops. > Perhaps it isn't important, but I find this wording confusing. You > mention lazy_scan_prune() and then mention that "the whole test is in >

Re: reorganize "Shared Memory and LWLocks" section of docs

2024-01-16 Thread Nathan Bossart
On Tue, Jan 16, 2024 at 08:20:19AM -0600, Nathan Bossart wrote: > On Tue, Jan 16, 2024 at 10:02:15AM +0530, Bharath Rupireddy wrote: >> The v3 patch looks good to me except for a nitpick: the input >> parameter for RequestAddinShmemSpace is 'Size' not 'int' >> >> >> void

Re: index prefetching

2024-01-16 Thread Tomas Vondra
On 1/16/24 09:13, Konstantin Knizhnik wrote: > Hi, > > On 12/01/2024 6:42 pm, Tomas Vondra wrote: >> Hi, >> >> Here's an improved version of this patch, finishing a lot of the stuff >> that I alluded to earlier - moving the code from indexam.c, renaming a >> bunch of stuff, etc. I've also

Re: Add PQsendSyncMessage() to libpq

2024-01-16 Thread Alvaro Herrera
On 2024-Jan-16, Michael Paquier wrote: > I've applied the patch with all these modifications to move on with > the subject. Thanks! > On Mon, Jan 15, 2024 at 10:49:56AM +0100, Alvaro Herrera wrote: > > Looking again at the largish comment that's now atop > > pqPipelineSyncInternal(), I think

Re: "ERROR: could not open relation with OID 16391" error was encountered when reindexing

2024-01-16 Thread feichanghong
Thank you for your attention.Any chance you could provide minimal steps to reproduce the issue onan empty PG instance, ideally as a script? That's going to be helpfulto reproduce / investigate the issue and also make sure that it'sfixed.I have provided a python script in the attachment to minimize

Re: Report planning memory in EXPLAIN ANALYZE

2024-01-16 Thread Ashutosh Bapat
Replying to both Alvaro and Abhijit in this email. On Fri, Jan 12, 2024 at 10:22 PM Alvaro Herrera wrote: > > I think this patch is mostly OK and decided to use it to test something > else. In doing so I noticed one small thing that bothers me: if > planning uses buffers, and those were

Re: POC: GROUP BY optimization

2024-01-16 Thread Alexander Korotkov
sortref, > + *group_clauses); > + if (!sgc) > + /* The grouping clause does not cover this pathkey */ > + break; > > I think we need to check or assert 'pathkey->pk_eclass->ec_sortref' is > valid bef

Re: cleanup patches for incremental backup

2024-01-16 Thread Robert Haas
On Mon, Jan 15, 2024 at 3:31 PM Matthias van de Meent wrote: > Off-list I was notified that the new WAL summarizer process was not > yet added to the glossary, so PFA a patch that does that. > In passing, it also adds "incremental backup" to the glossary, and > updates the documented types of

Re: introduce dynamic shared memory registry

2024-01-16 Thread Nathan Bossart
On Tue, Jan 16, 2024 at 10:28:29AM +0530, Bharath Rupireddy wrote: > I think it's better for GetNamedDSMSegment() to error out on empty > 'name' and size 0. This makes the user-facing function > GetNamedDSMSegment more concrete. Agreed, thanks for the suggestion. > +void * >

Re: Custom explain options

2024-01-16 Thread Konstantin Knizhnik
On 16/01/2024 5:38 pm, Tomas Vondra wrote: By "broken" you mean that you prefetch items only from a single leaf page, so immediately after reading the next one nothing is prefetched. Correct? Yes, exactly. It means that reading first heap page from next leaf page will be done without

Re: psql JSON output format

2024-01-16 Thread Laurenz Albe
On Tue, 2024-01-09 at 16:51 +, Dean Rasheed wrote: > On Tue, 9 Jan 2024 at 14:35, Christoph Berg wrote: > > > > Getting it print numeric/boolean without quotes was actually easy, as > > well as json(b). Implemented as the attached v2 patch. > > > > But: not quoting json means that NULL and

Re: "ERROR: could not open relation with OID 16391" error was encountered when reindexing

2024-01-16 Thread feichanghong
I have provided a python script in the attachment to minimize the reproduction of the issue. I'm sorry that I lost the attached script in my last reply, but I've added it in this reply. You can also use psql to reproduce it with the following steps: 1. Initialize the data ``` DROP TABLE IF

Re: sql-merge.html Compatibility section, typo.

2024-01-16 Thread Daniel Gustafsson
> On 16 Jan 2024, at 11:30, jian he wrote: > > hi. > https://www.postgresql.org/docs/current/sql-merge.html > > Compatibility section: > "WITH clause" > should be > > WITH clause Agreed, the rest of the page marks up "WITH clause" like that so I'll go ahead and backpatch that down to v15. --

Re: [PATCH] Add additional extended protocol commands to psql: \parse and \bindx

2024-01-16 Thread Jelte Fennema-Nio
One more usability thing. I think \parse and \close should not require a \g to send the message. You can do that by returning PSQL_CMD_SEND instead of PSQL_CMD_SKIP_LIN. I feel like the main point of requiring \g for \bind and \bindx is so you can also use \gset or \gexec. But since \parse and

Re: [PATCH] Add additional extended protocol commands to psql: \parse and \bindx

2024-01-16 Thread Jelte Fennema-Nio
On Tue, 16 Jan 2024 at 10:37, Jelte Fennema-Nio wrote: > > Looks really good now. One thing I noticed is that \bindx doesn't call > ignore_slash_options if it's not in an active branch. Afaict it > should. I do realize the same is true for plain \bind, but it seems > like a bug there too. To

Re: New Window Function: ROW_NUMBER_DESC() OVER() ?

2024-01-16 Thread David G. Johnston
On Tuesday, January 16, 2024, Maiquel Grassi wrote: > Hi developers, > > I was working on loans and bank financing, specifically focusing on > Amortization Systems. I had the need to reverse the counter for the total > number of installments or for a specific set of installments. This >

Re: Strange Bitmapset manipulation in DiscreteKnapsack()

2024-01-16 Thread Richard Guo
On Tue, Jan 16, 2024 at 11:32 AM David Rowley wrote: > While working on [1], I noticed some strange code in > DiscreteKnapsack() which seems to be aiming to copy the Bitmapset. > > It's not that obvious at a casual glance, but: > > sets[j] = bms_del_members(sets[j], sets[j]); > > this is aiming

Re: long-standing data loss bug in initial sync of logical replication

2024-01-16 Thread Vadim Lakt
Hi, On 19.11.2023 09:18, Andres Freund wrote: Yea, the situation is much simpler during logical decoding than "originally" - there's no concurrency. Greetings, Andres Freund We've encountered a similar error on our industrial server. The case: After adding a table to logical replication,

Re: Extend pgbench partitioning to pgbench_history

2024-01-16 Thread Abhijit Menon-Sen
At 2023-11-30 11:29:15 +0100, gabriele.bartol...@enterprisedb.com wrote: > > With the attached patch, I extend the partitioning capability to the > pgbench_history table too. > > I have been thinking of adding an option to control this, but I preferred > to ask in this list whether it really

Re: Add test module for Table Access Method

2024-01-16 Thread Mats Kindahl
Hi all, On Tue, Jan 16, 2024 at 10:40 AM Aleksander Alekseev < aleksan...@timescale.com> wrote: > Hi, > > > > I think a test module for a table AM will really help developers. Just > > > to add to the above list - how about the table AM implementing a > > > simple in-memory (columnar if

Re: ResourceOwner refactoring

2024-01-16 Thread Anton A. Melnikov
Hello! Found possibly missing PGDLLIMPORT in the definition of the extern const ResourceOwnerDesc buffer_io_resowner_desc; and extern const ResourceOwnerDesc buffer_pin_resowner_desc; callbacks in the src/include/storage/buf_internals.h Please take a look on it. With the best regards, --

Re: Make mesage at end-of-recovery less scary.

2024-01-16 Thread Aleksander Alekseev
Hi, > > If I understand correctly, if somehow several FS blocks end up being > > zeroed (due to OS bug, bit rot, restoring from a corrupted for > > whatever reason backup, hardware failures, ...) there is non-zero > > chance that PG will interpret this as a normal situation. To my > > knowledge

Re: remaining sql/json patches

2024-01-16 Thread Amit Langote
Hi, Thought I'd share an update. I've been going through Jian He's comments (thanks for the reviews!), most of which affect the last JSON_TABLE() patch and in some cases the query functions patch (0007). It seems I'll need to spend a little more time, especially on the JSON_TABLE() patch, as

Re: Make all Perl warnings fatal

2024-01-16 Thread Bharath Rupireddy
On Fri, Jan 12, 2024 at 9:21 PM Bharath Rupireddy wrote: > > On Fri, Jan 12, 2024 at 9:03 PM Peter Eisentraut wrote: > > > > I would put this code > > > > my $core = $ret & 128 ? " (core dumped)" : ""; > > die "psql exited with signal " > >. ($ret & 127) > >. "$core:

Re: initdb's -c option behaves wrong way?

2024-01-16 Thread Daniel Gustafsson
> On 28 Sep 2023, at 09:49, Kyotaro Horiguchi wrote: > I noticed that -c option of initdb behaves in an unexpected > manner. Identical variable names with variations in letter casing are > treated as distinct variables. > > $ initdb -cwork_mem=100 -cWORK_MEM=1000 -cWork_mem=2000 > The original

RE: Synchronizing slots from primary to standby

2024-01-16 Thread Zhijie Hou (Fujitsu)
On Tuesday, January 16, 2024 9:27 AM Peter Smith wrote: > > Here are some review comments for patch v61-0002 Thanks for the comments. > > == > doc/src/sgml/logical-replication.sgml > > 1. > + > + Examples: logical replication failover > > The current documentation structure (after

Re: Synchronizing slots from primary to standby

2024-01-16 Thread shveta malik
On Sat, Jan 13, 2024 at 12:54 PM Amit Kapila wrote: > > On Fri, Jan 12, 2024 at 5:50 PM shveta malik wrote: > > > > There are multiple approaches discussed and tried when it comes to > > starting a slot-sync worker. I am summarizing all here: > > > > 1) Make slotsync worker as an Auxiliary

Re: Add test module for Table Access Method

2024-01-16 Thread Mats Kindahl
On Tue, Jan 16, 2024 at 6:15 AM Bharath Rupireddy < bharath.rupireddyforpostg...@gmail.com> wrote: > On Tue, Jan 16, 2024 at 10:28 AM Michael Paquier > wrote: > > > > Hmm. I'd rather have it do something useful in terms of test coverage > > rather than being just an empty skull. > > > > How

Postgres Database Service Interruption

2024-01-16 Thread Bablu Kumar Nayak
Dear PostgreSQL Team, I am writing to inform you that our PostgreSQL database service is currently down. We are experiencing an unexpected interruption, and we are seeking your expertise to help us resolve this issue promptly. We would greatly appreciate your immediate attention to this

Re: UUID v7

2024-01-16 Thread Aleksander Alekseev
Hi Andrey, > Sergey, Przemysław, Jelte, thanks for your feedback. > Here's v9. Changes: > 1. Swapped type of the argument to timestamptz in gen_uuid_v7() > 2. Renamed get_uuid_v7_time() to uuid_v7_time() > 3. Added uuid_ver() and uuid_var(). > > What do you think? Many thanks for the updated

sql-merge.html Compatibility section, typo.

2024-01-16 Thread jian he
hi. https://www.postgresql.org/docs/current/sql-merge.html Compatibility section: "WITH clause" should be WITH clause

"ERROR: could not open relation with OID 16391" error was encountered when reindexing

2024-01-16 Thread feichanghong
This issue has been reported in the list at the link below, but has not received a reply. https://www.postgresql.org/message-id/18286-f6273332500c2a62%40postgresql.org Hopefully to get some response from kernel hackers, thanks! Hi, When reindex the partitioned table's index and the drop index

Re: UUID v7

2024-01-16 Thread Andrey Borodin
> On 5 Jan 2024, at 15:57, Sergey Prokhorenko > wrote: Sergey, Przemysław, Jelte, thanks for your feedback. Here's v9. Changes: 1. Swapped type of the argument to timestamptz in gen_uuid_v7() 2. Renamed get_uuid_v7_time() to uuid_v7_time() 3. Added uuid_ver() and uuid_var(). What do you

Re: UUID v7

2024-01-16 Thread Przemysław Sztoch
Jelte Fennema-Nio wrote on 1/16/2024 9:25 PM: On Tue, 16 Jan 2024 at 19:17, Andrey M. Borodin wrote: So currently my preference for the function names would be: - uuidv4() -> alias for gen_random_uuid() - uuidv7() - uuidv7(timestamptz) - uuid_extract_ver(uuid) - uuid_extract_var(uuid) -

Re: Emit fewer vacuum records by reaping removable tuples during pruning

2024-01-16 Thread Robert Haas
On Tue, Jan 16, 2024 at 4:28 PM Jim Nasby wrote: > On 1/12/24 12:45 PM, Robert Haas wrote: > > P.P.S. to everyone: Yikes, this logic is really confusing. > > Having studied all this code several years ago when it was even simpler > - it was *still* very hard to grok even back then. I *greatly >

Re: cleanup patches for incremental backup

2024-01-16 Thread Robert Haas
On Tue, Jan 16, 2024 at 3:22 PM Matthias van de Meent wrote: > > One other thought is that the incremental backup only replaces > > relation files with incremental files, and it never does anything > > about FSM files. So the statement that it only contains data that was > > potentially changed

Re: UUID v7

2024-01-16 Thread Jelte Fennema-Nio
On Tue, 16 Jan 2024 at 22:02, Przemysław Sztoch wrote: > But replace uuidv7_extract_time(uuid) with uuid_extract_time(uuid) - function > should be able extract timestamp from v1/v6/v7 I'm fine with this. > I would highly recommend to add: > uuidv5(namespace uuid, name text) -> uuid > using

Re: [PATCH] Add support function for containment operators

2024-01-16 Thread Tom Lane
jian he writes: > [ v5-0001-Simplify-containment-in-range-constants-with-supp.patch ] I spent some time reviewing and cleaning up this code. The major problem I noted was that it doesn't spend any effort thinking about cases where it'd be unsafe or undesirable to apply the transformation. In

Re: Emit fewer vacuum records by reaping removable tuples during pruning

2024-01-16 Thread Melanie Plageman
On Tue, Jan 16, 2024 at 2:23 PM Robert Haas wrote: > > On Tue, Jan 16, 2024 at 11:28 AM Melanie Plageman > wrote: > > All LGTM. > > Committed. Attached v8 patch set is rebased over this. In 0004, I've taken the approach you seem to favor and combined the FSM updates from the prune and no prune

Re: Improve the connection failure error messages

2024-01-16 Thread Peter Smith
On Sat, Jan 13, 2024 at 12:36 AM Aleksander Alekseev wrote: > > Hi, > > Thanks for the patch. > > > Due to this behavior, it is not possible to add a test to show the > > error message as it is done for CREATE SUBSCRIPTION. > > Let me know if you think there is another way to add this test. > > I

Re: UUID v7

2024-01-16 Thread Przemysław Sztoch
Another question: how did you choose between using TimestampTz and Timestamp types? I realize that internally it's all the same. Maybe Timestamp will be slightly better since the way it is displayed doesn't depend on the session settings. Many people I talked to find this part of TimestampTz

Re: Emit fewer vacuum records by reaping removable tuples during pruning

2024-01-16 Thread Jim Nasby
On 1/12/24 12:45 PM, Robert Haas wrote: P.P.S. to everyone: Yikes, this logic is really confusing. Having studied all this code several years ago when it was even simpler - it was *still* very hard to grok even back then. I *greatly appreciate* the effort that y'all are putting into

Re: index prefetching

2024-01-16 Thread Jim Nasby
On 1/16/24 2:10 PM, Konstantin Knizhnik wrote: Amazon RDS is just vanilla Postgres with file system mounted on EBS (Amazon  distributed file system). EBS provides good throughput but larger latencies comparing with local SSDs. I am not sure if read-ahead works for EBS. Actually, EBS only

RE: New Window Function: ROW_NUMBER_DESC() OVER() ?

2024-01-16 Thread Maiquel Grassi
The people in this community are quite capable and willing to write a contrary opinion to mine. Not sure how to make “this new proposed function shouldn’t be added to core”, and trying to explain why not, non-oppressive. I can add “thank you for taking the time to try and improve PostgreSQL”

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

2024-01-16 Thread Kyotaro Horiguchi
At Wed, 17 Jan 2024 14:38:54 +0900, torikoshia wrote in > Hi, > > Thanks for applying! > > > + errmsg_plural("%zd row were skipped due to data type > > incompatibility", > > Sorry, I just noticed it, but 'were' should be 'was' here? > > >> BTW I'm thinking we should add a column to

Re: "ERROR: could not open relation with OID 16391" error was encountered when reindexing

2024-01-16 Thread feichanghong
For this specific job, I have always wanted a try_index_open() thatwould attempt to open the index with a relkind check, perhaps we couldintroduce one and reuse it here?Yes, replacing index_open with try_index_open solves the problem. Theidea is similar to my initial report of "after successfully

RE: speed up a logical replica setup

2024-01-16 Thread Hayato Kuroda (Fujitsu)
Dear Euler, hackers, I found that some bugs which have been reported by Shlok were not fixed, so made a top-up patch. 0001 was not changed, and 0002 contains below: * Add a timeout option for the recovery option, per [1]. The code was basically ported from pg_ctl.c. * Reject if the target

Re: [PATCH] Add additional extended protocol commands to psql: \parse and \bindx

2024-01-16 Thread Michael Paquier
On Tue, Jan 16, 2024 at 10:37:22AM +0100, Jelte Fennema-Nio wrote: > I do realize the same is true for plain \bind, but it seems > like a bug there too. Hmm. ignore_slash_options() is used to make the difference between active and inactive branches with \if. I was playing a bit with psql.sql

Re: Add PQsendSyncMessage() to libpq

2024-01-16 Thread Michael Paquier
On Tue, Jan 16, 2024 at 02:55:12PM +0100, Alvaro Herrera wrote: > On 2024-Jan-16, Michael Paquier wrote: >> How about the attached to remove all that, then? > > Looks good, thank you. Thanks for double-checking. Done. -- Michael signature.asc Description: PGP signature

Re: Emit fewer vacuum records by reaping removable tuples during pruning

2024-01-16 Thread Melanie Plageman
On Tue, Jan 16, 2024 at 10:24 AM Robert Haas wrote: > > On Mon, Jan 15, 2024 at 4:03 PM Melanie Plageman > wrote: > > > Perhaps it isn't important, but I find this wording confusing. You > > mention lazy_scan_prune() and then mention that "the whole test is in > > one place instead of spread

Re: ALTER TYPE OWNER fails to recurse to multirange

2024-01-16 Thread Tom Lane
Robert Haas writes: > On Mon, Jan 15, 2024 at 2:28 PM Tom Lane wrote: >> I'm reasoning by analogy to array types, which are automatically >> created and automatically updated to keep the same ownership >> etc. properties as their base type. To the extent that multirange >> types don't act

RE: New Window Function: ROW_NUMBER_DESC() OVER() ?

2024-01-16 Thread Maiquel Grassi
Hi, Count() over() - row_number() over() But if my dataset is significantly large? Wouldn't calling two window functions instead of one be much slower? Is count() over() - row_number() over() faster than row_number_desc() over()? Maiquel.

Re: index prefetching

2024-01-16 Thread Robert Haas
On Tue, Jan 16, 2024 at 11:25 AM Tomas Vondra wrote: > > 3. It doesn't perform prefetch of leave pages for IOS, only referenced > > heap pages which are not marked as all-visible. It seems to me that if > > optimized has chosen IOS (and not bitmap heap scan for example), then > > there should be

Re: ALTER TYPE OWNER fails to recurse to multirange

2024-01-16 Thread Robert Haas
On Tue, Jan 16, 2024 at 11:46 AM Tom Lane wrote: > They're by no means independent. What would it mean to have a > multirange without the underlying range type? It would mean just that - no more, and no less. If it's possible to imagine a data type that stores pairs of values from the

Re: "ERROR: could not open relation with OID 16391" error was encountered when reindexing

2024-01-16 Thread Tom Lane
"=?ISO-8859-1?B?ZmVpY2hhbmdob25n?=" writes: > 2. session1 reindex and gdb break at index.c:3585 This is extremely nonspecific, as line numbers in our code change constantly. Please quote a chunk of code surrounding that and indicate which line you are trying to stop at.

New Window Function: ROW_NUMBER_DESC() OVER() ?

2024-01-16 Thread David G. Johnston
On Tuesday, January 16, 2024, Maiquel Grassi wrote: > > > However, initially, I have one more obstacle in your feedback. If I use > count(*) over() - row_number() over(), it gives me an offset of one unit. > To resolve this, I need to add 1. > > This way, simulating a reverse row_number() becomes

Re: [PoC] Improve dead tuple storage for lazy vacuum

2024-01-16 Thread John Naylor
On Tue, Jan 16, 2024 at 1:18 PM Masahiko Sawada wrote: > Just changing "items" to be the local tidstore struct could make the > code tricky a bit, since max_bytes and num_items are on the shared > memory while "items" is a local pointer to the shared tidstore. Thanks for trying it this way! I

  1   2   >