Re: An inefficient query caused by unnecessary PlaceHolderVar

2023-05-31 Thread Richard Guo
On Wed, May 31, 2023 at 1:27 AM James Coleman wrote: > This looks good to me. Thanks for the review! > A few small tweaks suggested to comment wording: > > +-- lateral reference for simple Var can escape PlaceHolderVar if the > +-- referenced rel is under the same lowest nulling outer join >

RE: Support logical replication of DDLs

2023-05-31 Thread Yu Shi (Fujitsu)
On Wed, May 31, 2023 5:41 PM shveta malik wrote: > > PFA the set of patches consisting above changes. All the changes are > made in 0008 patch. > > Apart from above changes, many partition attach/detach related tests > are uncommented in alter_table.sql in patch 0008. > Thanks for updating

Re: ALTER TABLE SET ACCESS METHOD on partitioned tables

2023-05-31 Thread Justin Pryzby
On Thu, May 25, 2023 at 03:49:12PM +0900, Michael Paquier wrote: > looking at the patch. Here are a few comments. ... > * No need to add an explicit dependency for the toast table, as the > * main table depends on it. > */ > - if (RELKIND_HAS_TABLE_AM(relkind) &&

[BUG] pg_dump does not properly deal with BEGIN ATOMIC function

2023-05-31 Thread Imseih (AWS), Sami
Hi, What appears to be a pg_dump/pg_restore bug was observed with the new BEGIN ATOMIC function body syntax introduced in Postgres 14. Dependencies inside a BEGIN ATOMIC function cannot be resolved if those dependencies are dumped after the function body. The repro case is when a primary key

Re: generate syscache info automatically

2023-05-31 Thread Peter Eisentraut
On 31.05.23 13:02, Dagfinn Ilmari Mannsåker wrote: For other patterns without the optional bits in the keyword, it becomes even simpler, e.g. if (/^DECLARE_TOAST\(\s* (?\w+),\s* (?\d+),\s* (?\d+)\s*

Re: Docs: Encourage strong server verification with SCRAM

2023-05-31 Thread Michael Paquier
On Wed, May 31, 2023 at 10:08:39AM -0400, Jacob Champion wrote: > LGTM! Okay. Does anybody have any comments and/or objections? -- Michael signature.asc Description: PGP signature

Re: [PATCH] Support % wildcard in extension upgrade filenames

2023-05-31 Thread Sandro Santilli
On Thu, Apr 27, 2023 at 12:49:57PM +0200, Sandro Santilli wrote: > On Mon, Apr 24, 2023 at 01:06:24PM -0400, Mat Arye wrote: > > Hi All, > > > > I've done upgrade maintenance for multiple extensions now (TimescaleDB > > core, Promscale) and I think the original suggestion (wildcard filenames > >

Re: Support edit order of the fields in table

2023-05-31 Thread Laurenz Albe
On Thu, 2023-06-01 at 00:31 +0800, Chang Wei 昌維 wrote: > Hi Postgres community: I think support editing order of the fields in > table is a useful feature. I have known that the order of fields will > effect the data structure of rows data, but I think we could add a extra > information to

Re: Incremental View Maintenance, take 2

2023-05-31 Thread Yugo NAGATA
On Thu, 1 Jun 2023 23:59:09 +0900 Yugo NAGATA wrote: > Hello hackers, > > Here's a rebased version of the patch-set adding Incremental View > Maintenance support for PostgreSQL. That was discussed in [1]. > [1] >

Re: Why does pg_bsd_indent need to be installed?

2023-05-31 Thread Bruce Momjian
On Wed, May 31, 2023 at 01:21:05PM -0400, Tom Lane wrote: > Peter Eisentraut writes: > > On 25.05.23 13:05, Tom Lane wrote: > >> Well, if you know where the build directory is, sure. But any way you > >> slice it there is an extra bit of knowledge required. Since pg_bsd_indent > >> changes so

Re: Why does pg_bsd_indent need to be installed?

2023-05-31 Thread Tom Lane
Peter Eisentraut writes: > On 25.05.23 13:05, Tom Lane wrote: >> Well, if you know where the build directory is, sure. But any way you >> slice it there is an extra bit of knowledge required. Since pg_bsd_indent >> changes so seldom, keeping it in your PATH is at least as easy as any >> other

Re: [PATCH] Support % wildcard in extension upgrade filenames

2023-05-31 Thread Sandro Santilli
On Thu, May 18, 2023 at 11:14:52PM +0200, Przemysław Sztoch wrote: > For me, it would be a big help if you could specify a simple from/to range > as the source version: > myext--1.0.0-1.9.9--2.0.0.sql > myext--2.0.0-2.9.9--3.0.0.sql > myext--3.0.0-3.2.3--3.2.4.sql > > The idea of % wildcard in my

Re: generate syscache info automatically

2023-05-31 Thread Dagfinn Ilmari Mannsåker
Peter Eisentraut writes: > The idea was mentioned in [0]. genbki.pl already knows everything about > system catalog indexes. If we add a "please also make a syscache for > this one" flag to the catalog metadata, we can have genbki.pl produce > the tables in syscache.c and syscache.h

Re: Do we want a hashset type?

2023-05-31 Thread Tomas Vondra
On 5/31/23 17:40, Joel Jacobson wrote: > On Wed, May 31, 2023, at 16:53, Tomas Vondra wrote: >> I think this needs a better explanation - what exactly is a hashset in >> this context? Something like an array with a hash for faster lookup of >> unique elements, or what? > > In this context, by

Support edit order of the fields in table

2023-05-31 Thread Chang Wei 昌維
Hi Postgres community: I think support editing order of the fields in table is a useful feature. I have known that the order of fields will effect the data structure of rows data, but I think we could add a extra information to identify the display order of fields but not effect the rows data,

Re: Do we want a hashset type?

2023-05-31 Thread Joel Jacobson
On Wed, May 31, 2023, at 16:53, Tomas Vondra wrote: > I think this needs a better explanation - what exactly is a hashset in > this context? Something like an array with a hash for faster lookup of > unique elements, or what? In this context, by "hashset" I am indeed referring to a data structure

Re: Do we want a hashset type?

2023-05-31 Thread Tomas Vondra
On 5/31/23 16:09, Joel Jacobson wrote: > Hi, > > I've been working with a social network start-up that uses PostgreSQL as > their > only database. Recently, they became interested in graph databases, largely > because of an article [1] suggesting that a SQL database "just chokes" > when it >

Re: Refactor ssl tests to avoid using internal PostgreSQL::Test::Cluster methods

2023-05-31 Thread Daniel Gustafsson
> On 31 May 2023, at 15:46, Melih Mutlu wrote: > I was comparing this new restart function to start and stop functions. > I see that restart() does not return a value if it's successful while > others return 1. > Its return value is not checked anywhere, so it may not be useful at > the moment.

Do we want a hashset type?

2023-05-31 Thread Joel Jacobson
Hi, I've been working with a social network start-up that uses PostgreSQL as their only database. Recently, they became interested in graph databases, largely because of an article [1] suggesting that a SQL database "just chokes" when it encounters a depth-five friends-of-friends query (for a

Re: Docs: Encourage strong server verification with SCRAM

2023-05-31 Thread Jacob Champion
On Sun, May 28, 2023 at 2:22 PM Jonathan S. Katz wrote: > The above assumes that the reader reviewed the previous paragraph and > followed the guidelines there. However, we can make it explicit. Please > see attached. LGTM! Thanks, --Jacob

Re: Refactor ssl tests to avoid using internal PostgreSQL::Test::Cluster methods

2023-05-31 Thread Melih Mutlu
Hi Daniel, Thanks for the patch. Daniel Gustafsson , 31 May 2023 Çar, 15:48 tarihinde şunu yazdı: > > To avoid this, the attached adds fail_ok functionality to restart() which > makes > it easier to use it in tests, and aligns it with how stop() and start() works. > The resulting SSL tests are

Refactor ssl tests to avoid using internal PostgreSQL::Test::Cluster methods

2023-05-31 Thread Daniel Gustafsson
The SSL tests for pg_ctl restarts with an incorrect key passphrase run pg_ctl manually and use the internal method _update_pid to set the server PID file accordingly. This is needed since $node->restart will BAIL in case the restart fails, which clearly isn't useful to anyone wanting to test

Re: benchmark results comparing versions 15.2 and 16

2023-05-31 Thread Peter Geoghegan
Hi Mark, On Tue, May 30, 2023 at 1:03 PM MARK CALLAGHAN wrote: > Do you want me to try PG 16 without ICU or PG 15 with ICU? > I can do that, but it will take a few days before the server is available. Sorry for the late reply. Most of the Postgres developers (myself included) are attending

Re: WAL Insertion Lock Improvements

2023-05-31 Thread Michael Paquier
On Mon, May 22, 2023 at 09:26:25AM +0900, Michael Paquier wrote: > Simpler and consistent, nice. I don't have much more to add, so I > have switched the patch as RfC. While at PGcon, Andres has asked me how many sockets are in the environment I used for the tests, and lscpu tells me the

Re: PG 16 draft release notes ready

2023-05-31 Thread Bruce Momjian
On Wed, May 31, 2023 at 06:03:01PM +1200, David Rowley wrote: > I don't think this should go under "E.1.3.11. Source Code". The patch > was entirely aimed to increase performance, not just of allocations > themselves, but of any operations which uses palloc'd memory. This is > due to the patch

Re: Why does pg_bsd_indent need to be installed?

2023-05-31 Thread Peter Eisentraut
On 25.05.23 13:05, Tom Lane wrote: Well, if you know where the build directory is, sure. But any way you slice it there is an extra bit of knowledge required. Since pg_bsd_indent changes so seldom, keeping it in your PATH is at least as easy as any other solution, IMO. The reason I bumped

Re: testing dist tarballs

2023-05-31 Thread Peter Eisentraut
On 27.05.23 14:47, Andres Freund wrote: Separately, it's somewhat confusing that we include errcodes.h etc in src/backend/utils, rather than its final location, in src/include/utils. It works, even without perl, because copying the file doesn't require perl, it's just generating it... The

Re: Test slots invalidations in 035_standby_logical_decoding.pl only if dead rows are removed

2023-05-31 Thread Drouvot, Bertrand
Hi, On 5/30/23 12:34 PM, Drouvot, Bertrand wrote: Hi hackers, Please find attached a patch proposal to $SUBJECT. Indeed, we have seen occurrences in [1] that some slots were not invalidated (while we expected vacuum to remove dead rows leading to slots invalidation on the standby). Though we

RE: Support logical replication of DDLs

2023-05-31 Thread Wei Wang (Fujitsu)
On Tues, May 30, 2023 at 19:19 PM vignesh C wrote: > The attached patch has the changes for the above. Thanks for updating the new patch set. Here are some comments: === For patch 0001 1. In the function deparse_Seq_As. ``` + if (OidIsValid(seqdata->seqtypid)) +

Re: ERROR: wrong varnullingrels (b 3) (expected (b)) for Var 2/1

2023-05-31 Thread Markus Winand
> On 31.05.2023, at 08:36, Richard Guo wrote: > > Attached is a patch for that. Does this make sense? > > Thanks > Richard > All I can say is that it fixes the error for me — also for the non-simplified original query that I have. -markus

Re: ERROR: wrong varnullingrels (b 3) (expected (b)) for Var 2/1

2023-05-31 Thread Richard Guo
On Wed, May 31, 2023 at 10:47 AM Richard Guo wrote: > On Tue, May 30, 2023 at 10:48 PM Markus Winand > wrote: > >> I found an error similar to others before ([1]) that is still persists as >> of head right now (0bcb3ca3b9). >> >> CREATE TABLE t ( >> n INTEGER >> ); >> >> SELECT * >>

Re: [16Beta1][doc] pgstat: Track time of the last scan of a relation

2023-05-31 Thread David Rowley
On Wed, 31 May 2023 at 15:57, Shinoda, Noriyoshi (PN Japan FSIP) wrote: > According to the documentation [2], the data type of the columns added to > these views is 'timestamptz'. > However, columns of the same data type in pg_stat_all_tables.last_vacuum, > last_analyze and other tables are

Re: PG 16 draft release notes ready

2023-05-31 Thread David Rowley
On Wed, 31 May 2023 at 11:32, Bruce Momjian wrote: > > On Thu, May 25, 2023 at 05:57:25PM +1200, David Rowley wrote: > > On 64-bit builds, it was 16 bytes for AllocSet contexts, 24 bytes for > > generation contexts and 16 bytes for slab contexts. > > Okay, item added to Source Code: I don't