Re: Issue with point_ops and NaN

2021-03-30 Thread Kyotaro Horiguchi
At Wed, 31 Mar 2021 12:04:26 +0800, Julien Rouhaud wrote in > On Tue, Mar 30, 2021 at 11:39:40PM +0800, Julien Rouhaud wrote: > > On Tue, Mar 30, 2021 at 11:02:32AM -0400, Tom Lane wrote: > > > Julien Rouhaud writes: > > > > On Tue, Mar 30, 2021 at 02:47:05PM +0200, Laurenz Albe wrote: > > > >>

Re: Issue with point_ops and NaN

2021-03-30 Thread Kyotaro Horiguchi
At Wed, 31 Mar 2021 09:26:00 +0900, Michael Paquier wrote in > On Tue, Mar 30, 2021 at 11:39:40PM +0800, Julien Rouhaud wrote: > > On Tue, Mar 30, 2021 at 11:02:32AM -0400, Tom Lane wrote: > >> Agreed --- one could make an argument for either 'false' or NULL > >> result, but surely not 'true'. >

Re: [PATCH] add concurrent_abort callback for output plugin

2021-03-30 Thread Markus Wanner
On 31.03.21 06:39, Amit Kapila wrote: I have slightly adjusted the comments, docs, and commit message. What do you think about the attached? Thank you both, Amit and Ajin. This looks good to me. Only one minor gripe: + a prepared transaction with incomplete changes, in which case the +

Re: Remove page-read callback from XLogReaderState.

2021-03-30 Thread Kyotaro Horiguchi
At Wed, 31 Mar 2021 10:00:02 +1300, Thomas Munro wrote in > On Thu, Mar 4, 2021 at 3:29 PM Kyotaro Horiguchi > wrote: > > A recent commot about LSN_FORMAT_ARGS conflicted this. > > Just rebased. > > FYI I've been looking at this, and I think it's a very nice > improvement. I'll post some revi

Re: Idea: Avoid JOINs by using path expressions to follow FKs

2021-03-30 Thread Julien Rouhaud
On Wed, Mar 31, 2021 at 12:50:19AM +0200, Joel Jacobson wrote: > On Tue, Mar 30, 2021, at 22:01, Isaac Morland wrote: > > On Tue, 30 Mar 2021 at 15:33, Joel Jacobson wrote: > >>> Also, should the join be a left join, which would therefore return a NULL > >>> when there is no matching record? Or c

Re: Get memory contexts of an arbitrary backend process

2021-03-30 Thread Kyotaro Horiguchi
At Wed, 31 Mar 2021 15:02:02 +0900, torikoshia wrote in > On 2021-03-31 04:36, Fujii Masao wrote: > > On 2021/03/30 22:06, torikoshia wrote: > >> Modified the patch according to the suggestions. > > Thanks for updating the patch! > > I applied the cosmetic changes to the patch and added the exam

Re: Extensions not dumped when --schema is used

2021-03-30 Thread Guillaume Lelarge
Le mer. 31 mars 2021 à 02:37, Michael Paquier a écrit : > On Tue, Mar 30, 2021 at 12:02:45PM +0900, Michael Paquier wrote: > > Okay. So I have looked at that stuff in details, and after fixing > > all the issues reported upthread in the code, docs and tests I am > > finishing with the attached.

Re: making update/delete of inheritance trees scale better

2021-03-30 Thread Tom Lane
Amit Langote writes: > On Wed, Mar 31, 2021 at 11:56 AM Tom Lane wrote: >> ... I've complained before that apply_scanjoin_target_to_paths >> is brute-force and needs to be rewritten, but I don't really want to >> undertake that task right now. > I remember having *unsuccessfully* tried to make >

Re: Stronger safeguard for archive recovery not to miss data

