Re: pl/pgsql feature request: shorthand for argument and local variable references

2021-03-24 Thread Pavel Stehule
st 17. 3. 2021 v 23:32 odesílatel Michael Paquier napsal: > On Wed, Mar 17, 2021 at 05:04:48PM +0100, Pavel Stehule wrote: > > This tree has a different direction than is usual, and then replacing the > > root node is not simple. > > Yeah, it is not like we should redesign this whole part just fo

RE: Logical Replication vs. 2PC

2021-03-24 Thread tanghy.f...@fujitsu.com
On Sunday, March 21, 2021 4:40 PM Amit Kapila wrote: >I have enhanced the patch for 2PC implementation on the >subscriber-side as per the solution discussed here [1]. FYI. I did the confirmation for the solution of unique GID problem raised at [1]. This problem in V61-patches at [2] is fixed in

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

2021-03-24 Thread Peter Smith
On Tue, Mar 23, 2021 at 9:01 PM Peter Smith wrote: > > On Tue, Mar 23, 2021 at 10:44 AM Peter Smith wrote: > > > > On Mon, Mar 22, 2021 at 11:51 PM Amit Kapila > > wrote: > > > > > > I have incorporated all your changes and additionally made few more > > > changes (a) got rid of LogicalRepBegin

Re: pl/pgsql feature request: shorthand for argument and local variable references

2021-03-24 Thread Erik Rijkers
> On 2021.03.24. 08:09 Pavel Stehule wrote: > [...] > [plpgsql-routine-label-20210324.patch] Hi, In that sgml "the functions' arguments" should be "the function's arguments" Erik

Re: [HACKERS] Custom compression methods

2021-03-24 Thread Jaime Casanova
On Fri, Mar 19, 2021 at 2:44 PM Robert Haas wrote: > > I committed the core patch (0003) with a bit more editing. Let's see > what the buildfarm thinks. > I think this is bbe0a81db69bd10bd166907c3701492a29aca294, right? This introduced a new assert failure, steps to reproduce: """ create table

Re: Failed assertion on standby while shutdown

2021-03-24 Thread Fujii Masao
On 2021/03/24 14:02, Maxim Orlov wrote: Thank you for reply! As far as I understand, this is really the case. I've test your patch a bit. Thanks for testing the patch! This annoying failed assertion is gone now. Good news! I think I should test more and report later about results. Sh

Re: Nicer error when connecting to standby with hot_standby=off

2021-03-24 Thread Alvaro Herrera
On 2021-Mar-24, Fujii Masao wrote: > On 2021/03/24 5:59, Tom Lane wrote: > > Alvaro Herrera writes: > > > FATAL: the database system is starting up > > > DETAIL: WAL is being applied to recover from a system crash. > > > or > > > DETAIL: The system is applying WAL to recover from a system cras

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

2021-03-24 Thread Alvaro Herrera
On 2021-Mar-22, Bruce Momjian wrote: > diff --git a/src/include/catalog/pg_proc.dat b/src/include/catalog/pg_proc.dat > index e259531f60..9550de0798 100644 > --- a/src/include/catalog/pg_proc.dat > +++ b/src/include/catalog/pg_proc.dat > @@ -5249,9 +5249,9 @@ >proname => 'pg_stat_get_activity'

Re: PoC/WIP: Extended statistics on expressions

2021-03-24 Thread Justin Pryzby
I got this crash running sqlsmith: #1 0x7f907574b801 in __GI_abort () at abort.c:79 #2 0x5646b95a35f8 in ExceptionalCondition (conditionName=conditionName@entry=0x5646b97411db "bms_num_members(varnos) == 1", errorType=errorType@entry=0x5646b95fa00b "FailedAssertion", fileName=file

Re: [HACKERS] Custom compression methods

2021-03-24 Thread Dilip Kumar
On Wed, Mar 24, 2021 at 1:22 PM Jaime Casanova wrote: > > On Fri, Mar 19, 2021 at 2:44 PM Robert Haas wrote: > > > > I committed the core patch (0003) with a bit more editing. Let's see > > what the buildfarm thinks. > > > > I think this is bbe0a81db69bd10bd166907c3701492a29aca294, right? > This

RE: Disable WAL logging to speed up data loading

2021-03-24 Thread tsunakawa.ta...@fujitsu.com
From: Stephen Frost > * tsunakawa.ta...@fujitsu.com (tsunakawa.ta...@fujitsu.com) wrote: > > As Laurenz-san kindly replied, the database server refuses to start with a > clear message. So, it's similarly very clear what happens. The user will > never > unknowingly resume operation with possibly

Re: shared memory stats: high level design decisions: consistency, dropping

2021-03-24 Thread Alvaro Herrera
On 2021-Mar-21, Andres Freund wrote: > We currently also fetch the full stats in places like autovacuum.c. Where we > don't need repeated access to be consistent - we even explicitly force the > stats to be re-read for every single table that's getting vacuumed. > > Even if we to just cache alrea

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

