Re: Use pg_pwritev_with_retry() instead of write() in dir_open_for_write() to avoid partial writes?

2022-10-28 Thread Bharath Rupireddy
On Sat, Oct 29, 2022 at 3:37 AM Andres Freund wrote: > > Hi, > > On 2022-10-28 11:09:38 +0900, Michael Paquier wrote: > > On Thu, Oct 27, 2022 at 03:58:25PM -0700, Andres Freund wrote: > > > The block sizes don't need to match, do they? As long as the block is > > > properly > > > aligned, we can

Re: Adding doubly linked list type which stores the number of items in the list

2022-10-28 Thread Bharath Rupireddy
On Fri, Oct 28, 2022 at 11:01 AM David Rowley wrote: > > > 3. Just thinking if we need to move dlist_is_memberof() check from > > dclist_* functions to dlist_* functions, because they also need such > > insurance against callers passing spurious nodes. > > I think the affected functions there woul

Re: explain_regress, explain(MACHINE), and default to explain(BUFFERS) (was: BUFFERS enabled by default in EXPLAIN (ANALYZE))

2022-10-28 Thread Justin Pryzby
On Tue, Oct 25, 2022 at 03:49:14PM +0200, Laurenz Albe wrote: > On Thu, 2022-10-20 at 21:09 -0500, Justin Pryzby wrote: > > Rebased. > > I had a look at the patch set. Thanks for looking > @@ -2288,6 +2288,7 @@ regression_main(int argc, char *argv[], > fputs("log_lock_waits = on\n",

Re: [PATCHES] Post-special page storage TDE support

2022-10-28 Thread David Christensen
Hi Matthias, > Did you read the related thread with related discussion from last June, "Re: > better page-level checksums" [0]? In that I argued that space at the end of a > page is already allocated for the AM, and that reserving variable space at > the end of the page for non-AM usage is wast

Re: Use pg_pwritev_with_retry() instead of write() in dir_open_for_write() to avoid partial writes?

2022-10-28 Thread Andres Freund
Hi, On 2022-10-28 11:09:38 +0900, Michael Paquier wrote: > On Thu, Oct 27, 2022 at 03:58:25PM -0700, Andres Freund wrote: > > The block sizes don't need to match, do they? As long as the block is > > properly > > aligned, we can change the iov_len of the final iov to match whatever the > > size

Re: Error for WITH options on partitioned tables

2022-10-28 Thread David Zhang
Hi Karina, I am not very clear about why `build_reloptions` is removed in patch `v2-0002-better-error-message-for-setting-parameters-for-p.patch`, if you can help explain would be great. From my observation, it seems the WITH option has different behavior when creating partitioned table and

Segfault on logical replication to partitioned table with foreign children

2022-10-28 Thread ilya . v . gladyshev
Hi, Right now it is possible to add a partitioned table with foreign tables as its children as a target of a subscription. It can lead to an assert (or a segfault, if compiled without asserts) on a logical replication worker when the worker attempts to insert the data received via replication into

Re: cross-platform pg_basebackup

2022-10-28 Thread Robert Haas
On Sun, Oct 23, 2022 at 10:44 PM Julien Rouhaud wrote: > On Fri, Oct 21, 2022 at 09:15:39AM -0400, Robert Haas wrote: > > Committed and back-patched to all supported branches. > > Is there any additional things to be taken care of or should > https://commitfest.postgresql.org/40/3954/ be closed?

Re: Documentation for building with meson

2022-10-28 Thread Jacob Champion
On Thu, Oct 27, 2022 at 4:03 PM Andres Freund wrote: > Tests can have dependencies, and they're correctly built. The problem however > is that, for historical reasons if I understand correctly, dependencies of > tests are automatically included in the default 'all' target. Which means if > you jus

Re: Transparent column encryption

2022-10-28 Thread Frédéric Yhuel
Hi, Here are a few more things I noticed : If a CEK is encrypted with cmk1 and cmk2, but cmk1 isn't found on the client,the following error is printed twice for the very first SELECT statement: could not open file "/path/to/cmk1.pem": No such file or directory ...and nothing is returned.

Re: psql: Add command to use extended query protocol

2022-10-28 Thread Tom Lane
Michael Paquier writes: > On Fri, Oct 28, 2022 at 08:52:51AM +0200, Peter Eisentraut wrote: >> Two, for testing the extended query protocol from psql. For example, for >> the dynamic result sets patch [1], I have several ad-hoc libpq test programs >> lying around, which would be cumbersome to int

Re: psql: Add command to use extended query protocol

2022-10-28 Thread Justin Pryzby
On Fri, Oct 28, 2022 at 08:52:51AM +0200, Peter Eisentraut wrote: > Perhaps this would also be useful for general psql scripting. +1 It makes great sense to that psql would support it (I've suggested to a few people over the last few years to do that using pygres, lacking an easier way). I wonde

Re: Proposal to use JSON for Postgres Parser format

2022-10-28 Thread Andrew Dunstan
On 2022-10-27 Th 19:38, Andres Freund wrote: > Hi, > > On 2022-09-19 22:29:15 -0400, Tom Lane wrote: >> Maybe a compromise could be found whereby we provide a conversion function >> that converts whatever the catalog storage format is to some JSON >> equivalent. That would address the needs of e

Re: Improve tab completion for ALTER FUNCTION/PROCEDURE/ROUTINE

2022-10-28 Thread vignesh C
On Fri, 28 Oct 2022 at 08:02, Dong Wook Lee wrote: > > On Fri, Oct 28, 2022 at 12:08 AM vignesh C wrote: > > > > Hi, > > > > Tab completion for ALTER FUNCTION/PROCEDURE/ROUTINE action was > > missing, this patch adds the tab completion for the same. > > > > Regards, > > Vignesh > > Hi, > I applie

Re: Fast COPY FROM based on batch insert

2022-10-28 Thread Andrey Lepikhov
On 28/10/2022 16:12, Etsuro Fujita wrote: On Thu, Oct 13, 2022 at 6:58 PM Etsuro Fujita wrote: I have committed the patch after tweaking comments a little bit further. I think there is another patch that improves performance of COPY FROM for foreign tables using COPY FROM STDIN, but if Andrey

Re: Use LIMIT instead of Unique for DISTINCT when all distinct pathkeys are redundant

2022-10-28 Thread David Rowley
On Thu, 27 Oct 2022 at 15:50, Richard Guo wrote: > I find the duplicate "Limit" node is not that concerning after I realize > it may appear in other queries, such as > > explain (analyze, timing off, costs off) > select * from (select * from (select * from generate_series(1,100)i limit 10) > limi

Re: Transparent column encryption

2022-10-28 Thread Jehan-Guillaume de Rorthais
Hi, I did a review of the documentation and usability. # Applying patch The patch applied on top of f13b2088fa2 without trouble. Notice a small warning during compilation: colenccmds.c:134:27: warning: ‘encval’ may be used uninitialized A simple fix could be: +++ b/src/bac

Re: Fast COPY FROM based on batch insert

2022-10-28 Thread Etsuro Fujita
On Thu, Oct 13, 2022 at 6:58 PM Etsuro Fujita wrote: > I have committed the patch after tweaking comments a little bit further. I think there is another patch that improves performance of COPY FROM for foreign tables using COPY FROM STDIN, but if Andrey (or anyone else) want to work on it again,

RE: Perform streaming logical transactions by background workers and parallel apply

2022-10-28 Thread shiy.f...@fujitsu.com
On Tue, Oct 25, 2022 2:56 PM Wang, Wei/王 威 wrote: > > On Tues, Oct 25, 2022 at 14:28 PM Peter Smith > wrote: > > FYI - After a recent push, the v40-0001 patch no longer applies on the > > latest HEAD. > > > > [postgres@CentOS7-x64 oss_postgres_misc]$ git apply > > ../patches_misc/v40-0001-Perfor

Re: Code checks for App Devs, using new options for transaction behavior

2022-10-28 Thread Simon Riggs
On Fri, 28 Oct 2022 at 07:54, Erik Rijkers wrote: > > Op 27-10-2022 om 18:35 schreef Simon Riggs: > > On Thu, 27 Oct 2022 at 12:09, Simon Riggs > > wrote: > > > >> Comments please > > > > Update from patch tester results. > > > > > [001_psql_parse_only.v1.patch ] > > [002_nested_xacts.v7.p

Re: Use pg_pwritev_with_retry() instead of write() in dir_open_for_write() to avoid partial writes?

2022-10-28 Thread Michael Paquier
On Fri, Oct 28, 2022 at 11:38:51AM +0530, Bharath Rupireddy wrote: > +1. Please see the attached v8 patch. + chardata[PG_WRITE_BLCKSZ]; + double force_align_d; + int64 force_align_i64; +} PGAlignedWriteBlock; I have not checked in details, but that should do the job. Andr

Re: Simplifying our Trap/Assert infrastructure

2022-10-28 Thread Peter Eisentraut
On 27.10.22 09:23, Michael Paquier wrote: Agreed, even if extensions could use these, it looks like any out-of-core code using what's removed here would also gain in clarity. This is logically fine (except for an indentation blip in miscadmin.h?), so I have marked this entry as ready for committe

Re: psql: Add command to use extended query protocol

2022-10-28 Thread Michael Paquier
On Fri, Oct 28, 2022 at 08:52:51AM +0200, Peter Eisentraut wrote: > Two, for testing the extended query protocol from psql. For example, for > the dynamic result sets patch [1], I have several ad-hoc libpq test programs > lying around, which would be cumbersome to integrate into the patch. With >

Re: GUC values - recommended way to declare the C variables?

2022-10-28 Thread Michael Paquier
On Fri, Oct 28, 2022 at 11:48:13AM +0900, Michael Paquier wrote: > Thanks. I have not looked at the checkup logic yet, but the central > declarations seem rather sane, and I have a few comments about the > latter. So, I've had the energy to look at the check logic today, and noticed that, while t