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

2023-03-19 Thread Masahiko Sawada
On Fri, Mar 17, 2023 at 4:49 PM Masahiko Sawada wrote: > > On Fri, Mar 17, 2023 at 4:03 PM John Naylor > wrote: > > > > On Wed, Mar 15, 2023 at 9:32 AM Masahiko Sawada > > wrote: > > > > > > On Tue, Mar 14, 2023 at 8:27 PM John Naylor > > > wrote: > > > > > > > > I wrote: > > > > > > > > > >

Re: Improve logging when using Huge Pages

2023-03-19 Thread Michael Paquier
On Mon, Mar 20, 2023 at 01:09:09AM -0400, Tom Lane wrote: > I'm confused here, because Horiguchi-san is saying that that > won't work. I've not checked the code lately, but I think that > "postgres -C var" prints its results before actually attempting > to establish shared memory, so I suspect

Re: Improve logging when using Huge Pages

2023-03-19 Thread Tom Lane
Michael Paquier writes: > On Tue, Mar 14, 2023 at 02:02:19PM +0900, Kyotaro Horiguchi wrote: >> I slightly prefer using a function for this, as if GUC is used, it can >> only return "unknown" for the command "postgres -C >> huge_page_active". However, apart from this advantage, I prefer using >>

Re: Improve logging when using Huge Pages

2023-03-19 Thread Michael Paquier
On Mon, Mar 20, 2023 at 01:54:46PM +0900, Michael Paquier wrote: > The main advantage of a read-only GUC over a function is that users > would not need to start a postmaster to know if huge pages would be > active or not. This is the main reason why a GUC would be a better > fit, in my opinion,

Re: Improve logging when using Huge Pages

2023-03-19 Thread Michael Paquier
On Tue, Mar 14, 2023 at 02:02:19PM +0900, Kyotaro Horiguchi wrote: > Regarding huge_page_active, its value remains constant throughout a > postmaster's lifespan. In this regard, GUC may be a better fit for > this information. The issue with using GUC for this value is that the > postgres command

Re: Initial Schema Sync for Logical Replication

2023-03-19 Thread Amit Kapila
On Thu, Mar 16, 2023 at 10:27 PM Kumar, Sachin wrote: > > > Hi, > > > > I have a couple of questions. > > > > Q1. > > > > What happens if the subscriber already has some tables present? For > > example, I did not see the post saying anything like "Only if the table does > > not already exist then

RE: Allow logical replication to copy tables in binary format

2023-03-19 Thread Hayato Kuroda (Fujitsu)
Dear Melih, Thank you for updating the patch. I checked your added description about initial data sync and I think it's OK. Few minor comments: 01. copy_table ``` + List *options = NIL; ``` I found a unnecessary blank just after "List". You can remove it and align definition.

Re: logical decoding and replication of sequences, take 2

2023-03-19 Thread Amit Kapila
On Sat, Mar 18, 2023 at 8:49 PM Tomas Vondra wrote: > > On 3/18/23 06:35, Amit Kapila wrote: > > On Sat, Mar 18, 2023 at 3:13 AM Tomas Vondra > > wrote: > >> > >> ... > >> > >> Clearly, for sequences we can't quite rely on snapshots/slots, we need > >> to get the LSN to decide what changes to

Re: Add pg_walinspect function with block info columns

2023-03-19 Thread Kyotaro Horiguchi
At Sat, 18 Mar 2023 10:08:53 +0530, Bharath Rupireddy wrote in > On Sat, Mar 18, 2023 at 1:06 AM Peter Geoghegan wrote: > > > > On Fri, Mar 17, 2023 at 12:20 AM Bharath Rupireddy > > wrote: > > > +1 for pg_get_wal_block_info emitting per-record WAL info too along > > > with block info,

Re: meson documentation build open issues

2023-03-19 Thread Andres Freund
Hi, On 2023-03-15 20:55:33 -0700, Andres Freund wrote: > WIP patch for that attached. There's now > install-doc-man > install-doc-html > run targets and a > install-docs > alias target. > > > I did end up getting stuck when hacking on this, and ended up adding css > support for nochunk