2021-03-24 Thread Julien Rouhaud
On Wed, Mar 24, 2021 at 05:12:35AM -0300, Alvaro Herrera wrote: > On 2021-Mar-22, Bruce Momjian wrote: > > > diff --git a/src/include/catalog/pg_proc.dat > > b/src/include/catalog/pg_proc.dat > > index e259531f60..9550de0798 100644 > > --- a/src/include/catalog/pg_proc.dat > > +++ b/src/include/c

Re: PoC/WIP: Extended statistics on expressions

2021-03-24 Thread Tomas Vondra
Hi Justin, Unfortunately the query is incomplete, so I can't quite determine what went wrong. Can you extract the full query causing the crash, either from the server log or from a core file? thanks On 3/24/21 9:14 AM, Justin Pryzby wrote: > I got this crash running sqlsmith: > > #1 0x7f90

Re: [HACKERS] Custom compression methods

2021-03-24 Thread Dilip Kumar
On Wed, Mar 24, 2021 at 1:43 PM Dilip Kumar wrote: > > > > """ > > create table t1 (col1 text, col2 text); > > create unique index on t1 ((col1 || col2)); > > insert into t1 values((select array_agg(md5(g::text))::text from > > generate_series(1, 256) g), version()); > > """ > > > > Attached is a

Re: PoC/WIP: Extended statistics on expressions

2021-03-24 Thread Justin Pryzby
On Wed, Mar 24, 2021 at 09:54:22AM +0100, Tomas Vondra wrote: > Hi Justin, > > Unfortunately the query is incomplete, so I can't quite determine what > went wrong. Can you extract the full query causing the crash, either > from the server log or from a core file? Oh, shoot, I didn't realize it wa

Re: [HACKERS] Custom compression methods