2021-03-30 Thread Kyotaro Horiguchi
At Wed, 31 Mar 2021 15:03:28 +0900 (JST), Kyotaro Horiguchi wrote in > At Wed, 31 Mar 2021 02:11:48 +0900, Fujii Masao > wrote in > > > So, I would revert all the changes in xlog.c except changing the > > > warning to an error: > > > -    ereport(WARNING, > > > -    (errmsg("W

Re: Stronger safeguard for archive recovery not to miss data

2021-03-30 Thread Kyotaro Horiguchi
At Wed, 31 Mar 2021 02:11:48 +0900, Fujii Masao wrote in > > > On 2021/03/26 22:14, David Steele wrote: > > On 3/25/21 9:23 PM, Fujii Masao wrote: > >> > >> On 2021/03/25 23:21, David Steele wrote: > >>> On 1/25/21 3:55 AM, Laurenz Albe wrote: > On Mon, 2021-01-25 at 08:19 +, osumi.ta

Re: Replication slot stats misgivings

2021-03-30 Thread vignesh C
On Tue, Mar 30, 2021 at 11:00 AM Andres Freund wrote: > > Hi, > > On 2021-03-30 10:13:29 +0530, vignesh C wrote: > > On Tue, Mar 30, 2021 at 6:28 AM Andres Freund wrote: > > > Any chance you could write a tap test exercising a few of these cases? > > > > I can try to write a patch for this if nob

Re: PostmasterIsAlive() in recovery (non-USE_POST_MASTER_DEATH_SIGNAL builds)

2021-03-30 Thread Thomas Munro
On Fri, Mar 12, 2021 at 7:55 PM Thomas Munro wrote: > On Thu, Mar 11, 2021 at 7:34 PM Michael Paquier wrote: > > Wow. This probably means that we would be able to get rid of > > USE_POSTMASTER_DEATH_SIGNAL? > > We'll still need it, because there'd still be systems with no signal: > NetBSD, OpenB

Re: Get memory contexts of an arbitrary backend process

2021-03-30 Thread torikoshia
On 2021-03-31 04:36, Fujii Masao wrote: On 2021/03/30 22:06, torikoshia wrote: Modified the patch according to the suggestions. Thanks for updating the patch! I applied the cosmetic changes to the patch and added the example of the function call into the document. Attached is the updated vers

Re: extra semicolon in postgres_fdw test cases

2021-03-30 Thread Amit Kapila
On Wed, Mar 31, 2021 at 9:47 AM Amit Kapila wrote: > > On Wed, Mar 31, 2021 at 9:35 AM Michael Paquier wrote: > > > > On Tue, Mar 30, 2021 at 05:00:53PM +0530, Amit Kapila wrote: > > > Looks good to me as well but I think one can choose not to backpatch > > > as there is no functional impact but

Re: Stronger safeguard for archive recovery not to miss data

2021-03-30 Thread Kyotaro Horiguchi
At Wed, 31 Mar 2021 14:23:26 +0900 (JST), Kyotaro Horiguchi wrote in > I apologize in advance if I'm missing something. Oops! I missed the case of replica side. It's obviously useless that replica continue to run allowing a stopping gap made by wal_level=minimal. So, I don't object to this pa

Re: Stronger safeguard for archive recovery not to miss data

2021-03-30 Thread Kyotaro Horiguchi
At Wed, 31 Mar 2021 02:11:48 +0900, Fujii Masao wrote in > > > On 2021/03/26 22:14, David Steele wrote: > > On 3/25/21 9:23 PM, Fujii Masao wrote: > >> > >> On 2021/03/25 23:21, David Steele wrote: > >>> On 1/25/21 3:55 AM, Laurenz Albe wrote: > On Mon, 2021-01-25 at 08:19 +, osumi.ta

Re: Asynchronous Append on postgres_fdw nodes.

2021-03-30 Thread Etsuro Fujita
On Wed, Mar 31, 2021 at 10:11 AM Kyotaro Horiguchi wrote: > + async_capable > + > + > + This option controls whether postgres_fdw allows > + foreign tables to be scanned concurrently for asynchronous execution. > + It can be specified for a foreign table or a forei

Re: Use consistent terminology for tablesync slots.

2021-03-30 Thread Amit Kapila
On Wed, Mar 31, 2021 at 6:39 AM Peter Smith wrote: > > On Tue, Mar 30, 2021 at 8:14 PM Amit Kapila wrote: > > > > On Tue, Mar 30, 2021 at 2:21 PM Peter Smith wrote: > > > > > > Hi, > > > > > > The logical replication tablesync worker creates tablesync slots. > > > > > > Previously some PG docs p

Re: [PATCH] add concurrent_abort callback for output plugin

2021-03-30 Thread Amit Kapila
On Wed, Mar 31, 2021 at 6:42 AM Ajin Cherian wrote: > > Updated. > I have slightly adjusted the comments, docs, and commit message. What do you think about the attached? -- With Regards, Amit Kapila. v4-0001-Ensure-to-send-a-prepare-after-we-detect-concurre.patch Description: Binary data

Re: pg_amcheck contrib application

2021-03-30 Thread Mark Dilger
> On Mar 30, 2021, at 12:45 PM, Robert Haas wrote: > > On Mon, Mar 29, 2021 at 7:16 PM Mark Dilger > wrote: >> Sure, here are four patches which do the same as the single v12 patch did. > > Thanks. Here are some comments on 0003 and 0004: > > When you posted v11, you said that "Rather than p

Re: extra semicolon in postgres_fdw test cases

2021-03-30 Thread Amit Kapila
On Wed, Mar 31, 2021 at 9:35 AM Michael Paquier wrote: > > On Tue, Mar 30, 2021 at 05:00:53PM +0530, Amit Kapila wrote: > > Looks good to me as well but I think one can choose not to backpatch > > as there is no functional impact but OTOH, there is some value in > > keeping tests/code consistent.

Re: unconstrained memory growth in long running procedure stored procedure after upgrading 11-12

2021-03-30 Thread Justin Pryzby
On Tue, Mar 30, 2021 at 04:17:03PM -0500, Merlin Moncure wrote: > Instructions: > 1. run the attached script in psql, pgtask_test.sql. It will create a > database, initialize it, and run the main procedure. dblink must be > available > 2. in another window, run SELECT CreateTaskChain('test', 'DEV')

Re: What to call an executor node which lazily caches tuples in a hash table?

2021-03-30 Thread David Rowley
On Wed, 31 Mar 2021 at 14:43, Andy Fan wrote: > At last, I still want to vote for "Tuple(s) Cache", which sounds simple and > enough. > I was thinking if we need to put "Lazy" in the node name since we do build > cache > lazily, then I found we didn't call "Materialize" as "Lazy Materialize",

Re: extra semicolon in postgres_fdw test cases

2021-03-30 Thread Michael Paquier
On Tue, Mar 30, 2021 at 05:00:53PM +0530, Amit Kapila wrote: > Looks good to me as well but I think one can choose not to backpatch > as there is no functional impact but OTOH, there is some value in > keeping tests/code consistent. FWIW, I would not bother with the back branches for just that, bu

Re: Issue with point_ops and NaN

2021-03-30 Thread Julien Rouhaud
On Tue, Mar 30, 2021 at 11:39:40PM +0800, Julien Rouhaud wrote: > On Tue, Mar 30, 2021 at 11:02:32AM -0400, Tom Lane wrote: > > Julien Rouhaud writes: > > > On Tue, Mar 30, 2021 at 02:47:05PM +0200, Laurenz Albe wrote: > > >> I'd say that this is certainly wrong: > > >> SELECT point('NaN','NaN') <

Re: Proposal: Save user's original authenticated identity for logging

2021-03-30 Thread Michael Paquier
On Tue, Mar 30, 2021 at 05:06:51PM +, Jacob Champion wrote: > The key there is "if there is a failure" -- false positives need to be > debugged too. Tests I've worked with recently for the NSS work were > succeeding for the wrong reasons. Overly generic logfile matches ("SSL > error"), for exam

Re: Outdated comment for CreateStmt.inhRelations

2021-03-30 Thread Julien Rouhaud
On Wed, Mar 31, 2021 at 09:36:51AM +0900, Michael Paquier wrote: > On Tue, Mar 30, 2021 at 08:30:15PM +0800, Julien Rouhaud wrote: > > I just noticed that the comment for CreateStmt.inhRelations says that it's a > > List of inhRelation, which hasn't been the case for a very long time. > > Thanks,

Re: extra semicolon in postgres_fdw test cases

2021-03-30 Thread vignesh C
On Tue, Mar 30, 2021 at 3:21 PM Suraj Kharage wrote: > > Hi, > > Noticed that an extra semicolon in a couple of test cases related to > postgres_fdw. Removed that in the attached patch. It can be backported till > v11 where we added those test cases. > Thanks for identifying this, the changes l

Re: Lowering the ever-growing heap->pd_lower

2021-03-30 Thread Peter Geoghegan
On Wed, Mar 10, 2021 at 6:01 AM Matthias van de Meent wrote: > > The case I was concerned about back when is that there are various bits of > > code that may visit a page with a predetermined TID in mind to look at. > > An index lookup is an obvious example, and another one is chasing an > > updat

Re: DROP INDEX docs - explicit lock naming

2021-03-30 Thread Greg Rychlewski
Thanks for pointing that out. I've attached a new patch with several other updates where I felt confident the docs were referring to an ACCESS EXCLUSIVE lock. On Tue, Mar 30, 2021 at 8:47 PM Michael Paquier wrote: > On Tue, Mar 30, 2021 at 10:33:46AM -0400, Greg Rychlewski wrote: > > While readi

Re: making update/delete of inheritance trees scale better

2021-03-30 Thread Amit Langote
On Wed, Mar 31, 2021 at 11:56 AM Tom Lane wrote: > I noticed something else interesting. If you try an actually-useful > UPDATE, ie one that has to do some computation in the target list, > you can get a plan like this if it's a partitioned table: > > EXPLAIN (verbose, costs off) UPDATE parent SE

Re: Feature improvement: can we add queryId for pg_catalog.pg_stat_activity view?

2021-03-30 Thread Julien Rouhaud
On Thu, Mar 25, 2021 at 10:36:38AM +0800, Julien Rouhaud wrote: > On Wed, Mar 24, 2021 at 01:02:00PM -0300, Alvaro Herrera wrote: > > On 2021-Mar-24, Julien Rouhaud wrote: > > > > > From e08c9d5fc86ba722844d97000798de868890aba3 Mon Sep 17 00:00:00 2001 > > > From: Bruce Momjian > > > Date: Mon, 2

Re: Add missing function abs (interval)

2021-03-30 Thread Isaac Morland
I've attached a patch for this. Turns out there was a comment in the source explaining that there is no interval_abs because it's not clear what to return; but I think it's clear that if i is an interval the larger of i and -i should be considered to be the absolute value, the same as would be done

Re: multi-install PostgresNode fails with older postgres versions

2021-03-30 Thread Michael Paquier
On Tue, Mar 30, 2021 at 11:06:55PM -0300, Alvaro Herrera wrote: > On 2021-Mar-31, Michael Paquier wrote: >> There is already TestLib::check_pg_config(). Shouldn't you leverage >> that with PG_VERSION_NUM or equivalent? > > hmm, I wonder if we shouldn't take the stance that it is not TestLib's > b

Re: What to call an executor node which lazily caches tuples in a hash table?

2021-03-30 Thread David Rowley
On Wed, 31 Mar 2021 at 14:43, Andy Fan wrote: > When naming it, we may also think about some non native English speakers, so > some too advanced words may make them uncomfortable. Actually when I read > "Reactive", I googled to find what its meaning is. I knew reactive > programming, but I > d

Re: making update/delete of inheritance trees scale better

2021-03-30 Thread Tom Lane
I noticed something else interesting. If you try an actually-useful UPDATE, ie one that has to do some computation in the target list, you can get a plan like this if it's a partitioned table: EXPLAIN (verbose, costs off) UPDATE parent SET f2 = f2 + 1; QUERY PLAN

Re: making update/delete of inheritance trees scale better

2021-03-30 Thread Amit Langote
On Wed, Mar 31, 2021 at 7:13 AM Tom Lane wrote: > I wrote: > > However, I then tried a partitioned equivalent of the 6-column case > > (script also attached), and it looks like > > 6 columns 16551 19097 15637 18201 > > which is really noticeably worse, 16% or so. > > ... and on the third

Re: "box" type description

2021-03-30 Thread Kyotaro Horiguchi
At Mon, 29 Mar 2021 22:44:29 +0200, Christoph Berg wrote in > I believe the "box" type description is slightly incorrect: > > # \dT box > Liste der Datentypen >Schema │ Name │ Beschreibung > ┼──┼── >

Re: [PATCH v3 1/1] Fix detection of preadv/pwritev support for OSX.

2021-03-30 Thread James Hilliard
On Tue, Mar 30, 2021 at 7:51 PM Tom Lane wrote: > > Thomas Munro writes: > > Personally I'm mostly concerned about making it easy for new > > contributors to get a working dev system going on a super common > > platform without dealing with hard-to-diagnose errors, than people who > > actually wa

RE: libpq debug log

2021-03-30 Thread tsunakawa.ta...@fujitsu.com
From: 'alvhe...@alvh.no-ip.org' > > got expected ERROR: cannot insert multiple commands into a prepared > statement > > got expected division-by-zero > > Eh? this is not at all expected, of course, but clearly not PQtrace's > fault. I'll look tomorrow. Iwata-san and I were starting to investi

Re: multi-install PostgresNode fails with older postgres versions

2021-03-30 Thread Alvaro Herrera
On 2021-Mar-31, Michael Paquier wrote: > There is already TestLib::check_pg_config(). Shouldn't you leverage > that with PG_VERSION_NUM or equivalent? hmm, I wonder if we shouldn't take the stance that it is not TestLib's business to be calling any Pg binaries. So that routine should be moved t

Re: libpq debug log

2021-03-30 Thread 'alvhe...@alvh.no-ip.org'
On 2021-Mar-30, 'alvhe...@alvh.no-ip.org' wrote: > got expected ERROR: cannot insert multiple commands into a prepared statement > got expected division-by-zero Eh? this is not at all expected, of course, but clearly not PQtrace's fault. I'll look tomorrow. -- Álvaro Herrera

Re: Trouble with initdb trying to run regression tests

2021-03-30 Thread Isaac Morland
On Tue, 30 Mar 2021 at 18:39, Tom Lane wrote: > Isaac Morland writes: > > I've built Postgres inside a Ubuntu Vagrant VM. When I try to "make > check", > > I get a complaint about the permissions on the data directory: > [] > Further up in initdb.log, there was probably some useful informat

Re: [PATCH v3 1/1] Fix detection of preadv/pwritev support for OSX.

2021-03-30 Thread Tom Lane
Thomas Munro writes: > Personally I'm mostly concerned about making it easy for new > contributors to get a working dev system going on a super common > platform without dealing with hard-to-diagnose errors, than people who > actually want a different target as a deliberate choice. Do I > underst

Re: row filtering for logical replication

2021-03-30 Thread Euler Taveira
On Tue, Mar 30, 2021, at 8:23 AM, Amit Kapila wrote: > On Mon, Mar 29, 2021 at 6:47 PM Euler Taveira > wrote: > > > Few comments: > == > 1. How can we specify row filters for multiple tables for a > publication? Consider a case as below: It is not possible.

Re: What to call an executor node which lazily caches tuples in a hash table?

2021-03-30 Thread Andy Fan
On Wed, Mar 31, 2021 at 7:45 AM Zhihong Yu wrote: > Hi, > I was reading this part of the description: > > the Result Cache's > hash table is much smaller than the hash join's due to result cache only > caching useful values rather than all tuples from the inner side of the > join. > > I think the

Re: Refactor SSL test framework to support multiple TLS libraries

2021-03-30 Thread Michael Paquier
On Tue, Mar 30, 2021 at 12:15:07PM -0300, Alvaro Herrera wrote: > The only complain I have is that "the given node" is nonsensical in > PostgresNode. I suggest to delete the word "given". Also "This is > expected to fail with a message that matches the regular expression > $expected_stderr". You

Re: [PATCH v3 1/1] Fix detection of preadv/pwritev support for OSX.

2021-03-30 Thread James Hilliard
On Tue, Mar 30, 2021 at 6:43 PM Thomas Munro wrote: > > On Tue, Mar 30, 2021 at 7:39 PM James Hilliard > wrote: > > On Mon, Mar 29, 2021 at 11:58 PM Tom Lane wrote: > > > We haven't claimed in the past to support MACOSX_DEPLOYMENT_TARGET, > > > and I'm not sure we should start now. How many peo

Re: [PATCH] add concurrent_abort callback for output plugin

2021-03-30 Thread Ajin Cherian
On Tue, Mar 30, 2021 at 10:29 PM Markus Wanner wrote: > > I just noticed as of PG13, concurrent_abort is part of ReorderBufferTXN, > so it seems the prepare_cb (or stream_prepare_cb) can actually figure a > concurrent abort happened (and the transaction may be incomplete). > That's good and indee

Re: Asynchronous Append on postgres_fdw nodes.

2021-03-30 Thread Kyotaro Horiguchi
At Tue, 30 Mar 2021 20:40:35 +0900, Etsuro Fujita wrote in > On Mon, Mar 29, 2021 at 6:50 PM Etsuro Fujita wrote: > > I think the patch would be committable. > > Here is a new version of the patch. > > * Rebased the patch against HEAD. > * Tweaked docs/comments a bit further. > * Added the co

Re: Use consistent terminology for tablesync slots.

2021-03-30 Thread Peter Smith
On Tue, Mar 30, 2021 at 8:14 PM Amit Kapila wrote: > > On Tue, Mar 30, 2021 at 2:21 PM Peter Smith wrote: > > > > Hi, > > > > The logical replication tablesync worker creates tablesync slots. > > > > Previously some PG docs pages were referring to these as "tablesync > > slots", but other pages c

Re: Refactor SSL test framework to support multiple TLS libraries

2021-03-30 Thread Michael Paquier
On Tue, Mar 30, 2021 at 07:14:55PM -0300, Alvaro Herrera wrote: > On 2021-Mar-30, Daniel Gustafsson wrote: >> This double concatenation could be a single concat, or just use scalar value >> interpolation in the string to make it even more readable. As it isn't using >> the same line broken pattern

Re: multi-install PostgresNode fails with older postgres versions

2021-03-30 Thread Mark Dilger
> On Mar 30, 2021, at 5:52 PM, Michael Paquier wrote: > > On Tue, Mar 30, 2021 at 08:44:26PM -0400, Andrew Dunstan wrote: >> Yeah, it should be validated. All things considered I think just calling >> 'pg_config --version' is probably the simplest validation, and likely to >> be sufficient. >>

Re: multi-install PostgresNode fails with older postgres versions

2021-03-30 Thread Michael Paquier
On Tue, Mar 30, 2021 at 08:44:26PM -0400, Andrew Dunstan wrote: > Yeah, it should be validated. All things considered I think just calling > 'pg_config --version' is probably the simplest validation, and likely to > be sufficient. > > I'll try to come up with something tomorrow. There is already

Re: multi-install PostgresNode fails with older postgres versions

2021-03-30 Thread Mark Dilger
> On Mar 30, 2021, at 5:44 PM, Andrew Dunstan wrote: > > I'll try to come up with something tomorrow. I hope the patch I sent is useful, at least as a starting point. — Mark Dilger EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company

RE: libpq debug log

2021-03-30 Thread tsunakawa.ta...@fujitsu.com
From: 'alvhe...@alvh.no-ip.org' > Okay, pushed this patch and the new testing for it based on > libpq_pipeline. We'll see how the buildfarm likes it. Thank you very much! I appreciate you taking your valuable time while I imagine you must be pretty busy with taking care of other (possibly more

Re: DROP INDEX docs - explicit lock naming

2021-03-30 Thread Michael Paquier
On Tue, Mar 30, 2021 at 10:33:46AM -0400, Greg Rychlewski wrote: > While reading the documentation for DROP INDEX[1], I noticed the lock was > described colloquially as an "exclusive" lock, which made me pause for a > second because it's the same name as the EXCLUSIVE table lock. > > The attached

Re: Keep notnullattrs in RelOptInfo (Was part of UniqueKey patch series)

2021-03-30 Thread Andy Fan
> > I assume we want to know if a Var is nullable with a function like. > is_var_notnullable(Var *var, Relids relids). If so, we can define the > data as below: > > struct RelOptInfo { > > Bitmapset** notnullattrs; > .. > }; > > After this we can implement the function as: > > bool > is_var_notnu

Re: multi-install PostgresNode fails with older postgres versions

2021-03-30 Thread Andrew Dunstan
On 3/30/21 6:22 PM, Alvaro Herrera wrote: > On 2021-Mar-30, Mark Dilger wrote: > >> Once you have a node running, you can query the version using >> safe_psql, but that clearly doesn't work soon enough, since we need >> the information prior to running initdb. > I was thinking something like exam

Re: [PATCH v3 1/1] Fix detection of preadv/pwritev support for OSX.

2021-03-30 Thread Thomas Munro
On Tue, Mar 30, 2021 at 7:39 PM James Hilliard wrote: > On Mon, Mar 29, 2021 at 11:58 PM Tom Lane wrote: > > We haven't claimed in the past to support MACOSX_DEPLOYMENT_TARGET, > > and I'm not sure we should start now. How many people actually care > > about that? > > Seems kinda important for a

Re: multi-install PostgresNode fails with older postgres versions

2021-03-30 Thread Mark Dilger
> On Mar 30, 2021, at 3:22 PM, Alvaro Herrera wrote: > >> One of the things I noticed while playing with this new toy (thanks, >> Andrew!) is that if you pass a completely insane install_path, you >> don't get any errors. In fact, you get executables and libraries from >> whatever PATH="/no/su

cursor already in use, UPDATE RETURNING bug?

2021-03-30 Thread Jaime Casanova
Hi, Just noted an interesting behaviour when using a cursor in a function in an UPDATE RETURNING (note that INSERT RETURNING has no problem). I have seen this problem in all versions I tested (9.4 thru master). Steps to reproduce: prepare the test ``` create table t1 as select random() * foo i f

Re: Extensions not dumped when --schema is used

2021-03-30 Thread Michael Paquier
On Tue, Mar 30, 2021 at 12:02:45PM +0900, Michael Paquier wrote: > Okay. So I have looked at that stuff in details, and after fixing > all the issues reported upthread in the code, docs and tests I am > finishing with the attached. The tests have been moved out of > src/bin/pg_dump/ to src/test/m

Re: Outdated comment for CreateStmt.inhRelations

2021-03-30 Thread Michael Paquier
On Tue, Mar 30, 2021 at 08:30:15PM +0800, Julien Rouhaud wrote: > I just noticed that the comment for CreateStmt.inhRelations says that it's a > List of inhRelation, which hasn't been the case for a very long time. Thanks, applied. -- Michael signature.asc Description: PGP signature

Re: Issue with point_ops and NaN

2021-03-30 Thread Michael Paquier
On Tue, Mar 30, 2021 at 11:39:40PM +0800, Julien Rouhaud wrote: > On Tue, Mar 30, 2021 at 11:02:32AM -0400, Tom Lane wrote: >> Agreed --- one could make an argument for either 'false' or NULL >> result, but surely not 'true'. > > I would think that it should return NULL since it's not inside nor o

Re: libpq debug log

2021-03-30 Thread 'alvhe...@alvh.no-ip.org'
So crake failed. The failure is that it doesn't print the DataRow messages. That's quite odd. We see this in the trace log: Mar 30 20:05:15 # F 54 Parse"" "SELECT 1.0/g FROM generate_series(3, -1, -1) g" 0 Mar 30 20:05:15 # F 12 Bind "" "" 0 0 0 Mar 30 20:05:15 # F

Re: "has_column_privilege()" issue with attnums and non-existent columns

2021-03-30 Thread Joe Conway
On 3/30/21 6:22 PM, Tom Lane wrote: Joe Conway writes: Heh, I missed the forest for the trees it seems. That version undid the changes fixing what Ian was originally complaining about. Duh, right. It would be a good idea for there to be a code comment explaining this, because it's *far* from

Re: unconstrained memory growth in long running procedure stored procedure after upgrading 11-12

2021-03-30 Thread Tom Lane
Justin Pryzby writes: > On Tue, Mar 30, 2021 at 04:17:03PM -0500, Merlin Moncure wrote: >> We just upgraded from postgres 11 to 12.6 and our server is running >> out of memory and rebooting about 1-2 times a day. > I haven't tried your test, but this sounds a lot like the issue I reported > with

Re: libpq debug log

2021-03-30 Thread 'alvhe...@alvh.no-ip.org'
Okay, pushed this patch and the new testing for it based on libpq_pipeline. We'll see how the buildfarm likes it. I made some further changes to the last version; user-visibly, I split the trace flags in two, keeping the timestamp suppression separate from the redacting feature for regression tes

Re: unconstrained memory growth in long running procedure stored procedure after upgrading 11-12

2021-03-30 Thread Justin Pryzby
On Tue, Mar 30, 2021 at 04:17:03PM -0500, Merlin Moncure wrote: > Hello all, > > We just upgraded from postgres 11 to 12.6 and our server is running > out of memory and rebooting about 1-2 times a day.Application > architecture is a single threaded stored procedure, executed with CALL > that l

Re: What to call an executor node which lazily caches tuples in a hash table?

2021-03-30 Thread Zhihong Yu
Hi, I was reading this part of the description: the Result Cache's hash table is much smaller than the hash join's due to result cache only caching useful values rather than all tuples from the inner side of the join. I think the word 'Result' should be part of the cache name considering the abov

What to call an executor node which lazily caches tuples in a hash table?

2021-03-30 Thread David Rowley
Hackers, Over on [1] I've been working on adding a new type of executor node which caches tuples in a hash table belonging to a given cache key. The current sole use of this node type is to go between a parameterized nested loop and the inner node in order to cache previously seen sets of paramet

Re: Proposal: Save user's original authenticated identity for logging

2021-03-30 Thread Jacob Champion
On Tue, 2021-03-30 at 17:06 +, Jacob Champion wrote: > Would it be acceptable to adjust the tests for live rotation using the > logging collector, rather than a full restart? It would unfortunately > mean that we have to somehow wait for the rotation to complete, since > that's asynchronous. I

Re: Idea: Avoid JOINs by using path expressions to follow FKs

2021-03-30 Thread Joel Jacobson
On Tue, Mar 30, 2021, at 22:01, Isaac Morland wrote: > On Tue, 30 Mar 2021 at 15:33, Joel Jacobson wrote: >>> Also, should the join be a left join, which would therefore return a NULL >>> when there is no matching record? Or could we have a variation such as ->? >>> to give a left join (NULL whe

Re: Trouble with initdb trying to run regression tests

2021-03-30 Thread Tom Lane
Isaac Morland writes: > I've built Postgres inside a Ubuntu Vagrant VM. When I try to "make check", > I get a complaint about the permissions on the data directory: > vagrant@ubuntu-focal:/vagrant$ tail /vagrant/src/test/regress/log/initdb.log > creating subdirectories ... ok > selecting dynamic

Re: "has_column_privilege()" issue with attnums and non-existent columns

2021-03-30 Thread Tom Lane
Joe Conway writes: > Heh, I missed the forest for the trees it seems. > That version undid the changes fixing what Ian was originally complaining > about. Duh, right. It would be a good idea for there to be a code comment explaining this, because it's *far* from obvious. Say like * Ch

Re: multi-install PostgresNode fails with older postgres versions

2021-03-30 Thread Alvaro Herrera
On 2021-Mar-30, Mark Dilger wrote: > Once you have a node running, you can query the version using > safe_psql, but that clearly doesn't work soon enough, since we need > the information prior to running initdb. I was thinking something like examining some file in the install dir -- say, include/

Re: multi-install PostgresNode fails with older postgres versions

2021-03-30 Thread Mark Dilger
> On Mar 30, 2021, at 3:12 PM, Alvaro Herrera wrote: > > On 2021-Mar-30, Mark Dilger wrote: > >> The problem is clear enough; -N/--nosync was added in 9.3, and >> PostgresNode::init is passing -N to initdb unconditionally. I wonder >> if during PostgresNode::new a call should be made to pg_co

Re: Refactor SSL test framework to support multiple TLS libraries

2021-03-30 Thread Alvaro Herrera
On 2021-Mar-30, Daniel Gustafsson wrote: > +$node->connect_ok($common_connstr . " " . "user=ssltestuser", > > This double concatenation could be a single concat, or just use scalar value > interpolation in the string to make it even more readable. As it isn't using > the same line broken pattern

Re: making update/delete of inheritance trees scale better

2021-03-30 Thread Tom Lane
I wrote: > However, I then tried a partitioned equivalent of the 6-column case > (script also attached), and it looks like > 6 columns 16551 19097 15637 18201 > which is really noticeably worse, 16% or so. ... and on the third hand, that might just be some weird compiler- and platform-sp

Re: multi-install PostgresNode fails with older postgres versions

2021-03-30 Thread Alvaro Herrera
On 2021-Mar-30, Mark Dilger wrote: > The problem is clear enough; -N/--nosync was added in 9.3, and > PostgresNode::init is passing -N to initdb unconditionally. I wonder > if during PostgresNode::new a call should be made to pg_config and the > version information grep'd out so that version speci

Re: Refactor SSL test framework to support multiple TLS libraries

2021-03-30 Thread Daniel Gustafsson
> On 30 Mar 2021, at 11:53, Michael Paquier wrote: > > On Tue, Mar 30, 2021 at 03:50:28PM +0900, Michael Paquier wrote: >> The test_*() ones are just wrappers for psql able to use a customized >> connection string. It seems to me that it would make sense to move >> those two into PostgresNode::p

Re: SQL/JSON: JSON_TABLE

2021-03-30 Thread Erik Rijkers
> On 2021.03.30. 22:25 Nikita Glukhov wrote: > > > On 30.03.2021 19:56, Erik Rijkers wrote: > > >> On 2021.03.27. 02:12 Nikita Glukhov wrote: > >> > >> Attached 47th version of the patches. > > Hi, > > > > Apply, build all fine. It also works quite well, and according to > > specification

Trouble with initdb trying to run regression tests

2021-03-30 Thread Isaac Morland
I've built Postgres inside a Ubuntu Vagrant VM. When I try to "make check", I get a complaint about the permissions on the data directory: [] pg_regress: initdb failed Examine /vagrant/src/test/regress/log/initdb.log for the reason. Command was: "initdb" -D "/vagrant/src/test/regress/./tmp_che

Re: multi-install PostgresNode fails with older postgres versions

2021-03-30 Thread Mark Dilger
> On Mar 30, 2021, at 10:39 AM, Mark Dilger > wrote: > > Andrew, > > While developing some cross version tests, I noticed that PostgresNode::init > fails for postgres versions older than 9.3, like so: > > # Checking port 52814 > # Found port 52814 > Name: 9.2.24 > Data directory: > /Users/

unconstrained memory growth in long running procedure stored procedure after upgrading 11-12

2021-03-30 Thread Merlin Moncure
Hello all, We just upgraded from postgres 11 to 12.6 and our server is running out of memory and rebooting about 1-2 times a day.Application architecture is a single threaded stored procedure, executed with CALL that loops and never terminates. With postgres 11 we had no memory issues. Ultima

Re: Remove page-read callback from XLogReaderState.

2021-03-30 Thread Thomas Munro
On Thu, Mar 4, 2021 at 3:29 PM Kyotaro Horiguchi wrote: > A recent commot about LSN_FORMAT_ARGS conflicted this. > Just rebased. FYI I've been looking at this, and I think it's a very nice improvement. I'll post some review comments and a rebase shortly.

Re: SQL/JSON: JSON_TABLE

2021-03-30 Thread Nikita Glukhov
On 30.03.2021 19:56, Erik Rijkers wrote: On 2021.03.27. 02:12 Nikita Glukhov wrote: Attached 47th version of the patches. Hi, Apply, build all fine. It also works quite well, and according to specification, as far as I can tell. But today I ran into: ERROR: function ExecEvalJson not in

Re: "has_column_privilege()" issue with attnums and non-existent columns

2021-03-30 Thread Joe Conway
On 3/30/21 3:37 PM, Joe Conway wrote: On 3/21/21 12:27 PM, Tom Lane wrote: I think we may have to adjust the acl.c APIs, or maybe better provide new entry points, so that we can have variants of pg_xxx_aclcheck that won't throw a hard error upon not finding the row. We cheesily tried to avoid a

Re: "has_column_privilege()" issue with attnums and non-existent columns

2021-03-30 Thread Tom Lane
Joe Conway writes: > On 3/21/21 12:27 PM, Tom Lane wrote: >> I think we may have to adjust the acl.c APIs, or maybe better provide new >> entry points, so that we can have variants of pg_xxx_aclcheck that won't >> throw a hard error upon not finding the row. We cheesily tried to avoid >> adjustin

Re: Idea: Avoid JOINs by using path expressions to follow FKs

2021-03-30 Thread Isaac Morland
On Tue, 30 Mar 2021 at 15:33, Joel Jacobson wrote: > Also, should the join be a left join, which would therefore return a NULL > when there is no matching record? Or could we have a variation such as ->? > to give a left join (NULL when no matching record) with -> using an inner > join (record is

Re: pg_amcheck contrib application

2021-03-30 Thread Robert Haas
On Mon, Mar 29, 2021 at 7:16 PM Mark Dilger wrote: > Sure, here are four patches which do the same as the single v12 patch did. Thanks. Here are some comments on 0003 and 0004: When you posted v11, you said that "Rather than print out all four toast pointer fields for each toast failure, va_raws

Re: pgbench - add pseudo-random permutation function

2021-03-30 Thread Dean Rasheed
On Tue, 30 Mar 2021 at 20:31, Dean Rasheed wrote: > > Yeah, that's probably a fair point. However, all the existing pgbench > random functions are using it, so I think it's fair enough for > permute() to do the same (and actually 2^48 is pretty huge). Switching > to a 64-bit PRNG might not be a ba

Re: "has_column_privilege()" issue with attnums and non-existent columns

2021-03-30 Thread Joe Conway
On 3/21/21 12:27 PM, Tom Lane wrote: I think we may have to adjust the acl.c APIs, or maybe better provide new entry points, so that we can have variants of pg_xxx_aclcheck that won't throw a hard error upon not finding the row. We cheesily tried to avoid adjusting those APIs to support the sema

Re: Get memory contexts of an arbitrary backend process

2021-03-30 Thread Fujii Masao
On 2021/03/30 22:06, torikoshia wrote: Modified the patch according to the suggestions. Thanks for updating the patch! I applied the cosmetic changes to the patch and added the example of the function call into the document. Attached is the updated version of the patch. Could you check this

Re: Idea: Avoid JOINs by using path expressions to follow FKs

2021-03-30 Thread Joel Jacobson
On Tue, Mar 30, 2021, at 21:02, Isaac Morland wrote: > On Tue, 30 Mar 2021 at 14:30, Joel Jacobson wrote: > >> __ >> If the expression ends with a column_name, >> you get the value for the column. >> >> If the expression ends with a constraint_name, >> you get the referenced table as a record. >

Re: pgbench - add pseudo-random permutation function

2021-03-30 Thread Dean Rasheed
On Tue, 30 Mar 2021 at 19:26, Fabien COELHO wrote: > > First, I have a thing against erand48. Yeah, that's probably a fair point. However, all the existing pgbench random functions are using it, so I think it's fair enough for permute() to do the same (and actually 2^48 is pretty huge). Switching

Bug? pg_identify_object_as_address() et al doesn't work with pg_enum.oid

2021-03-30 Thread Joel Jacobson
Hi, Some catalog oid values originate from other catalogs, such as pg_aggregate.aggfnoid -> pg_proc.oid or pg_attribute.attrelid -> pg_class.oid. For such oid values, the foreign catalog is the regclass which should be passed as the first argument to all the functions taking (classid oid, objid o

Re: SELECT INTO deprecation

2021-03-30 Thread Jan Wieck
On 12/15/20 5:13 PM, Bruce Momjian wrote: On Wed, Dec 9, 2020 at 09:48:54PM +0100, Peter Eisentraut wrote: On 2020-12-03 20:26, Peter Eisentraut wrote: > On 2020-12-03 16:34, Tom Lane wrote: > > As I recall, a whole lot of the pain we have with INTO has to do > > with the semantics we've chosen

Re: Support tab completion for upper character inputs in psql

2021-03-30 Thread David Zhang
Hi Tang, Thanks a lot for the patch. I did a quick test based on the latest patch V3 on latest master branch "commit 4753ef37e0eda4ba0af614022d18fcbc5a946cc9". Case 1: before patch   1 postgres=# set a   2 all  allow_system_table_mods application_name array_nulls

  1   2   >