Re: Allow logical replication to copy tables in binary format

2023-03-19 Thread Amit Kapila
On Mon, Mar 20, 2023 at 3:37 AM Peter Smith wrote: > > There are a couple of TAP tests where the copy binary is expected to > fail. And when it fails, you do binary=false (changing the format back > to 'text') so the test is then expected to be able to proceed. > > I don't know if this happens in

Re: Lock conflict

2023-03-19 Thread David Rowley
On Mon, 20 Mar 2023 at 14:58, 席冲(宜穆) wrote: > I think lock requested only check for conflict with already-held lock, if > there is no conflict, the lock should be granted. That would mean that stronger locks such as AEL might never be granted if there was never any moment when no other

Lock conflict

2023-03-19 Thread 席冲(宜穆)
Hello all, This PostgreSQL version is 11.9. In LockAcquireExtended(), why if lock requested conflicts with locks requested by waiters, must join wait queue. Why does the lock still check for conflict with the lock requested, rather than check for directly with conflict with the already-held

Re: Commitfest 2023-03 starting tomorrow!

2023-03-19 Thread Thomas Munro
On Mon, Mar 20, 2023 at 1:10 PM Tom Lane wrote: > Thomas Munro writes: > > ... I suppose then someone might complain > > that it should be clearer if a patch hasn't applied for a very long > > time; suggestions for how to show that are welcome. > > Can you make the pop-up tooltip text read

RE: Data is copied twice when specifying both child and parent table in publication