2021-03-24 Thread Justin Pryzby
On Wed, Mar 24, 2021 at 02:24:41PM +0530, Dilip Kumar wrote: > On Wed, Mar 24, 2021 at 1:43 PM Dilip Kumar wrote: > > > create table t1 (col1 text, col2 text); > > > create unique index on t1 ((col1 || col2)); > > > insert into t1 values((select array_agg(md5(g::text))::text from > > > generate_se

Re: make the stats collector shutdown without writing the statsfiles if the immediate shutdown is requested.

2021-03-24 Thread Fujii Masao
On 2021/03/23 15:50, Fujii Masao wrote: + * The statistics collector is started by the postmaster as soon as the + * startup subprocess finishes. This comment needs to be updated? Because the stats collector can be invoked when the startup process sends PMSIGNAL_BEGIN_HOT_STANDBY signal. I u

Re: make the stats collector shutdown without writing the statsfiles if the immediate shutdown is requested.

2021-03-24 Thread Fujii Masao
On 2021/03/24 3:51, Andres Freund wrote: Hi, On 2021-03-23 15:50:46 +0900, Fujii Masao wrote: This fact makes me wonder that if we collect the statistics about WAL writing from walreceiver as we discussed in other thread, the stats collector should be invoked at more earlier stage. IIUC walr

Re: [HACKERS] Custom compression methods

2021-03-24 Thread Dilip Kumar
On Wed, Mar 24, 2021 at 2:49 PM Justin Pryzby wrote: > > On Wed, Mar 24, 2021 at 02:24:41PM +0530, Dilip Kumar wrote: > > On Wed, Mar 24, 2021 at 1:43 PM Dilip Kumar wrote: > > > > create table t1 (col1 text, col2 text); > > > > create unique index on t1 ((col1 || col2)); > > > > insert into t1 v

Re: Nicer error when connecting to standby with hot_standby=off

2021-03-24 Thread Fujii Masao
On 2021/03/24 16:59, Alvaro Herrera wrote: On 2021-Mar-24, Fujii Masao wrote: On 2021/03/24 5:59, Tom Lane wrote: Alvaro Herrera writes: FATAL: the database system is starting up DETAIL: WAL is being applied to recover from a system crash. or DETAIL: The system is applying WAL to recove

Re: pgsql: Move tablespace path re-creation from the makefiles to pg_regres

2021-03-24 Thread Christoph Berg
Re: Michael Paquier > So you basically mimicked the makefile rule that this commit removed > into your own test suite. Reverting the change does not really help, > because we'd be back to square one where there would be problems in > parallel runs for developers. Saying that, I would not mind add

Re: Replication slot stats misgivings

2021-03-24 Thread Amit Kapila
On Tue, Mar 23, 2021 at 10:54 PM Andres Freund wrote: > > On 2021-03-23 23:37:14 +0900, Masahiko Sawada wrote: > > > > > Maybe we can compare the slot name in the > > > > received message to the name in the element of replSlotStats. If they > > > > don’t match, we swap entries in replSlotStats to

Re: [HACKERS] Custom compression methods

2021-03-24 Thread Dilip Kumar
On Wed, Mar 24, 2021 at 3:10 PM Dilip Kumar wrote: > > On Wed, Mar 24, 2021 at 2:49 PM Justin Pryzby wrote: > > > > On Wed, Mar 24, 2021 at 02:24:41PM +0530, Dilip Kumar wrote: > > > On Wed, Mar 24, 2021 at 1:43 PM Dilip Kumar wrote: > > > > > create table t1 (col1 text, col2 text); > > > > > cr

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

2021-03-24 Thread houzj.f...@fujitsu.com
> I have incorporated all your changes and additionally made few more changes > (a) got rid of LogicalRepBeginPrepareData and instead used > LogicalRepPreparedTxnData, (b) made a number of changes in comments and > docs, (c) ran pgindent, (d) modified tests to use standard wait_for_catch > function

RE: Add Nullif case for eval_const_expressions_mutator

2021-03-24 Thread houzj.f...@fujitsu.com
> + if (!has_nonconst_input) > + return ece_evaluate_expr(expr); > > That's not okay without a further check to see if the comparison function used > by the node is immutable. Compare ScalarArrayOpExpr, for instance. Thanks for poin

RE: fix typo in reorderbuffer.c

2021-03-24 Thread houzj.f...@fujitsu.com
> > What about "Combo CID(s)", for Combo command ID? README.parallel uses > this term for example. Sorry for the late reply and yes, " Combo CID(s)" looks better. Attaching patch which replaces all styles "Combocid(s)" with " Combo CID(s)". Best regards, houzj v2-0001-make-the-comments-about-

Re: multi-install PostgresNode

2021-03-24 Thread Andrew Dunstan
On 3/23/21 7:09 PM, Andrew Dunstan wrote: > On 3/23/21 6:36 PM, Michael Paquier wrote: >> On Thu, Jan 28, 2021 at 10:19:57AM -0500, Andrew Dunstan wrote: >>> +BEGIN >>> +{ >>> + >>> +# putting this in a BEGIN block means it's run and checked by perl -c >>> + >>> + >>> +# everything other t

Re: Disable WAL logging to speed up data loading

2021-03-24 Thread Stephen Frost
Greetings, * tsunakawa.ta...@fujitsu.com (tsunakawa.ta...@fujitsu.com) wrote: > From: Stephen Frost > > * tsunakawa.ta...@fujitsu.com (tsunakawa.ta...@fujitsu.com) wrote: > > As for data loading tools, surely they support loading data into UNLOGGED > > tables and it's certainly not hard to have a

Re: [HACKERS] Custom compression methods

2021-03-24 Thread Dilip Kumar
On Wed, Mar 24, 2021 at 3:40 PM Dilip Kumar wrote: > > 0001 ->shows compression method for the index attribute in index describe > 0002 -> fix the reported bug (test case included) > > Apart from this, I was thinking that currently, we are allowing to > ALTER SET COMPRESSION only for the table and

Re: Autovacuum worker doesn't immediately exit on postmaster death

2021-03-24 Thread Stephen Frost
Greetings, * Michael Paquier (mich...@paquier.xyz) wrote: > On Mon, Mar 22, 2021 at 04:07:12PM -0400, Robert Haas wrote: > > On Mon, Mar 22, 2021 at 1:48 PM Stephen Frost wrote: > >> Thanks for that. Attached is just a rebased version with a commit > >> message added. If there aren't any other

Re: multi-install PostgresNode

2021-03-24 Thread Dagfinn Ilmari Mannsåker
Andrew Dunstan writes: > And here it is. No subclass, no eval, no magic :-) Some of my colleagues > are a lot happier ;-) > > The downside is that we need to litter PostgresNode with a bunch of > lines like: > > local %ENV = %ENV; > _set_install_env($self); I think it would be even neate

Re: multi-install PostgresNode

2021-03-24 Thread Andrew Dunstan
On 3/24/21 7:54 AM, Dagfinn Ilmari Mannsåker wrote: > Andrew Dunstan writes: > >> And here it is. No subclass, no eval, no magic :-) Some of my colleagues >> are a lot happier ;-) >> >> The downside is that we need to litter PostgresNode with a bunch of >> lines like: >> >> local %ENV = %ENV

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

2021-03-24 Thread Bruce Momjian
On Wed, Mar 24, 2021 at 04:51:40PM +0800, Julien Rouhaud wrote: > > but if you do that it'd be better to avoid > > introducing a function with one name and renaming it in your next > > commit. > > Oops, I apparently messed a fixup when working on it. Bruce, should I take > care of that of do you

Re: postgres_fdw: IMPORT FOREIGN SCHEMA ... LIMIT TO (partition)

2021-03-24 Thread Matthias van de Meent
On Mon, 22 Mar 2021 at 21:16, Bernd Helmle wrote: > > Hi, > > I took a look at this patch. Thanks! > Patch applies on current master. > > Documentation and adjusted regression tests included. > Regression tests passes without errors. > > The patch changes IMPORT FOREIGN SCHEMA to explicitely all

Re: multi-install PostgresNode

2021-03-24 Thread Alvaro Herrera
On 2021-Mar-24, Dagfinn Ilmari Mannsåker wrote: > I think it would be even neater having a method that returns the desired > environment and then have the other methods do: > > local %ENV = $self->_get_install_env(); Hmm, is it possible to integrate PGHOST and PGPORT handling into this too

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

2021-03-24 Thread Amit Kapila
On Tue, Mar 23, 2021 at 3:31 PM Peter Smith wrote: > > On Tue, Mar 23, 2021 at 10:44 AM Peter Smith wrote: > > > > PSA patches to fix those. > > > > Hi Amit. > > PSA a patch to allow the ALTER SUBSCRIPTION ... REFRESH PUBLICATION to > work when two-phase tristate is PENDING. > > This is necessary

