Re: Cache relation sizes?

2020-12-16 Thread Thomas Munro
Hi Andy, On Thu, Dec 17, 2020 at 7:29 PM Andy Fan wrote: > I spent one day studying the patch and I want to talk about one question for > now. > What is the purpose of calling smgrimmedsync to evict a DIRTY sr (what will > happen > if we remove it and the SR_SYNCING and SR_JUST_DIRTIED flags)?

Re: [HACKERS] logical decoding of two-phase transactions

2020-12-16 Thread Masahiko Sawada
On Wed, Dec 16, 2020 at 6:22 PM Amit Kapila wrote: > > On Wed, Dec 16, 2020 at 1:04 PM Masahiko Sawada wrote: > > > > Thank you for updating the patch. I have two questions: > > > > - > > @@ -239,6 +239,19 @@ CREATE SUBSCRIPTION > class="parameter">subscription_name > > >

Re: row filtering for logical replication

2020-12-16 Thread Önder Kalacı
Hi all, I'm also interested in this patch. I rebased the changes to the current master branch and attached. The rebase had two issues. First, patch-8 was conflicting, and that seems only helpful for debugging purposes during development. So, I dropped it for simplicity. Second, the changes have a

Re: On login trigger: take three

2020-12-16 Thread Pavel Stehule
st 16. 12. 2020 v 20:38 odesílatel Pavel Stehule napsal: > Attached please find new versoin of the patch based on > on_connect_event_trigger_WITH_SUGGESTED_UPDATES.patch > >> So there is still only "disable_client_connection_trigger" GUC? because >> we need possibility to disable client connect

Re: Cache relation sizes?

2020-12-16 Thread Andy Fan
On Thu, Nov 19, 2020 at 1:02 PM Thomas Munro wrote: > On Tue, Nov 17, 2020 at 10:48 PM Amit Kapila > wrote: > > Yeah, it is good to verify VACUUM stuff but I have another question > > here. What about queries having functions that access the same > > relation (SELECT c1 FROM t1 WHERE c1 <= func(

Re: [HACKERS] logical decoding of two-phase transactions

2020-12-16 Thread Ajin Cherian
On Tue, Dec 15, 2020 at 11:42 PM Amit Kapila wrote: > > On Mon, Dec 14, 2020 at 2:59 PM Amit Kapila wrote: > > > > Today, I looked at one of the issues discussed earlier in this thread > [1] which is that decoding can block (or deadlock can happen) when the > user explicitly locks the catalog rel

Re: [HACKERS] Custom compression methods

2020-12-16 Thread Dilip Kumar
On Wed, Dec 9, 2020 at 5:37 PM Dilip Kumar wrote: > > On Sat, Nov 21, 2020 at 3:50 AM Robert Haas wrote: > > > > On Wed, Nov 11, 2020 at 9:39 AM Dilip Kumar wrote: > > > There were a few problems in this rebased version, basically, the > > > compression options were not passed while compressing

Re: New Table Access Methods for Multi and Single Inserts

2020-12-16 Thread Justin Pryzby
Typos: + * 1) Specify is_multi as true, then multi insert state is allcoated. => allocated + * dropped, short-lived memory context is delted and mistate is freed up. => deleted + * 2) Currently, GetTupleSize() handles the existing heap, buffer, minmal and => minimal + /* Mulit insert state

Re: [HACKERS] logical decoding of two-phase transactions

2020-12-16 Thread Ajin Cherian
Adding a test case that tests that when a consistent snapshot is formed after a prepared transaction but before it has been COMMIT PREPARED. This test makes sure that in this case, the entire transaction is decoded on a COMMIT PREPARED. This patch applies on top of v31. regards, Ajin Cherian Fujit

Re: [HACKERS] logical decoding of two-phase transactions

2020-12-16 Thread Ajin Cherian
On Thu, Dec 17, 2020 at 2:41 PM Amit Kapila wrote: > On again thinking about this, I think it is good to disable it during > slot initialization but will it create any problem because during slot > initialization we don't stream any xact and stop processing WAL as > soon as we reach CONSISTENT_ST

Re: \gsetenv

2020-12-16 Thread David Fetter
On Wed, Dec 16, 2020 at 05:30:13PM -0500, Tom Lane wrote: > David Fetter writes: > > We have \gset to set some parameters, but not ones in the environment, > > so I fixed this with a new analogous command, \gsetenv. > > In view of the security complaints we just had about \gset > (CVE-2020-25696)

Re: [HACKERS] logical decoding of two-phase transactions

2020-12-16 Thread Amit Kapila
On Thu, Dec 17, 2020 at 9:02 AM Amit Kapila wrote: > > On Thu, Dec 17, 2020 at 7:02 AM Ajin Cherian wrote: > > > > > > I have reviewed the changes, did not have any new comments. > > While testing, I found an issue in this patch. During initialisation, > > the pg_output is not initialised fully a

Re: [HACKERS] logical decoding of two-phase transactions

2020-12-16 Thread Amit Kapila
On Thu, Dec 17, 2020 at 7:02 AM Ajin Cherian wrote: > > > v31-0009-Support-2PC-txn-Subscription-option > > 1. > > --- a/src/include/catalog/catversion.h > > +++ b/src/include/catalog/catversion.h > > @@ -53,6 +53,6 @@ > > */ > > > > /* mmddN */ > > -#define CATALOG_VERSION_NO 202011251 > >