2023-03-19 Thread wangw.f...@fujitsu.com
On Fri, Mar 17, 2023 at 20:07 PM Amit Kapila wrote: > On Fri, Mar 17, 2023 at 11:58 AM wangw.f...@fujitsu.com > wrote: > > > > On Thu, Mar 16, 2023 at 20:25 PM Amit Kapila > wrote: > > > > > > > Thanks for your comments. > > > > > + if (server_version >= 16) > > > + { > > > +

Re: ALTER TABLE SET ACCESS METHOD on partitioned tables

2023-03-19 Thread Michael Paquier
On Thu, Jun 09, 2022 at 11:21:58AM -0700, Soumyadeep Chakraborty wrote: > Thanks. Fixed and rebased. I think that I am OK with the concept of this patch to use a partitioned table's relam as a reference when creating a partition rather than relying on the default GUC, in a way similar to

Re: Commitfest 2023-03 starting tomorrow!

2023-03-19 Thread Tom Lane
Thomas Munro writes: > ... I suppose then someone might complain > that it should be clearer if a patch hasn't applied for a very long > time; suggestions for how to show that are welcome. Can you make the pop-up tooltip text read "Rebase needed since -MM-DD"?

Re: Commitfest 2023-03 starting tomorrow!

2023-03-19 Thread Thomas Munro
On Mon, Mar 20, 2023 at 11:13 AM Thomas Munro wrote: > I realised that part of Alvaro's complaint was probably caused by > cfbot's refusal to show any useful information just because it > couldn't apply a patch the last time it tried. A small improvement > today: now it shows a ♲ symbol (with

Re: Remove AUTH_REQ_KRB4 and AUTH_REQ_KRB5 in libpq code

2023-03-19 Thread Michael Paquier
On Sun, Mar 19, 2023 at 06:53:28PM -0400, Tom Lane wrote: > 9.2 is still within our "supported old versions" window, so it's > at least plausible that somebody would hit this for KRB5. Still, > the net effect would be that they'd get "authentication method 2 > not supported" instead of "Kerberos

Re: Reconcile stats in find_tabstat_entry() and get rid of PgStat_BackendFunctionEntry

2023-03-19 Thread Michael Paquier
On Thu, Mar 16, 2023 at 02:13:45PM +0100, Drouvot, Bertrand wrote: > On 3/16/23 12:46 PM, Michael Paquier wrote: >> There is no trace of them. >> Perhaps the ones exposted through pg_stat_xact_all_tables are fine if >> not listed. > > I'd be tempted to add documentation for all of them, I can

Re: Option to not use ringbuffer in VACUUM, using it in failsafe mode

2023-03-19 Thread Melanie Plageman
On Wed, Mar 15, 2023 at 6:46 AM Ants Aasma wrote: > > On Wed, 15 Mar 2023 at 02:29, Melanie Plageman > wrote: > > As for routine vacuuming and the other buffer access strategies, I think > > there is an argument for configurability based on operator knowledge -- > > perhaps your workload will

Re: Remove AUTH_REQ_KRB4 and AUTH_REQ_KRB5 in libpq code

2023-03-19 Thread Tom Lane
Michael Paquier writes: > $subject has been discussed here, still seems worth its own thread for > clarity: > https://www.postgresql.org/message-id/4037249.1679011...@sss.pgh.pa.us > Support for Kerberos v4 has been removed in a159ad3 (2005) and the > same happened for v5 in 98de86e (2014,

Re: Option to not use ringbuffer in VACUUM, using it in failsafe mode

2023-03-19 Thread Melanie Plageman
Thanks for the review! Attached is an updated v6. v6 has some updates and corrections. It has two remaining TODOs in the code: one is around what value to initialize the ring_size to in VacuumParams, the other is around whether or not parallel vacuum index workers should in fact stick with the

Re: Avoid use deprecated Windows Memory API

2023-03-19 Thread Michael Paquier
On Fri, Mar 17, 2023 at 12:19:56PM -0300, Ranier Vilela wrote: > Rebased to latest Head. I was looking at this thread, and echoing Daniel's and Alvaro's arguments, I don't quite see why this patch is something we need. I would recommend to mark it as rejected and move on. -- Michael

Remove AUTH_REQ_KRB4 and AUTH_REQ_KRB5 in libpq code

2023-03-19 Thread Michael Paquier
Hi all, $subject has been discussed here, still seems worth its own thread for clarity: https://www.postgresql.org/message-id/4037249.1679011...@sss.pgh.pa.us Support for Kerberos v4 has been removed in a159ad3 (2005) and the same happened for v5 in 98de86e (2014, meaning that this is still

Re: Commitfest 2023-03 starting tomorrow!

2023-03-19 Thread Thomas Munro
On Sun, Mar 19, 2023 at 12:44 PM Justin Pryzby wrote: > On Sat, Mar 18, 2023 at 04:28:02PM -0700, Peter Geoghegan wrote: > > On Sat, Mar 18, 2023 at 4:19 PM Justin Pryzby wrote: > > > The only issue with this is that cfbot has squished all the commits into > > > one, and lost the original commit

Re: Allow logical replication to copy tables in binary format

2023-03-19 Thread Peter Smith
There are a couple of TAP tests where the copy binary is expected to fail. And when it fails, you do binary=false (changing the format back to 'text') so the test is then expected to be able to proceed. I don't know if this happens in practice, but IIUC in theory, if the timing is extremely bad,

Re: Fix fseek() detection of unseekable files on WIN32

2023-03-19 Thread Michael Paquier
On Sun, Mar 19, 2023 at 08:10:10PM +0100, Juan José Santamaría Flecha wrote: > My approach was trying to make something minimal so it could be > backpatchable. This looks fine for HEAD, but are you planning on something > similar for the other branches? Yes. This is actually not invasive down to

Re: Infinite Interval

2023-03-19 Thread Joseph Koshakow
On Sun, Mar 19, 2023 at 5:13 PM Tom Lane wrote: > >Did you actually write "if TIMESTAMP_IS_NOBEGIN(dt2)" and not >"if (TIMESTAMP_IS_NOBEGIN(dt2))"? If the former, I'm not surprised >that pgindent gets confused. The parentheses are required by the >C standard. Your code might

Re: Infinite Interval

2023-03-19 Thread Tom Lane
Joseph Koshakow writes: > I must have been doing something wrong because I tried again today and > it worked fine. However, I go get a lot of changes like the following: > - if TIMESTAMP_IS_NOBEGIN(dt2) > - ereport(ERROR, > - >

Re: Commitfest 2023-03 starting tomorrow!

2023-03-19 Thread Tom Lane
Peter Eisentraut writes: > On 17.03.23 15:38, Tom Lane wrote: >>> Simplify find_my_exec by using realpath(3) >> The problem with this one is that Peter would like it to do something >> other than what I think it should do. Not sure how to resolve that. > I have no objection to changing the

Re: Infinite Interval

2023-03-19 Thread Joseph Koshakow
On Sat, Mar 18, 2023 at 3:55 PM Tom Lane wrote: > >Joseph Koshakow writes: >> On Sat, Mar 18, 2023 at 3:08 PM Tom Lane wrote: >>> More specifically, those are from running pg_indent with an obsolete >>> typedefs list. > >> I must be doing something wrong because even after

Re: Add SPLIT PARTITION/MERGE PARTITIONS commands

2023-03-19 Thread stephane tachoires
The following review has been posted through the commitfest application: make installcheck-world: tested, passed Implements feature: tested, passed Spec compliant: tested, passed Documentation:tested, failed Feature is clearly missing with partition handling in

Re: proposal: possibility to read dumped table's name from file

2023-03-19 Thread Pavel Stehule
ne 19. 3. 2023 v 15:01 odesílatel Justin Pryzby napsal: > On Thu, Mar 16, 2023 at 01:05:41PM +0100, Pavel Stehule wrote: > > rebase + enhancing about related option from a563c24 > > Thanks. > > It looks like this doesn't currently handle extensions, which were added > at 6568cef26e. > > > +

Re: Memory leak from ExecutorState context?

2023-03-19 Thread Justin Pryzby
On Fri, Mar 17, 2023 at 05:41:11PM +0100, Tomas Vondra wrote: > >> * Patch 2 is worth considering to backpatch > > I'm not quite sure what exactly are the numbered patches, as some of the > threads had a number of different patch ideas, and I'm not sure which > one was/is the most promising one.

Re: Fix fseek() detection of unseekable files on WIN32

2023-03-19 Thread Juan José Santamaría Flecha
On Sun, Mar 19, 2023 at 12:45 PM Michael Paquier wrote: > > In short, I was thinking among the lines of something like the > attached, where I have invented a pgwin32_get_file_type() that acts as > a wrapper of GetFileType() in a new file called win32common.c, with > all the error handling we

Re: Extending outfuncs support to utility statements

2023-03-19 Thread Tom Lane
Alexander Lakhin writes: > Please look at the function _readA_Const() (introduced in a6bc33019), which > fails on current master under valgrind: > ... > Here _readA_Const() performs: >     union ValUnion *tmp = nodeRead(NULL, 0); >     memcpy(_node->val, tmp,

Re: Should vacuum process config file reload more often

2023-03-19 Thread Melanie Plageman
On Sat, Mar 18, 2023 at 6:47 PM Melanie Plageman wrote: > On Wed, Mar 15, 2023 at 1:14 AM Masahiko Sawada wrote: > > On Sat, Mar 11, 2023 at 8:11 AM Melanie Plageman > > wrote: > > > > > Also not sure how the patch interacts with failsafe autovac and > > > > > parallel > > > > > vacuum. > > >

Re: buildfarm + meson

2023-03-19 Thread Andrew Dunstan
On 2023-03-18 Sa 21:32, Andrew Dunstan wrote: On 2023-03-18 Sa 19:00, Andres Freund wrote: Hi, On 2023-03-18 17:53:38 -0400, Andrew Dunstan wrote: On 2023-03-11 Sa 16:25, Andres Freund wrote: Hi, On 2023-03-09 18:31:10 -0500, Andrew Dunstan wrote: Another thing: the test for uuid.h is

Re: Commitfest 2023-03 starting tomorrow!

2023-03-19 Thread Peter Eisentraut
On 17.03.23 15:38, Tom Lane wrote: Simplify find_my_exec by using realpath(3) The problem with this one is that Peter would like it to do something other than what I think it should do. Not sure how to resolve that. I have no objection to changing the internal coding of the current

Re: proposal: possibility to read dumped table's name from file

2023-03-19 Thread Justin Pryzby
On Thu, Mar 16, 2023 at 01:05:41PM +0100, Pavel Stehule wrote: > rebase + enhancing about related option from a563c24 Thanks. It looks like this doesn't currently handle extensions, which were added at 6568cef26e. > + table_and_children: tables, works like > + -t/--table,

Re: pg_stat_statements and "IN" conditions

2023-03-19 Thread Dmitry Dolgov
> On Tue, Mar 14, 2023 at 08:04:32PM +0100, Dmitry Dolgov wrote: > > On Tue, Mar 14, 2023 at 02:14:17PM -0400, Gregory Stark (as CFM) wrote: > > So I was seeing that this patch needs a rebase according to cfbot. > > Yeah, folks are getting up to speed in with pgss improvements recently. > Thanks

Re: Extending outfuncs support to utility statements

2023-03-19 Thread Alexander Lakhin
Hello, 26.09.2022 17:46, Peter Eisentraut wrote: On 22.09.22 23:21, Tom Lane wrote: Anyway, this is a bit far afield from the stated topic of this thread.  I think we should commit something approximately like what I posted and then start a new thread specifically about what we'd like to do

Re: Fix fseek() detection of unseekable files on WIN32

2023-03-19 Thread Michael Paquier
On Sun, Mar 19, 2023 at 08:20:27PM +0900, Michael Paquier wrote: > I am not sure, TBH. As presented, the two GetFileType() calls in > _pgftello64() and _pgfseeko64() ignore the case where it returns > FILE_TYPE_UNKNOWN and GetLastError() has something else than > NO_ERROR. The code would return

server log inflates due to pg_logical_slot_peek_changes/pg_logical_slot_get_changes calls

2023-03-19 Thread Jeevan Ladhe
Hi, I observed absurd behaviour while using pg_logical_slot_peek_changes() and pg_logical_slot_get_changes(). Whenever any of these two functions are called to read the changes using a decoder plugin, the following messages are printed in the log for every single such call. 2023-03-19

Re: Fix fseek() detection of unseekable files on WIN32

2023-03-19 Thread Michael Paquier
On Thu, Mar 16, 2023 at 10:08:44AM +0100, Juan José Santamaría Flecha wrote: > IDK, this is just looking for the good case, anything else we'll fail with > ESPIPE or EINVAL anyway. If we want to get the proper file type we can call > fstat(), which has the full logic. I am not sure, TBH. As

Replace known_assigned_xids_lck by memory barrier

2023-03-19 Thread Michail Nikolaev
Hello everyone and Tom. Tom, this is about your idea (1) from 2010 to replace spinlock with a memory barrier in a known assignment xids machinery. It was mentioned by you again in (2) and in (3) we have decided to extract this change into a separate commitfest entry. So, creating it here with a

Re: heapgettup refactoring

2023-03-19 Thread David Rowley
On Wed, 8 Feb 2023 at 15:09, David Rowley wrote: > Using the tests mentioned in [1], I tested out > remove_HeapScanDescData_rs_inited_field.patch. It's not looking very > promising at all. In light of the performance regression from removing the rs_inited field, let's just forget doing that for

Re: MERGE ... WHEN NOT MATCHED BY SOURCE

2023-03-19 Thread Dean Rasheed
I see the PlaceHolderVar issue turned out to be a pre-existing bug after all. Rebased version attached. Regards, Dean diff --git a/doc/src/sgml/mvcc.sgml b/doc/src/sgml/mvcc.sgml new file mode 100644 index b87ad5c..1482ede --- a/doc/src/sgml/mvcc.sgml +++ b/doc/src/sgml/mvcc.sgml @@ -396,8 +396,8