Re: default result formats setting

2021-03-24 Thread Emre Hasegeli
I think this is a good feature that would be useful to JDBC and more. I don't know the surrounding code very well, but the patch looks good to me. I agree with Tom Lane that the name of the variable is too verbose. Maybe "auto_binary_types" is enough. Do we gain much by prefixing "result_format_

Re: Nicer error when connecting to standby with hot_standby=off

2021-03-24 Thread James Coleman
On Wed, Mar 24, 2021 at 5:55 AM Fujii Masao wrote: > > > > On 2021/03/24 16:59, Alvaro Herrera wrote: > > On 2021-Mar-24, Fujii Masao wrote: > > > >> On 2021/03/24 5:59, Tom Lane wrote: > >>> Alvaro Herrera writes: > FATAL: the database system is starting up > DETAIL: WAL is being app

Re: pg_amcheck contrib application

2021-03-24 Thread Robert Haas
On Wed, Mar 24, 2021 at 2:13 AM Mark Dilger wrote: > The visibility rules fix is different in v11, relying on a visibility check > which more closely follows the implementation of > HeapTupleSatisfiesVacuumHorizon. Hmm. The header comment you wrote says "If a tuple might not be visible to any r

Re: multi-install PostgresNode

2021-03-24 Thread Andrew Dunstan
On 3/24/21 8:29 AM, Alvaro Herrera wrote: > On 2021-Mar-24, Dagfinn Ilmari Mannsåker wrote: > >> I think it would be even neater having a method that returns the desired >> environment and then have the other methods do: >> >> local %ENV = $self->_get_install_env(); > Hmm, is it possible to

Re: shared memory stats: high level design decisions: consistency, dropping

2021-03-24 Thread Magnus Hagander
On Tue, Mar 23, 2021 at 4:21 AM Greg Stark wrote: > > On Sun, 21 Mar 2021 at 18:16, Stephen Frost wrote: > > > > Greetings, > > > > * Tom Lane (t...@sss.pgh.pa.us) wrote: > > > I also believe that the snapshotting behavior has advantages in terms > > > of being able to perform multiple successive

Re: PoC/WIP: Extended statistics on expressions

2021-03-24 Thread Dean Rasheed
On Wed, 24 Mar 2021 at 10:22, Tomas Vondra wrote: > > Thanks, it seems to be some thinko in handling in PlaceHolderVars, which > seem to break the code's assumptions about varnos. This fixes it for me, > but I need to look at it more closely. > I think that makes sense. Reviewing the docs, I not

Re: shared memory stats: high level design decisions: consistency, dropping

2021-03-24 Thread Magnus Hagander
On Sun, Mar 21, 2021 at 11:34 PM Andres Freund wrote: > > Hi, > > On 2021-03-21 12:14:35 -0400, Tom Lane wrote: > > Andres Freund writes: > > > 1) What kind of consistency do we want from the pg_stats_* views? > > > > That's a hard choice to make. But let me set the record straight: > > when we

psql lacking clearerr()

2021-03-24 Thread Alvaro Herrera
psql seems to never call clearerr() on its output file. So if it gets an error while printing a result, it'll show could not print result table: Success after each and every result, even though the output file isn't in error state anymore. It seems that the simplest fix is just to do clearerr()

Re: [CLOBBER_CACHE]Server crashed with segfault 11 while executing clusterdb

2021-03-24 Thread Tom Lane
Amul Sul writes: > On Tue, Mar 23, 2021 at 8:59 PM Tom Lane wrote: >> On closer inspection, I believe the true culprit is c6b92041d, >> which did this: >> - heap_sync(state->rs_new_rel); >> + smgrimmedsync(state->rs_new_rel->rd_smgr, MAIN_FORKNUM); >> heap_sync was car

Re: pg_amcheck contrib application

2021-03-24 Thread Robert Haas
On Wed, Mar 24, 2021 at 9:12 AM Robert Haas wrote: > On Wed, Mar 24, 2021 at 2:13 AM Mark Dilger > wrote: > > The visibility rules fix is different in v11, relying on a visibility check > > which more closely follows the implementation of > > HeapTupleSatisfiesVacuumHorizon. > > Hmm. The header

Re: PoC/WIP: Extended statistics on expressions

2021-03-24 Thread Tomas Vondra
On 3/24/21 2:36 PM, Dean Rasheed wrote: > On Wed, 24 Mar 2021 at 10:22, Tomas Vondra > wrote: >> >> Thanks, it seems to be some thinko in handling in PlaceHolderVars, which >> seem to break the code's assumptions about varnos. This fixes it for me, >> but I need to look at it more closely. >> > >

Re: default result formats setting

2021-03-24 Thread Robert Haas
On Thu, Nov 5, 2020 at 3:49 PM Peter Eisentraut wrote: > We could also make it a protocol message, but it would essentially > implement the same thing, just again separately. And then you'd have no > support to inspect the current setting, test out different settings > interactively, etc. That s