STANDBY_LOCK_TIMEOUT may not interrupt ProcWaitForSignal()?

2020-12-16 Thread Fujii Masao
Hi, When the startup process needs to wait for recovery conflict on lock, STANDBY_LOCK_TIMEOUT is enabled to interrupt ProcWaitForSignal() if necessary. If this timeout happens, StandbyLockTimeoutHandler() is called and this function does nothing as follows. /* * StandbyLockTimeoutHandl

Re: [HACKERS] logical decoding of two-phase transactions

2020-12-16 Thread Ajin Cherian
> v31-0009-Support-2PC-txn-Subscription-option > 1. > --- a/src/include/catalog/catversion.h > +++ b/src/include/catalog/catversion.h > @@ -53,6 +53,6 @@ > */ > > /* mmddN */ > -#define CATALOG_VERSION_NO 202011251 > +#define CATALOG_VERSION_NO 202011271 > > No need to change catversion as t

Re: SELECT INTO deprecation

2020-12-16 Thread Michael Paquier
On Wed, Dec 16, 2020 at 06:07:08PM +0100, Peter Eisentraut wrote: > Right, we would very likely not add it now. But it doesn't seem to cause a > lot of ongoing maintenance burden, so if there is a use case, it's not > unreasonable to keep it around. I have no other motive here, I was just > curio

[PATCH] nbtree: Do not show debugmessage if deduplication is disabled

2020-12-16 Thread Justin Pryzby
Even though the message literally says whether the index "can safely" or "cannot" use deduplication, the function specifically avoids the debug message for system columns, so I think it also makes sense to hide it when deduplication is turned off. diff --git a/src/backend/access/nbtree/nbtutils.c

Re: Proposed patch for key managment