Re: pgsql: Move tablespace path re-creation from the makefiles to pg_regres

2021-03-24 Thread Robert Haas
On Wed, Mar 24, 2021 at 5:56 AM Christoph Berg wrote: > Maybe creating the tablespace directory from within the testsuite > would suffice? > > CREATE TABLE foo (t text); > COPY foo FROM PROGRAM 'mkdir @testtablespace@'; > CREATE TABLESPACE regress_tblspace LOCATION '@testtablespace@'; Would that

Re: default result formats setting

2021-03-24 Thread Tom Lane
Robert Haas writes: > But ... if it's just a GUC, it can be set by code on the server side > that the client knows nothing about, breaking the client. That seems > pretty bad to me. It's impossible for the proposed patch to break *existing* clients, because they all send requested format 0 or 1,

Re: multi-install PostgresNode

2021-03-24 Thread Andrew Dunstan
On 3/24/21 9:23 AM, Andrew Dunstan wrote: > On 3/24/21 8:29 AM, Alvaro Herrera wrote: >> On 2021-Mar-24, Dagfinn Ilmari Mannsåker wrote: >> >>> I think it would be even neater having a method that returns the desired >>> environment and then have the other methods do: >>> >>> local %ENV = $s

Re: [HACKERS] Custom compression methods

2021-03-24 Thread Robert Haas
On Wed, Mar 24, 2021 at 7:45 AM Dilip Kumar wrote: > I have anyway created a patch for this as well. Including all three > patches so we don't lose track. > > 0001 ->shows compression method for the index attribute in index describe > 0002 -> fix the reported bug (test case included) > (optional)

Re: Get memory contexts of an arbitrary backend process

2021-03-24 Thread torikoshia
On 2021-03-23 17:24, Kyotaro Horiguchi wrote: Thanks for reviewing and suggestions! At Mon, 22 Mar 2021 15:09:58 +0900, torikoshia wrote in >> If MemoryContextStatsPrint(), i.e. showing 100 children at most is >> enough, this hard limit may be acceptable. > Can't this number be passed via sha

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

2021-03-24 Thread Julien Rouhaud
On Wed, Mar 24, 2021 at 08:13:40AM -0400, Bruce Momjian wrote: > On Wed, Mar 24, 2021 at 04:51:40PM +0800, Julien Rouhaud wrote: > > > but if you do that it'd be better to avoid > > > introducing a function with one name and renaming it in your next > > > commit. > > > > Oops, I apparently messed

Re: default result formats setting

2021-03-24 Thread Robert Haas
On Wed, Mar 24, 2021 at 10:58 AM Tom Lane wrote: > Robert Haas writes: > > But ... if it's just a GUC, it can be set by code on the server side > > that the client knows nothing about, breaking the client. That seems > > pretty bad to me. > > It's impossible for the proposed patch to break *exist

Re: truncating timestamps on arbitrary intervals

2021-03-24 Thread Peter Eisentraut
On 18.01.21 21:54, John Naylor wrote: On Mon, Nov 23, 2020 at 1:44 PM John Naylor mailto:john.nay...@enterprisedb.com>> wrote: > > On Thu, Nov 12, 2020 at 9:56 AM Peter Eisentraut > wrote: > > - After reading the discussion a few times, I'm not so s

Re: [HACKERS] Custom compression methods

2021-03-24 Thread Dilip Kumar
On Wed, Mar 24, 2021 at 8:41 PM Robert Haas wrote: > > On Wed, Mar 24, 2021 at 7:45 AM Dilip Kumar wrote: > > I have anyway created a patch for this as well. Including all three > > patches so we don't lose track. > > > > 0001 ->shows compression method for the index attribute in index describe

Re: multi-install PostgresNode

2021-03-24 Thread Alvaro Herrera
On 2021-Mar-24, Andrew Dunstan wrote: > > On 3/24/21 9:23 AM, Andrew Dunstan wrote: > > On 3/24/21 8:29 AM, Alvaro Herrera wrote: > > If we're going to do that we probably shouldn't special case any > > particular settings, but simply take any extra arguments as extra env > > settings. And if an

Re: [HACKERS] Custom compression methods

2021-03-24 Thread Tom Lane
Andrew Dunstan writes: > On 3/20/21 3:03 PM, Tom Lane wrote: >> I fixed up some issues in 0008/0009 (mostly cosmetic, except that >> you forgot a server version check in dumpToastCompression) and >> pushed that, so we can see if it makes crake happy. > It's still produced a significant amount mor

Re: Support for NSS as a libpq TLS backend

2021-03-24 Thread Jacob Champion
On Wed, 2021-03-24 at 09:28 +0900, Michael Paquier wrote: > On Wed, Mar 24, 2021 at 12:05:35AM +, Jacob Champion wrote: > > I can work around it temporarily for the > > tests, but this will be a problem if any libpq clients load up multiple > > independent databases for use with separate connec

Re: Tying an object's ownership to datdba

2021-03-24 Thread John Naylor
On Mon, Dec 28, 2020 at 12:32 AM Noah Misch wrote: > [v2] Hi Noah, In the refactoring patch, there is a lingering comment reference to roles_has_privs_of(). Aside from that, it looks good to me. A possible thing to consider is an assert that is_admin is not null where we expect that. The databa

Re: default result formats setting

2021-03-24 Thread Tom Lane
Robert Haas writes: > On Wed, Mar 24, 2021 at 10:58 AM Tom Lane wrote: >> A client that is sending -1 and assuming that it will get back >> a particular format could get broken if the GUC doesn't have the >> value it thinks, true. But I'd argue that such code is unreasonably >> non-robust. Can'

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

2021-03-24 Thread Alvaro Herrera
On 2021-Mar-24, Julien Rouhaud wrote: > From e08c9d5fc86ba722844d97000798de868890aba3 Mon Sep 17 00:00:00 2001 > From: Bruce Momjian > Date: Mon, 22 Mar 2021 17:43:23 -0400 > Subject: [PATCH v20 2/3] Expose queryid in pg_stat_activity and > src/backend/executor/execMain.c | 9 ++

Re: [HACKERS] Custom compression methods

2021-03-24 Thread Robert Haas
On Wed, Mar 24, 2021 at 11:41 AM Dilip Kumar wrote: > Okay, that sounds like a reasonable design idea. But the problem is > that in index_form_tuple we only have index tuple descriptor, not the > heap tuple descriptor. Maybe we will have to pass the heap tuple > descriptor as a parameter to index

Re: pg_upgrade failing for 200+ million Large Objects

2021-03-24 Thread Jan Wieck
On 3/23/21 4:55 PM, Tom Lane wrote: Jan Wieck writes: Have we even reached a consensus yet on that doing it the way, my patch is proposing, is the right way to go? Like that emitting BLOB TOC entries into SECTION_DATA when in binary upgrade mode is a good thing? Or that bunching all the SQL s

Re: default result formats setting

2021-03-24 Thread Robert Haas
On Wed, Mar 24, 2021 at 12:01 PM Tom Lane wrote: > I don't think I buy the premise that there are exactly two levels > on the client side. Thanks for sharing your thoughts on this. I agree it's a complex issue, and the idea that there are possibly more than two logical levels is, for me, maybe yo

Re: pg_upgrade failing for 200+ million Large Objects

2021-03-24 Thread Jan Wieck
On 3/24/21 12:04 PM, Jan Wieck wrote: In any case I changed the options so that they behave the same way, the existing -o and -O (for old/new postmaster options) work. I don't think it would be wise to have option forwarding work differently between options for postmaster and options for pg_dump/

Re: [HACKERS] Custom compression methods

2021-03-24 Thread Dilip Kumar
On Wed, Mar 24, 2021 at 9:32 PM Robert Haas wrote: > > On Wed, Mar 24, 2021 at 11:41 AM Dilip Kumar wrote: > > Okay, that sounds like a reasonable design idea. But the problem is > > that in index_form_tuple we only have index tuple descriptor, not the > > heap tuple descriptor. Maybe we will ha

Re: [HACKERS] Custom compression methods

2021-03-24 Thread Robert Haas
On Wed, Mar 24, 2021 at 11:42 AM Tom Lane wrote: > On reflection, though, I wonder if we've made pg_dump do the right > thing anyway. There is a strong case to be made for the idea that > when dumping from a pre-14 server, it should emit > SET default_toast_compression = 'pglz'; > rather

Re: PoC/WIP: Extended statistics on expressions

2021-03-24 Thread Dean Rasheed
On Wed, 24 Mar 2021 at 14:48, Tomas Vondra wrote: > > AFAIK the primary issue here is that the two places disagree. While > estimate_num_groups does this > > varnos = pull_varnos(root, (Node *) varshere); > if (bms_membership(varnos) == BMS_SINGLETON) > { ... } > > the add_unique_group

Re: postgres_fdw: IMPORT FOREIGN SCHEMA ... LIMIT TO (partition)

2021-03-24 Thread Bernd Helmle
Am Mittwoch, dem 24.03.2021 um 13:23 +0100 schrieb Matthias van de Meent: > Yes, but it should be noted that the main reason that was mentioned > as > a reason to exclude partitions is to not cause table catalog bloat, > and I argue that this argument is not as solid in the case of the > explicitly

Re: PoC/WIP: Extended statistics on expressions

2021-03-24 Thread Tomas Vondra
On 3/24/21 7:24 AM, Justin Pryzby wrote: > Most importantly, it looks like this forgets to update catalog documentation > for stxexprs and stxkind='e' > Good catch. > It seems like you're preferring to use pluralized "statistics" in a lot of > places that sound wrong to me. For example: >> Cu

Re: PoC/WIP: Extended statistics on expressions

2021-03-24 Thread Justin Pryzby
On Wed, Mar 24, 2021 at 01:24:46AM -0500, Justin Pryzby wrote: > It seems like you're preferring to use pluralized "statistics" in a lot of > places that sound wrong to me. For example: > > Currently the first statistics wins, which seems silly. > I can write more separately, but I think this is r

Re: [HACKERS] Custom compression methods