2020-12-16 Thread Michael Paquier
On Thu, Dec 17, 2020 at 01:15:37AM +0100, Daniel Gustafsson wrote: > In vtls library contexts are abstracted to the core code, with implementations > supplying a struct with a set of function pointers implementing functionality > (this difference is due to libcurl supporting multiple TLS libraries

Re: On login trigger: take three

2020-12-16 Thread Zhihong Yu
Hi, For EventTriggerOnConnect(): + PG_CATCH(); + { ... + AbortCurrentTransaction(); + return; Should runlist be freed in the catch block ? + gettext_noop("In case of errors in the ON client_connection EVENT TRIGGER procedure, this paramet

Re: Proposed patch for key managment

2020-12-16 Thread Daniel Gustafsson
> On 16 Dec 2020, at 17:26, Stephen Frost wrote: > > Greetings, > > * Michael Paquier (mich...@paquier.xyz) wrote: >> On Tue, Dec 15, 2020 at 02:09:09PM -0500, Stephen Frost wrote: >>> Yeah, looking at what's been done there seems like the right approach to >>> me as well, ideally we'd have one

Re: Proposed patch for key managment

2020-12-16 Thread Alastair Turner
On Wed, 16 Dec 2020 at 22:43, Stephen Frost wrote: > > Greetings, ... > > If I'm following, you're suggesting something like: > > cluster_passphrase_command = 'aws get %q' > > and then '%q' gets replaced with "Please provide the WAL DEK: ", or > something like that? Prompting the user for each ke

Re: range_agg

2020-12-16 Thread Alexander Korotkov
On Thu, Dec 17, 2020 at 2:37 AM Zhihong Yu wrote: > Letting user manually name the multirange (after a few automatic attempts) > seems reasonable. Accepted. Thank you for your feedback. -- Regards, Alexander Korotkov

Re: range_agg

2020-12-16 Thread Zhihong Yu
Letting user manually name the multirange (after a few automatic attempts) seems reasonable. Cheers On Wed, Dec 16, 2020 at 3:34 PM Alexander Korotkov wrote: > On Thu, Dec 17, 2020 at 1:03 AM Alexander Korotkov > wrote: > > On Thu, Dec 17, 2020 at 12:54 AM Zhihong Yu wrote: > > > +* The i

Re: range_agg

2020-12-16 Thread Alexander Korotkov
On Thu, Dec 17, 2020 at 1:03 AM Alexander Korotkov wrote: > On Thu, Dec 17, 2020 at 12:54 AM Zhihong Yu wrote: > > +* The idea is to prepend underscores as needed until we make a name > > that > > +* doesn't collide with anything ... > > > > I wonder if other characters (e.g. [a-z0-9]) c

Re: Proposed patch for key managment

2020-12-16 Thread Michael Paquier
On Wed, Dec 16, 2020 at 05:04:12PM -0500, Bruce Momjian wrote: > On Wed, Dec 16, 2020 at 10:23:23AM +0900, Michael Paquier wrote: >> Hmm. I don't think that this is right. First, this still mixes >> ciphers and HMAC. > > I looked at the code. The HMAC function body is just one function call > t

Re: Added missing copy related data structures to typedefs.list

2020-12-16 Thread Bruce Momjian
On Mon, Dec 7, 2020 at 01:56:50PM +0530, vignesh C wrote: > Hi, > > Added missing copy related data structures to typedefs.list, these > data structures were added while copy files were split during the > recent commit. I found this while running pgindent for parallel copy > patches. > The Attach

Re: Proposed patch for key managment

2020-12-16 Thread Stephen Frost
Greetings, * Alastair Turner (min...@decodable.me) wrote: > On Wed, 16 Dec 2020 at 21:32, Stephen Frost wrote: > > * Alastair Turner (min...@decodable.me) wrote: > > > On Wed, 16 Dec 2020 at 00:12, Bruce Momjian wrote: > > > > The second approach is to make a new API for what you want > > >

Re: A few new options for CHECKPOINT

2020-12-16 Thread Bruce Momjian
On Mon, Dec 7, 2020 at 11:22:01AM +0900, Michael Paquier wrote: > On Sun, Dec 06, 2020 at 10:03:08AM -0500, Stephen Frost wrote: > > * Alvaro Herrera (alvhe...@alvh.no-ip.org) wrote: > >> You keep making this statement, and I don't necessarily disagree, but if > >> that is the case, please explain

Re: \gsetenv

2020-12-16 Thread Tom Lane
David Fetter writes: > We have \gset to set some parameters, but not ones in the environment, > so I fixed this with a new analogous command, \gsetenv. In view of the security complaints we just had about \gset (CVE-2020-25696), I cannot fathom why we'd consider adding another way to cause simila

Re: Add docs stub for recovery.conf

2020-12-16 Thread Bruce Momjian
On Fri, Dec 4, 2020 at 02:00:23PM -0500, Stephen Frost wrote: > * Bruce Momjian (br...@momjian.us) wrote: > > Yes, that is pretty much the same thing I was suggesting, except that > > each rename has its own _original_ URL link, which I think is also > > acceptable. My desire is for these items t

Re: Proposed patch for key managment

2020-12-16 Thread Alastair Turner
On Wed, 16 Dec 2020 at 21:32, Stephen Frost wrote: > > Greetings, > > * Alastair Turner (min...@decodable.me) wrote: > > On Wed, 16 Dec 2020 at 00:12, Bruce Momjian wrote: > > > The second approach is to make a new API for what you want > > > > I am trying to motivate for an alternate API. Sp

Re: Proposed patch for key managment

2020-12-16 Thread Bruce Momjian
On Wed, Dec 16, 2020 at 01:42:57PM -0500, Bruce Momjian wrote: > On Wed, Dec 16, 2020 at 06:07:26PM +, Alastair Turner wrote: > > Hi Bruce > > > > On Wed, 16 Dec 2020 at 00:12, Bruce Momjian wrote: > > > > > ... > > > > > > The second approach is to make a new API for what you want > > >

Re: Proposed patch for key managment

2020-12-16 Thread Bruce Momjian
On Wed, Dec 16, 2020 at 04:32:00PM -0500, Stephen Frost wrote: > Greetings, > > * Alastair Turner (min...@decodable.me) wrote: > > On Wed, 16 Dec 2020 at 00:12, Bruce Momjian wrote: > > > The second approach is to make a new API for what you want > > > > I am trying to motivate for an altern

Re: Proposed patch for key managment

2020-12-16 Thread Bruce Momjian
On Wed, Dec 16, 2020 at 10:23:23AM +0900, Michael Paquier wrote: > On Tue, Dec 15, 2020 at 04:02:12PM -0500, Bruce Momjian wrote: > > I thought this was going to be a huge job, but once I looked at it, it > > was clear exactly what you were saying. Comparing cryptohash.c and > > cryptohash_openssl

Re: range_agg

2020-12-16 Thread Alexander Korotkov
On Thu, Dec 17, 2020 at 12:54 AM Zhihong Yu wrote: > +* The idea is to prepend underscores as needed until we make a name that > +* doesn't collide with anything ... > > I wonder if other characters (e.g. [a-z0-9]) can be used so that name without > collision can be found without calling

range_agg

2020-12-16 Thread Zhihong Yu
Hi, w.r.t. patch v27. +* The idea is to prepend underscores as needed until we make a name that +* doesn't collide with anything ... I wonder if other characters (e.g. [a-z0-9]) can be used so that name without collision can be found without calling truncate_identifier(). + else if

Re: Proposed patch for key managment

2020-12-16 Thread Stephen Frost
Greetings, * Alastair Turner (min...@decodable.me) wrote: > On Wed, 16 Dec 2020 at 00:12, Bruce Momjian wrote: > > The second approach is to make a new API for what you want > > I am trying to motivate for an alternate API. Specifically, an API > which allows any potential adopter of Postgre

\gsetenv

2020-12-16 Thread David Fetter
Hi, We have \gset to set some parameters, but not ones in the environment, so I fixed this with a new analogous command, \gsetenv. I considered refactoring SetVariable to include environment variables, but for a first cut, I just made a separate function and an extra if. Best, David. -- David Fe

Re: On login trigger: take three

2020-12-16 Thread Pavel Stehule
Attached please find new versoin of the patch based on on_connect_event_trigger_WITH_SUGGESTED_UPDATES.patch > So there is still only "disable_client_connection_trigger" GUC? because > we need possibility to disable client connect triggers and there is no such > need for other event types. > > As

Re: Proposed patch for key managment

2020-12-16 Thread Bruce Momjian
On Wed, Dec 16, 2020 at 06:07:26PM +, Alastair Turner wrote: > Hi Bruce > > On Wed, 16 Dec 2020 at 00:12, Bruce Momjian wrote: > > > ... > > > > The second approach is to make a new API for what you want > > I am trying to motivate for an alternate API. Specifically, an API > which allow

Re: Proposed patch for key managment

2020-12-16 Thread Alastair Turner
Hi Bruce On Wed, 16 Dec 2020 at 00:12, Bruce Momjian wrote: > ... > > The second approach is to make a new API for what you want I am trying to motivate for an alternate API. Specifically, an API which allows any potential adopter of Postgres and Cluster File Encryption to adopt them without

Re: pg_upgrade test for binary compatibility of core data types

2020-12-16 Thread Justin Pryzby
On Sun, Dec 06, 2020 at 12:02:48PM -0600, Justin Pryzby wrote: > I meant to notice if the binary format is accidentally changed again, which > was > what happened here: > 7c15cef86 Base information_schema.sql_identifier domain on name, not varchar. > > I added a table to the regression tests so i

Re: Deadlock between backend and recovery may not be detected

2020-12-16 Thread Fujii Masao
On 2020/12/16 23:28, Drouvot, Bertrand wrote: Hi, On 12/16/20 2:36 PM, Victor Yegorov wrote: *CAUTION*: This email originated from outside of the organization. Do not click links or open attachments unless you can confirm the sender and know the content is safe. ср, 16 дек. 2020 г. в 13:

Re: SELECT INTO deprecation

2020-12-16 Thread Peter Eisentraut
On 2020-12-15 23:13, Bruce Momjian wrote: Do we really want to carry around confusing syntax for compatibility? I doubt we would ever add INTO now, even for compatibility. Right, we would very likely not add it now. But it doesn't seem to cause a lot of ongoing maintenance burden, so if ther

Re: Proposed patch for key managment

2020-12-16 Thread Stephen Frost
Greetings, * Michael Paquier (mich...@paquier.xyz) wrote: > On Tue, Dec 15, 2020 at 02:09:09PM -0500, Stephen Frost wrote: > > Yeah, looking at what's been done there seems like the right approach to > > me as well, ideally we'd have one set of APIs that'll support all these > > use cases (not unl

Re: ResourceOwner refactoring

2020-12-16 Thread Heikki Linnakangas
On 26/11/2020 10:52, Kyotaro Horiguchi wrote: + for (int i = 0; i < owner->narr; i++) { + if (owner->arr[i].kind->phase == phase) + { + Datum value = owner->arr[i].item; +

Re: Deadlock between backend and recovery may not be detected

2020-12-16 Thread Victor Yegorov
ср, 16 дек. 2020 г. в 13:49, Fujii Masao : > After doing this procedure, you can see the startup process and backend > wait for the table lock each other, i.e., deadlock. But this deadlock > remains > even after deadlock_timeout passes. > > This seems a bug to me. > > > * Deadlocks involving the S

Re: On login trigger: take three

2020-12-16 Thread Konstantin Knizhnik
On 15.12.2020 20:16, Pavel Stehule wrote: Please notice that we still need GUC to disable on-login triggers: to make it possible for superuser who did mistake and defined incorrect on-login trigger to login to the system. Do we need GUC to disable all o

Re: [PATCH] postgres_fdw connection caching - cause remote sessions linger till the local session exit

2020-12-16 Thread Bharath Rupireddy
On Mon, Dec 14, 2020 at 8:03 PM Fujii Masao wrote: > On 2020/12/14 14:36, Bharath Rupireddy wrote: > > On Mon, Dec 14, 2020 at 9:38 AM Fujii Masao > > wrote: > > > On 2020/12/12 15:05, Bharath Rupireddy wrote: > > > > On Sat, Dec 12, 2020 at 12:19 AM Fujii Ma

Deadlock between backend and recovery may not be detected

2020-12-16 Thread Fujii Masao
Hi, While reviewing the patch proposed at [1], I found that there is the case where deadlock that recovery conflict on lock is involved in may not be detected. This deadlock can happen between backends and the startup process, in the standby server. Please see the following procedure to reproduce

Re: Minor documentation error regarding streaming replication protocol

2020-12-16 Thread Brar Piening
Jeff Davis wrote: Attached a simple patch that enforces an all-ASCII restore point name rather than documenting the possibility of non-ASCII text. +1 This is probably the best solution because it gives guarantees to the client without causing compatibility issues with old clients. Thanks! Br

Re: Rethinking plpgsql's assignment implementation

2020-12-16 Thread Pavel Stehule
út 15. 12. 2020 v 21:18 odesílatel Tom Lane napsal: > I realized that the speedup patch I posted yesterday is flawed: it's > too aggressive about applying the R/W param mechanism, instead of > not aggressive enough. > > To review, the point of that logic is that if we have an assignment > like >

Re: Confusing behavior of psql's \e

2020-12-16 Thread Laurenz Albe
On Tue, 2020-12-01 at 11:34 -0500, Chapman Flack wrote: > On 12/01/20 11:21, Laurenz Albe wrote: > > On Tue, 2020-12-01 at 11:03 -0500, Chapman Flack wrote: > > > > I propose to clear the query buffer if the > > > > editor exits without modifying the file. > > > > > > Or how about keeping the quer

Re: [HACKERS] logical decoding of two-phase transactions

2020-12-16 Thread Amit Kapila
On Wed, Dec 16, 2020 at 1:04 PM Masahiko Sawada wrote: > > Thank you for updating the patch. I have two questions: > > - > @@ -239,6 +239,19 @@ CREATE SUBSCRIPTION class="parameter">subscription_name > > > + > +two_phase (boolean) > + > +

Re: Use standard SIGHUP and SIGTERM handlers in autoprewarm module

2020-12-16 Thread Fujii Masao
On 2020/12/16 16:24, Kyotaro Horiguchi wrote: At Tue, 15 Dec 2020 23:10:28 +0900, Fujii Masao wrote in I pushed the following two patches. - v1-use-standard-SIGHUP-hanlder-in-syslogger-process.patch - v1-use-MyLatch-and-standard-SIGHUP-handler-in-startup-process.patch As I told in other th

Re: TAP tests aren't using the magic words for Windows file access

2020-12-16 Thread r . zharkov
Thank you very much! On 2020-12-15 20:47, Andrew Dunstan wrote: On 12/15/20 12:05 AM, r.zhar...@postgrespro.ru wrote: Are there any plans to backport the patch to earlier versions of the Postgres? https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=114541d58e5970e51b78b77b65de16210be