2021-03-24 Thread Robert Haas
On Mon, Mar 22, 2021 at 4:57 PM Robert Haas wrote: > > Fixed. > > Fixed some more. Committed. -- Robert Haas EDB: http://www.enterprisedb.com

Re: [HACKERS] Custom compression methods

2021-03-24 Thread Tom Lane
Robert Haas writes: > On Wed, Mar 24, 2021 at 11:42 AM Tom Lane wrote: >> On reflection, though, I wonder if we've made pg_dump do the right >> thing anyway. There is a strong case to be made for the idea that >> when dumping from a pre-14 server, it should emit >> SET default_toast_compression

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

2021-03-24 Thread Jacob Champion
On Tue, 2021-03-23 at 14:21 +0900, Michael Paquier wrote: > I am not really sure that we need to bother about the ordering of the > entries here, as long as we check for all of them within the same > fragment of the log file, so I would just go down to the simplest > solution that I posted upthread

Re: PoC/WIP: Extended statistics on expressions

2021-03-24 Thread Tomas Vondra
On 3/24/21 5:28 PM, Dean Rasheed wrote: > On Wed, 24 Mar 2021 at 14:48, Tomas Vondra > wrote: >> >> AFAIK the primary issue here is that the two places disagree. While >> estimate_num_groups does this >> >> varnos = pull_varnos(root, (Node *) varshere); >> if (bms_membership(varnos) ==

Re: Support for NSS as a libpq TLS backend

2021-03-24 Thread Stephen Frost
Greetings Jacob, * Jacob Champion (pchamp...@vmware.com) wrote: > On Wed, 2021-03-24 at 09:28 +0900, Michael Paquier wrote: > > On Wed, Mar 24, 2021 at 12:05:35AM +, Jacob Champion wrote: > > > I can work around it temporarily for the > > > tests, but this will be a problem if any libpq client

Re: Change default of checkpoint_completion_target

2021-03-24 Thread Stephen Frost
Greetings, * Bossart, Nathan (bossa...@amazon.com) wrote: > On 3/23/21, 12:19 PM, "Stephen Frost" wrote: > > * Bossart, Nathan (bossa...@amazon.com) wrote: > > > LGTM. I just have a few small wording suggestions. > > > > Agreed, those looked like good suggestions and so I've incorporated > > the

Re: PoC/WIP: Extended statistics on expressions

2021-03-24 Thread Dean Rasheed
On Wed, 24 Mar 2021 at 16:48, Tomas Vondra wrote: > > As for the changes proposed in the create_statistics, do we really want > to use univariate / multivariate there? Yes, the terms are correct, but > I'm not sure how many people looking at CREATE STATISTICS will > understand them. > Hmm, I thin

Re: PoC/WIP: Extended statistics on expressions

2021-03-24 Thread Justin Pryzby
On Wed, Mar 24, 2021 at 05:15:46PM +, Dean Rasheed wrote: > On Wed, 24 Mar 2021 at 16:48, Tomas Vondra > wrote: > > > > As for the changes proposed in the create_statistics, do we really want > > to use univariate / multivariate there? Yes, the terms are correct, but > > I'm not sure how many

Re: [HACKERS] Custom compression methods

2021-03-24 Thread Robert Haas
On Wed, Mar 24, 2021 at 12:45 PM Tom Lane wrote: > I wouldn't be proposing this if the xversion failures were the only > reason; making them go away is just a nice side-effect. The core > point is that the charter of pg_dump is to reproduce the source > database's state, and as things stand we're

Re: [HACKERS] Custom compression methods

2021-03-24 Thread Justin Pryzby
On Wed, Mar 24, 2021 at 12:24:38PM -0400, Robert Haas wrote: > On Wed, Mar 24, 2021 at 11:42 AM Tom Lane wrote: > > On reflection, though, I wonder if we've made pg_dump do the right > > thing anyway. There is a strong case to be made for the idea that > > when dumping from a pre-14 server, it sh

Re: truncating timestamps on arbitrary intervals

2021-03-24 Thread Erik Rijkers
> On 2021.03.24. 16:38 Peter Eisentraut > wrote: > > Committed. > 'In cases full units' seems strange. Not a native speaker but maybe the attached changes are improvements? Erik Rijkers--- ./doc/src/sgml/func.sgml.orig 2021-03-24 18:16:01.269515354 +0100 +++ ./doc/src/sgml/func.sgml 2021-0

Re: [HACKERS] Custom compression methods

2021-03-24 Thread Robert Haas
On Wed, Mar 24, 2021 at 12:14 PM Dilip Kumar wrote: > Actually, we are already doing this, I mean ALTER TABLE .. ALTER > COLUMN .. SET COMPRESSION is already updating the compression method > of the index attribute. So 0003 doesn't make sense, sorry for the > noise. However, 0001 and 0002 are st

Re: [HACKERS] Custom compression methods

2021-03-24 Thread Robert Haas
On Wed, Mar 24, 2021 at 1:24 PM Justin Pryzby wrote: > I think it's not specific to pg_upgrade, but any pg_dump |pg_restore. > > The analogy with tablespaces is restoring from a cluster where the tablespace > is named "vast" to one where it's named "huge". I do this by running > PGOPTIONS=-cdefau

Re: Support for NSS as a libpq TLS backend

2021-03-24 Thread Jacob Champion
On Wed, 2021-03-24 at 13:00 -0400, Stephen Frost wrote: > * Jacob Champion (pchamp...@vmware.com) wrote: > > Right, but to clarify -- I was asking if *NSS* supports loading and > > using separate certificate databases as part of its API. It seems like > > the internals make it possible, but I don't

Re: multi-install PostgresNode

2021-03-24 Thread Andrew Dunstan
On 3/24/21 11:41 AM, Alvaro Herrera wrote: > On 2021-Mar-24, Andrew Dunstan wrote: > >> On 3/24/21 9:23 AM, Andrew Dunstan wrote: >>> On 3/24/21 8:29 AM, Alvaro Herrera wrote: >>> If we're going to do that we probably shouldn't special case any >>> particular settings, but simply take any extra ar

Re: [HACKERS] Custom compression methods

2021-03-24 Thread Justin Pryzby
On Wed, Mar 24, 2021 at 01:30:26PM -0400, Robert Haas wrote: > On Wed, Mar 24, 2021 at 1:24 PM Justin Pryzby wrote: > > I think it's not specific to pg_upgrade, but any pg_dump |pg_restore. > > > > The analogy with tablespaces is restoring from a cluster where the > > tablespace > > is named "vas

Re: truncating timestamps on arbitrary intervals

2021-03-24 Thread John Naylor
On Wed, Mar 24, 2021 at 11:38 AM Peter Eisentraut < peter.eisentr...@enterprisedb.com> wrote: > Committed. > > I noticed that some of the documentation disappeared between v9 and v10. > So I put that back and updated it appropriately. I also added a few > more test cases to cover some things th

Re: truncating timestamps on arbitrary intervals

2021-03-24 Thread John Naylor
On Wed, Mar 24, 2021 at 1:25 PM Erik Rijkers wrote: > > 'In cases full units' seems strange. > > Not a native speaker but maybe the attached changes are improvements? -In cases full units (1 minute, 1 hour, etc.), it gives the same result as +In case of full units (1 minute, 1 hour, etc.)

Re: Support for NSS as a libpq TLS backend

2021-03-24 Thread Stephen Frost
Greetings, * Jacob Champion (pchamp...@vmware.com) wrote: > On Wed, 2021-03-24 at 13:00 -0400, Stephen Frost wrote: > > * Jacob Champion (pchamp...@vmware.com) wrote: > > > Right, but to clarify -- I was asking if *NSS* supports loading and > > > using separate certificate databases as part of its

Re: [HACKERS] Custom compression methods

2021-03-24 Thread Tom Lane
Justin Pryzby writes: > On Wed, Mar 24, 2021 at 01:30:26PM -0400, Robert Haas wrote: >> ... So --no-toast-compression is just fine for people who are >> dumping and restoring, but it's no help at all if you want to switch >> TOAST compression methods while doing a pg_upgrade. However, what does >>

Re: multi-install PostgresNode

2021-03-24 Thread Alvaro Herrera
On 2021-Mar-24, Andrew Dunstan wrote: > OK, like this? Yeah, looks good! > +# Private routine to return a copy of the environment with the PATH and > (DY)LD_LIBRARY_PATH > +# correctly set when there is an install path set for the node. > +# Routines that call Postgres binaries need to call thi

Re: pl/pgsql feature request: shorthand for argument and local variable references

2021-03-24 Thread Pavel Stehule
st 24. 3. 2021 v 8:42 odesílatel Erik Rijkers napsal: > > On 2021.03.24. 08:09 Pavel Stehule wrote: > > [...] > > [plpgsql-routine-label-20210324.patch] > > > Hi, > > In that sgml > > "the functions' arguments" > > should be &

Re: TRUNCATE on foreign table

2021-03-24 Thread Fujii Masao
On 2021/03/13 18:57, Kazutaka Onishi wrote: I have fixed the patch to pass check-world test. :D Thanks for updating the patch! Here are some review comments from me. By default all foreign tables using postgres_fdw are assumed to be updatable. This may be overridden using the

Re: making update/delete of inheritance trees scale better

2021-03-24 Thread Tom Lane
I wrote: > Yeah, it's on my to-do list for this CF, but I expect it's going to > take some concentrated study and other things keep intruding :-(. I've started to look at this seriously, and I wanted to make a note about something that I think we should try to do, but there seems little hope of sh

Re: truncating timestamps on arbitrary intervals

2021-03-24 Thread Peter Eisentraut
On 24.03.21 18:25, Erik Rijkers wrote: On 2021.03.24. 16:38 Peter Eisentraut wrote: Committed. 'In cases full units' seems strange. fixed, thanks

Re: PoC/WIP: Extended statistics on expressions

2021-03-24 Thread Alvaro Herrera
On 2021-Mar-24, Justin Pryzby wrote: > On Wed, Mar 24, 2021 at 05:15:46PM +, Dean Rasheed wrote: > > Hmm, I think "univariate" and "multivariate" are pretty ubiquitous, > > when used to describe statistics. You could use "single-column" and > > "multi-column", but then "column" isn't really r

  1   2   >