Re: New Table Access Methods for Multi and Single Inserts

2021-01-17 Thread Luc Vlaming
On 17-01-2021 00:04, Jeff Davis wrote: If we agree on removing heap_multi_insert_v2 API and embed that logic inside heap_insert_v2, then we can do this - pass the required information and the functions ExecInsertIndexTuples and ExecARInsertTriggers as callbacks so that, whether or not

[PATCH] More docs on what to do and not do in extension code

2021-01-17 Thread Craig Ringer
Hi folks The attached patch expands the xfunc docs and bgworker docs a little, providing a starting point for developers to learn how to do some common tasks the Postgres Way. It mentions in brief these topics: * longjmp() based exception handling with elog(ERROR), PG_CATCH() and PG_RE_THROW()

[PATCH] Cross-reference comments on signal handling logic

2021-01-17 Thread Craig Ringer
Hi all The attached comments-only patch expands the signal handling section in miscadmin.h a bit so that it mentions ProcSignal, deferred signal handling during blocking calls, etc. It adds cross-refs between major signal handling routines and the miscadmin comment to help readers track the

RE: ResourceOwner refactoring

2021-01-17 Thread kuroda.hay...@fujitsu.com
Dear Heikki, I apologize for sending again. > I will check another ResourceOwnerEnlarge() if I have a time. I checked all ResourceOwnerEnlarge() types after applying patch 0001. (searched by "grep -rI ResourceOwnerEnlarge") No problem was found. Hayato Kuroda FUJITSU LIMITED

Re: Lazy JIT IR code generation to increase JIT speed with partitions

2021-01-17 Thread Luc Vlaming
Hi everyone, Andres, On 03-01-2021 11:05, Luc Vlaming wrote: On 30-12-2020 14:23, Luc Vlaming wrote: On 30-12-2020 02:57, Andres Freund wrote: Hi, Great to see work in this area! I would like this topic to somehow progress and was wondering what other benchmarks / tests would be needed to

Narrow the scope of the variable outputstr in logicalrep_write_tuple

2021-01-17 Thread japin
Hi, I find that the outputstr variable in logicalrep_write_tuple() only use in `else` branch, I think we can narrow the scope, just like variable outputbytes in `if` branch (for more readable). /* * Send in binary if requested and type has suitable send function. */

Re: list of extended statistics on psql

2021-01-17 Thread Tatsuro Yamada
Hi Justin, On 2021/01/18 1:52, Justin Pryzby wrote: On Sun, Jan 17, 2021 at 03:31:57PM +0100, Tomas Vondra wrote: I've reverted the commit - once we find the right way to handle this, I'll get it committed again. Please consider these doc changes for the next iteration. commit

RE: Stronger safeguard for archive recovery not to miss data

2021-01-17 Thread osumi.takami...@fujitsu.com
Hi, Laurenz On Friday, January 15, 2021 12:56 AM Laurenz Albe wrote: > On Tue, 2020-12-08 at 03:08 +, osumi.takami...@fujitsu.com wrote: > > On Thursday, November 26, 2020 4:29 PM Kyotaro Horiguchi > > wrote: > > > At Thu, 26 Nov 2020 07:18:39 +, "osumi.takami...@fujitsu.com" > > >

RE: Parallel INSERT (INTO ... SELECT ...)

2021-01-17 Thread Tang, Haiying
> From: Amit Kapila > > Can we test cases when we have few rows in the Select table (say > > 1000) and there 500 or 1000 partitions. In that case, we won't > > select parallelism but we have to pay the price of checking > > parallel-safety of all partitions. Can you check this with 100, 200,

Re: list of extended statistics on psql

2021-01-17 Thread Tatsuro Yamada
Hi Tomas and Shinoda-san, On 2021/01/17 23:31, Tomas Vondra wrote: On 1/17/21 3:01 AM, Tomas Vondra wrote: On 1/17/21 2:41 AM, Shinoda, Noriyoshi (PN Japan FSIP) wrote: Hi, hackers. I tested this committed feature. It doesn't seem to be available to non-superusers due to the inability to

Re: list of extended statistics on psql

2021-01-17 Thread Tatsuro Yamada
Hi Tomas, On 2021/01/17 8:32, Tomas Vondra wrote: I've pushed this, keeping the "requested". If we decide that some other term is a better choice, we can tweak that later of course. Thanks Tatsuro-san for the patience! Thanks for taking the time to review the patches. I believe this feature

Re: list of extended statistics on psql

2021-01-17 Thread Tatsuro Yamada
Hi Julien, On 2021/01/15 17:47, Julien Rouhaud wrote: Hello Yamada-san, I reviewed the patch and don't have specific complaints, it all looks good! I'm however thinking about the "requested" status. I'm wondering if it could lead to people think that an ANALYZE is scheduled and will happen

Re: Support for NSS as a libpq TLS backend

2021-01-17 Thread Michael Paquier
On Tue, Nov 17, 2020 at 04:00:53PM +0100, Daniel Gustafsson wrote: > Nice, thanks for the fix! I've incorporated your patch into the attached v20 > which also fixes client side error reporting to be more readable. The SCRAM > tests are now also hooked up, albeit with SKIP blocks for NSS, so they

Re: Wrong usage of RelationNeedsWAL

2021-01-17 Thread Noah Misch
On Sun, Jan 17, 2021 at 10:36:31PM -0800, Noah Misch wrote: > On Mon, Jan 18, 2021 at 03:08:38PM +0900, Kyotaro Horiguchi wrote: > > At Fri, 15 Jan 2021 20:38:16 -0800, Noah Misch wrote in > > > On Wed, Jan 13, 2021 at 04:07:05PM +0900, Kyotaro Horiguchi wrote: > > > > ---

RE: POC: postgres_fdw insert batching

2021-01-17 Thread tsunakawa.ta...@fujitsu.com
Tomas-san, From: Amit Langote > Good thing you reminded me that this is about inserts, and in that > case no, ExecInitModifyTable() doesn't know all leaf partitions, it > only sees the root table whose batch_size doesn't really matter. So > it's really ExecInitRoutingInfo() that I would

Re: Deleting older versions in unique indexes to avoid page splits

2021-01-17 Thread Amit Kapila
On Mon, Jan 18, 2021 at 12:43 AM Peter Geoghegan wrote: > > On Sat, Jan 16, 2021 at 9:55 PM Amit Kapila wrote: > > Do we do this optimization (bottom-up deletion) only when the last > > item which can lead to page split has indexUnchanged set to true? If > > so, what if the last tuple doesn't

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

2021-01-17 Thread Bharath Rupireddy
On Mon, Jan 18, 2021 at 11:58 AM Fujii Masao wrote: > > > > On 2021/01/18 15:02, Hou, Zhijie wrote: > >> We need to create the loopback3 with user mapping public, otherwise the > >> test might become unstable as shown below. Note that loopback and > >> loopback2 are not dropped in the test, so no

Re: Wrong usage of RelationNeedsWAL

2021-01-17 Thread Noah Misch
On Mon, Jan 18, 2021 at 03:08:38PM +0900, Kyotaro Horiguchi wrote: > At Fri, 15 Jan 2021 20:38:16 -0800, Noah Misch wrote in > > On Wed, Jan 13, 2021 at 04:07:05PM +0900, Kyotaro Horiguchi wrote: > > > --- a/src/include/utils/snapmgr.h > > > +++ b/src/include/utils/snapmgr.h > > > @@ -37,7 +37,7

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

2021-01-17 Thread Fujii Masao
On 2021/01/18 15:02, Hou, Zhijie wrote: We need to create the loopback3 with user mapping public, otherwise the test might become unstable as shown below. Note that loopback and loopback2 are not dropped in the test, so no problem with them. ALTER SERVER loopback OPTIONS (ADD

Re: New IndexAM API controlling index vacuum strategies

2021-01-17 Thread Masahiko Sawada
On Mon, Jan 18, 2021 at 2:18 PM Masahiko Sawada wrote: > > On Tue, Jan 5, 2021 at 10:35 AM Masahiko Sawada wrote: > > > > On Tue, Dec 29, 2020 at 3:25 PM Masahiko Sawada > > wrote: > > > > > > On Tue, Dec 29, 2020 at 7:06 AM Peter Geoghegan wrote: > > > > > > > > On Sun, Dec 27, 2020 at 11:41

Re: Pg14, pg_dumpall and "password_encryption=true"

2021-01-17 Thread Michael Paquier
On Sun, Jan 17, 2021 at 02:20:10PM -0800, Noah Misch wrote: > On Sun, Jan 17, 2021 at 01:51:35PM +0100, Magnus Hagander wrote: >> Option 3 would be the closest to how other things work though, >> wuodln't it? Normally, it's the job of pg_dump (or pg_dumpall) to >> adapt the dump to the new version

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

2021-01-17 Thread Fujii Masao
On 2021/01/18 13:46, Bharath Rupireddy wrote: On Mon, Jan 18, 2021 at 9:38 AM Fujii Masao wrote: Please review v11 further. Thanks for updating the patch! The patch for postgres_fdw_get_connections() basically looks good to me. So at first I'd like to push it. Attached is the patch that

Re: Wrong usage of RelationNeedsWAL

2021-01-17 Thread Kyotaro Horiguchi
Thank you for the comments, Noah and Andres. At Fri, 15 Jan 2021 20:38:16 -0800, Noah Misch wrote in > On Wed, Jan 13, 2021 at 04:07:05PM +0900, Kyotaro Horiguchi wrote: > > The definition of the macro RelationNeedsWAL has been changed by > > c6b92041d3 to include conditions related to the

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

2021-01-17 Thread Hou, Zhijie
> We need to create the loopback3 with user mapping public, otherwise the > test might become unstable as shown below. Note that loopback and > loopback2 are not dropped in the test, so no problem with them. > > ALTER SERVER loopback OPTIONS (ADD use_remote_estimate 'off'); DROP > SERVER

Re: Is Recovery actually paused?

2021-01-17 Thread Dilip Kumar
On Sun, Jan 17, 2021 at 1:48 PM Dilip Kumar wrote: > > On Sat, Jan 16, 2021 at 8:59 AM Masahiko Sawada wrote: > > > > On Wed, Jan 13, 2021 at 9:20 PM Dilip Kumar wrote: > > > > > > On Wed, Jan 13, 2021 at 3:35 PM Dilip Kumar wrote: > > > > > > > > On Wed, Jan 13, 2021 at 3:27 PM Yugo NAGATA

Re: Transactions involving multiple postgres foreign servers, take 2

2021-01-17 Thread Masahiko Sawada
On Fri, Jan 15, 2021 at 7:45 AM Zhihong Yu wrote: > > For v32-0002-postgres_fdw-supports-commit-and-rollback-APIs.patch : > > + entry->changing_xact_state = true; > ... > + entry->changing_xact_state = abort_cleanup_failure; > > I don't see return statement in between the two assignments. I

RE: libpq debug log

2021-01-17 Thread k.jami...@fujitsu.com
Hi Iwata-san, In addition to Tsunakawa-san's comments, The compiler also complains: fe-misc.c:678:20: error: ‘lenPos’ may be used uninitialized in this function [-Werror=maybe-uninitialized] conn->outMsgStart = lenPos; There's no need for variable lenPos anymore since we have decided

Re: New IndexAM API controlling index vacuum strategies

2021-01-17 Thread Masahiko Sawada
On Tue, Jan 5, 2021 at 10:35 AM Masahiko Sawada wrote: > > On Tue, Dec 29, 2020 at 3:25 PM Masahiko Sawada wrote: > > > > On Tue, Dec 29, 2020 at 7:06 AM Peter Geoghegan wrote: > > > > > > On Sun, Dec 27, 2020 at 11:41 PM Peter Geoghegan wrote: > > > > I experimented with this today, and I

Re: Allow CLUSTER, VACUUM FULL and REINDEX to change tablespace on the fly

2021-01-17 Thread Michael Paquier
On Sat, Dec 12, 2020 at 01:45:26PM -0600, Justin Pryzby wrote: > It's a lot like what I wrote as [PATCH v31 1/5] ExecReindex and ReindexParams > In my v31 patch, I moved ReindexOptions to a private structure in indexcmds.c, > with an "int options" bitmask which is passed to reindex_index() et al.

Re: Parallel INSERT (INTO ... SELECT ...)

2021-01-17 Thread Greg Nancarrow
On Fri, Jan 15, 2021 at 7:39 PM Amit Kapila wrote: > > Here is an additional review of > v11-0001-Enable-parallel-SELECT-for-INSERT-INTO-.-SELECT. There are > quite a few comments raised on the V11-0001* patch. I suggest first > post a revised version of V11-0001* patch addressing those comments

Re: Allow CLUSTER, VACUUM FULL and REINDEX to change tablespace on the fly

2021-01-17 Thread Michael Paquier
On Thu, Jan 14, 2021 at 02:18:45PM +0900, Michael Paquier wrote: > Indeed. Let's first wait a couple of days and see if others have any > comments or objections about this v6. Hearing nothing, I have looked at that again this morning and applied v6 after a reindent and some adjustments in the

Re: [HACKERS] [PATCH] Generic type subscripting

2021-01-17 Thread Pavel Stehule
čt 14. 1. 2021 v 18:09 odesílatel Dian M Fay napsal: > On Thu Jan 14, 2021 at 10:04 AM EST, Dmitry Dolgov wrote: > > > On Tue, Jan 12, 2021 at 08:02:59PM +0100, Pavel Stehule wrote: > > > ne 10. 1. 2021 v 19:52 odesílatel Pavel Stehule < > pavel.steh...@gmail.com> > > > napsal: > > > > > > I

Re: some pointless HeapTupleHeaderIndicatesMovedPartitions calls

2021-01-17 Thread Pavan Deolasee
Hi Alvaro, On Tue, Sep 29, 2020 at 10:14 PM Alvaro Herrera wrote: > Hello > > Pavan Deolasee recently noted that a few of the > HeapTupleHeaderIndicatesMovedPartitions calls added by commit > 5db6df0c0117 are useless, since they are done after comparing t_self > with t_ctid. That's because

RE: Determine parallel-safety of partition relations for Inserts

2021-01-17 Thread tsunakawa.ta...@fujitsu.com
From: Amit Kapila > We already allow users to specify the degree of parallelism for all > the parallel operations via guc's max_parallel_maintenance_workers, > max_parallel_workers_per_gather, then we have a reloption > parallel_workers and vacuum command has the parallel option where > users can

Re: COPY FREEZE and setting PD_ALL_VISIBLE/visibility map bits

2021-01-17 Thread Pavan Deolasee
On Mon, Jan 18, 2021 at 3:02 AM Tomas Vondra wrote: > > > Pushed. Thanks everyone for the effort put into this patch. The first > version was sent in 2015, so it took quite a bit of time. > > Thanks Tomas, Anastasia and everyone else who worked on the patch and ensured that it gets into the

Re: PoC/WIP: Extended statistics on expressions

2021-01-17 Thread Justin Pryzby
On Sun, Jan 17, 2021 at 01:23:39AM +0100, Tomas Vondra wrote: > > CREATE TABLE t AS SELECT generate_series(1,9) AS i; > > CREATE STATISTICS s ON (i+1) ,(i+1+0) FROM t; > > ANALYZE t; > > SELECT i+1 FROM t GROUP BY 1; > > ERROR: corrupt MVNDistinct entry > > Thanks. There was a thinko in

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

2021-01-17 Thread Bharath Rupireddy
On Mon, Jan 18, 2021 at 9:38 AM Fujii Masao wrote: > > Please review v11 further. > > Thanks for updating the patch! > > The patch for postgres_fdw_get_connections() basically looks good to me. > So at first I'd like to push it. Attached is the patch that I extracted >

Re: Printing backtrace of postgres processes

2021-01-17 Thread Craig Ringer
On Mon, 18 Jan 2021 at 00:56, vignesh C wrote: > > Thanks for your comments Andres, I will ignore it for the processes > which do not have access to ProcSignal. I will make the changes and > post a patch for this soon. > I think that's sensible. I've had variable results with glibc's

Re: fdatasync(2) on macOS

2021-01-17 Thread Tom Lane
Thomas Munro writes: > On Sat, Jan 16, 2021 at 6:55 AM Tom Lane wrote: >> I have a vague recollection that we discussed changing the default >> wal_sync_method for Darwin years ago, but I don't recall why we >> didn't pull the trigger. These results certainly suggest that >> we oughta. > No

Re: Add docs stub for recovery.conf

2021-01-17 Thread Craig Ringer
On Thu, 14 Jan 2021 at 03:44, Stephen Frost wrote: > > Alright, how does this look? The new entries are all under the > 'obsolete' section to keep it out of the main line, but should work to > 'fix' the links that currently 404 and provide a bit of a 'softer' > landing for the other cases that

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

2021-01-17 Thread Fujii Masao
On 2021/01/18 12:33, Bharath Rupireddy wrote: On Sun, Jan 17, 2021 at 11:30 PM Zhihong Yu wrote: This patch introduces new function postgres_fdw_disconnect() when called with a foreign server name discards the associated connections with the server name. I think the following would read

Re: Asynchronous Append on postgres_fdw nodes.

2021-01-17 Thread Etsuro Fujita
On Fri, Jan 15, 2021 at 4:54 PM Kyotaro Horiguchi wrote: > Mmm. I meant that the function explicitly calls > ExecAppendAsyncRequest(), which finally calls fetch_more_data_begin() > (if needed). Conversely if the function dosn't call > ExecAppendAsyncRequsest, the next request to remote doesn't >

Re: fdatasync(2) on macOS

2021-01-17 Thread Thomas Munro
On Sat, Jan 16, 2021 at 6:55 AM Tom Lane wrote: > So it's not a no-op, but on the other hand it's not succeeding in getting > bits down to the platter. I'm not inclined to dike it out, but it does > seem problematic that we're defaulting to open_datasync, which is also > not getting bits down to

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

2021-01-17 Thread Bharath Rupireddy
On Sun, Jan 17, 2021 at 11:30 PM Zhihong Yu wrote: > This patch introduces new function postgres_fdw_disconnect() when > called with a foreign server name discards the associated > connections with the server name. > > I think the following would read better: > > This patch introduces a new

Re: Determine parallel-safety of partition relations for Inserts

2021-01-17 Thread Amit Kapila
On Mon, Jan 18, 2021 at 6:08 AM tsunakawa.ta...@fujitsu.com wrote: > > From: Amit Kapila > > I think it would be good if the parallelism works by default when > > required but I guess if we want to use something on these lines then > > we can always check if the parallel_workers option is

Re: Parallel INSERT (INTO ... SELECT ...)

2021-01-17 Thread Greg Nancarrow
On Fri, Jan 8, 2021 at 8:25 PM vignesh C wrote: > > For one of the test you can validate that the same transaction has > been used by all the parallel workers, you could use something like > below to validate: > SELECT COUNT(*) FROM (SELECT DISTINCT cmin,xmin FROM para_insert_p1) as dt; > >

Re: Determine parallel-safety of partition relations for Inserts

2021-01-17 Thread Amit Kapila
On Sun, Jan 17, 2021 at 4:45 PM Amit Langote wrote: > > On Sat, Jan 16, 2021 at 2:02 PM Amit Kapila wrote: > > On Fri, Jan 15, 2021 at 6:45 PM Amit Langote > > wrote: > > > On Fri, Jan 15, 2021 at 9:59 PM Amit Kapila > > > wrote: > > > > We want to do this for Inserts where only Select can

Re: adding wait_start column to pg_locks

2021-01-17 Thread torikoshia
On 2021-01-15 15:23, torikoshia wrote: Thanks for your reviewing and comments! On 2021-01-14 12:39, Ian Lawrence Barwick wrote: Looking at the code, this happens as the wait start time is being recorded in the lock record itself, so always contains the value reported by the latest lock

RE: libpq debug log

2021-01-17 Thread kuroda.hay...@fujitsu.com
Dear Tsunakawa-san, Iwata-san, > * Is setlinebuf() available on Windows? Maybe you should use setvbuf() > instead. Yeah, cfbot2021 throws errors: https://ci.appveyor.com/project/postgresql-cfbot/postgresql/build/1.0.124922 ``` src/interfaces/libpq/fe-connect.c(6776): warning C4013:

Re: COPY FREEZE and setting PD_ALL_VISIBLE/visibility map bits

2021-01-17 Thread Tatsuo Ishii
> Pushed. Thanks everyone for the effort put into this patch. The first > version was sent in 2015, so it took quite a bit of time. Great news. Thanks everyone who have been working on this. Best regards, -- Tatsuo Ishii SRA OSS, Inc. Japan English: http://www.sraoss.co.jp/index_en.php

RE: Parallel INSERT (INTO ... SELECT ...)

2021-01-17 Thread tsunakawa.ta...@fujitsu.com
Hello Tang-san, From: Amit Kapila > Can we test cases when we have few rows in the Select table (say 1000) > and there 500 or 1000 partitions. In that case, we won't select > parallelism but we have to pay the price of checking parallel-safety > of all partitions. Can you check this with 100,

Re: Key management with tests

2021-01-17 Thread Robert Haas
On Fri, Jan 15, 2021 at 7:56 PM Andres Freund wrote: > I think that's not at all acceptable. I don't mind hashing out details > on calls / off-list, but the design needs to be public, documented, and > reviewable. And if it's something the community can't understand, then > it can't get in.

RE: Determine parallel-safety of partition relations for Inserts

2021-01-17 Thread tsunakawa.ta...@fujitsu.com
From: Amit Kapila > I think it would be good if the parallelism works by default when > required but I guess if we want to use something on these lines then > we can always check if the parallel_workers option is non-zero for a > relation (with RelationGetParallelWorkers). So users can always say

Re: NOT VALID for Unique Indexes

2021-01-17 Thread David Fetter
On Thu, Jan 14, 2021 at 04:22:17PM +, Simon Riggs wrote: > As you may be aware the NOT VALID qualifier currently only applies to > CHECK and FK constraints, but not yet to unique indexes. I have had > customer requests to change that. This is a great feature! Not exactly on point with this,

Re: Add primary keys to system catalogs

2021-01-17 Thread Robert Haas
On Sat, Oct 3, 2020 at 9:27 AM Craig Ringer wrote: > Frankly I think we really need a way to mark FKs to be DISABLED or NOT > CHECKED or something and a way to mark them as NOT VALID. Rsther than > expecting uses to fiddle with the implementation triggers. But I don't think > FKs on system

Re: PoC/WIP: Extended statistics on expressions

2021-01-17 Thread Tomas Vondra
On 1/17/21 6:29 AM, Justin Pryzby wrote: On Sun, Jan 17, 2021 at 01:23:39AM +0100, Tomas Vondra wrote: diff --git a/doc/src/sgml/ref/create_statistics.sgml b/doc/src/sgml/ref/create_statistics.sgml index 4363be50c3..5b8eb8d248 100644 --- a/doc/src/sgml/ref/create_statistics.sgml +++

Re: PoC/WIP: Extended statistics on expressions

2021-01-17 Thread Tomas Vondra
On 1/17/21 3:55 AM, Zhihong Yu wrote: Hi, +    * Check that only the base rel is mentioned.  (This should be dead code +    * now that add_missing_from is history.) +    */ +   if (list_length(pstate->p_rtable) != 1) If it is dead code, it can be removed, right ? Maybe. The question is

Re: Yet another fast GiST build

2021-01-17 Thread Peter Geoghegan
On Sun, Jan 17, 2021 at 3:04 PM Peter Geoghegan wrote: > I personally agree with you - it's not like there aren't other ways > for superusers to crash the server (most of which seem very similar to > this gist_page_items() issue, in fact). I just think that it's worth > being clear about that

Re: Yet another fast GiST build

2021-01-17 Thread Peter Geoghegan
On Sun, Jan 17, 2021 at 2:52 PM Heikki Linnakangas wrote: > I'm not sure I understand. It's true that the raw page image can contain > data from a different index, or any garbage really. And the function > will behave badly if you do that. That's an accepted risk with > pageinspect functions,

Re: Yet another fast GiST build

2021-01-17 Thread Heikki Linnakangas
On 18/01/2021 00:35, Peter Geoghegan wrote: On Sun, Jan 17, 2021 at 12:50 PM Tom Lane wrote: I noticed that gist_page_items() thinks it can hold inter_call_data->rel open across a series of calls. That's completely unsafe: the executor might not run the call series to completion (see LIMIT),

Re: WIP: System Versioned Temporal Table

2021-01-17 Thread Vik Fearing
On 1/17/21 5:46 PM, Surafel Temesgen wrote: > On Sat, Jan 16, 2021 at 10:12 PM Vik Fearing > wrote: > >> >> I haven't looked at this patch in a while, but I hope that ALTER TABLE t >> ADD SYSTEM VERSIONING is not adding any columns. That is a bug if it does. >> >> > Yes, that is how I implement

Re: Yet another fast GiST build

2021-01-17 Thread Peter Geoghegan
On Sun, Jan 17, 2021 at 12:50 PM Tom Lane wrote: > I noticed that gist_page_items() thinks it can hold inter_call_data->rel > open across a series of calls. That's completely unsafe: the executor > might not run the call series to completion (see LIMIT), resulting in > relcache leak complaints.

Re: pg_collation_actual_version() ERROR: cache lookup failed for collation 123

2021-01-17 Thread Thomas Munro
On Mon, Jan 18, 2021 at 10:59 AM Justin Pryzby > |postgres=# SELECT pg_collation_actual_version(123); > |ERROR: cache lookup failed for collation 123 Yeah, not a great user experience. Will fix next week; perhaps get_collation_version_for_oid() needs missing_ok and found flags, or something

Re: Pg14, pg_dumpall and "password_encryption=true"

2021-01-17 Thread Noah Misch
On Sun, Jan 17, 2021 at 01:51:35PM +0100, Magnus Hagander wrote: > On Sat, Jan 16, 2021 at 8:27 AM Noah Misch wrote: > > On Fri, Jan 15, 2021 at 01:35:50PM +0900, Ian Lawrence Barwick wrote: > > > $ tail -3 pg_upgrade_utility.log > > > ALTER ROLE "postgres" SET "password_encryption" TO

Re: Add primary keys to system catalogs

2021-01-17 Thread Tom Lane
Peter Eisentraut writes: > [ v2-0001-Add-primary-keys-and-unique-constraints-to-system.patch ] I've reviewed this patch. It looks pretty solid to me, with a couple trivial nits as mentioned below, and one bigger thing that's perhaps in the category of bikeshedding. Namely, do we really want to

pg_collation_actual_version() ERROR: cache lookup failed for collation 123

2021-01-17 Thread Justin Pryzby
As of 257836a75, this returns: |postgres=# SELECT pg_collation_actual_version(123); |ERROR: cache lookup failed for collation 123 |postgres=# \errverbose |ERROR: XX000: cache lookup failed for collation 123 |LOCATION: get_collation_version_for_oid, pg_locale.c:1754 I'm of the impression

Re: pgbench: option delaying queries till connections establishment?

2021-01-17 Thread Thomas Munro
On Sat, Jan 9, 2021 at 8:13 AM Thomas Munro wrote: > On Sun, Jan 3, 2021 at 9:49 AM Fabien COELHO wrote: > > > Just for fun, the attached 0002 patch is a quick prototype of a > > > replacement for that stuff that seems to work OK on a Mac here. (I'm > > > not sure if the Windows part makes

Re: COPY FREEZE and setting PD_ALL_VISIBLE/visibility map bits

2021-01-17 Thread Tomas Vondra
On 1/16/21 11:18 PM, Tomas Vondra wrote: ... > Thanks for the updated patch, this version looks OK to me - I've marked it as RFC. I'll do a bit more testing, review, and then I'll get it committed. Pushed. Thanks everyone for the effort put into this patch. The first version was sent in

Re: Yet another fast GiST build

2021-01-17 Thread Tom Lane
Heikki Linnakangas writes: > On 12/01/2021 18:19, Andrey Borodin wrote: >> Thanks! Looks good to me. > Pushed, thanks! I noticed that gist_page_items() thinks it can hold inter_call_data->rel open across a series of calls. That's completely unsafe: the executor might not run the call series to

Re: evtfoid and evtowner missing in findoidjoins/README

2021-01-17 Thread Tom Lane
"Joel Jacobson" writes: > A bit of background: > I'm working on an extension where I need SQL access to this reference > information. My extension is successfully automatically helping me to > find problems in extension update-scripts, where an update from a > version to a version would give a

Re: evtfoid and evtowner missing in findoidjoins/README

2021-01-17 Thread Joel Jacobson
On Sun, Jan 17, 2021, at 18:16, Tom Lane wrote: > I kind of wonder whether findoidjoins has outlived its purpose and > we should just remove it (along with the oidjoins test script). A bit of background: I'm working on an extension where I need SQL access to this reference information. My

Re: Deleting older versions in unique indexes to avoid page splits

2021-01-17 Thread Peter Geoghegan
On Sat, Jan 16, 2021 at 9:55 PM Amit Kapila wrote: > Do we do this optimization (bottom-up deletion) only when the last > item which can lead to page split has indexUnchanged set to true? If > so, what if the last tuple doesn't have indexUnchanged but the > previous ones do have? Using the

Re: cgit view availabel

2021-01-17 Thread Chapman Flack
On 01/17/21 08:48, Magnus Hagander wrote: > I've finally gotten around to putting up a > cgit instance on our git server, to allow for browsing of the git > repositories. You can find this at: > > https://git.postgresql.org/cgit/ Interesting! Having never actively compared gitweb and cgit, what

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

2021-01-17 Thread Zhihong Yu
Hi, This patch introduces new function postgres_fdw_disconnect() when called with a foreign server name discards the associated connections with the server name. I think the following would read better: This patch introduces *a* new function postgres_fdw_disconnect(). When called with a foreign

Re: cgit view availabel

2021-01-17 Thread Magnus Hagander
On Sun, Jan 17, 2021 at 5:46 PM Victor Yegorov wrote: > > вс, 17 янв. 2021 г. в 17:19, Magnus Hagander : >> >> > First thing I've noted: >> > >> > >> > https://git.postgresql.org/cgit/postgresql.git/commit/960869da0803427d14335bba24393f414b476e2c >> > >> > silently shows another commit. >> >>

Re: Test harness for regex code (to allow importing Tcl's test suite)

2021-01-17 Thread Tom Lane
Alexander Lakhin writes: > select * from test_regex(repeat('(x)', 32), 'a', 'c'); > leads to > ==00:00:00:05.736 2605072== Invalid write of size 4 Indeed, silly oversight on my part. Fixed, thanks! regards, tom lane

Re: evtfoid and evtowner missing in findoidjoins/README

2021-01-17 Thread Tom Lane
"Joel Jacobson" writes: > The below references are already properly documented in >https://www.postgresql.org/docs/current/catalog-pg-event-trigger.html > but missing in src/tools/findoidjoins/README. > Join pg_catalog.pg_event_trigger.evtowner => pg_catalog.pg_authid.oid > Join

Re: Printing backtrace of postgres processes

2021-01-17 Thread vignesh C
On Sat, Jan 16, 2021 at 11:10 PM Andres Freund wrote: > > Hi, > > On Sat, Jan 16, 2021, at 09:34, vignesh C wrote: > > On Sat, Jan 16, 2021 at 1:40 AM Andres Freund wrote: > > > > > > On 2021-01-15 09:53:05 +0100, Peter Eisentraut wrote: > > > > On 2020-12-08 10:38, vignesh C wrote: > > > > > I

Re: list of extended statistics on psql

2021-01-17 Thread Justin Pryzby
On Sun, Jan 17, 2021 at 03:31:57PM +0100, Tomas Vondra wrote: > I've reverted the commit - once we find the right way to handle this, I'll > get it committed again. Please consider these doc changes for the next iteration. commit 1a69f648ce6c63ebb37b6d8ec7c6539b3cb70787 Author: Justin Pryzby

Re: WIP: System Versioned Temporal Table

2021-01-17 Thread Surafel Temesgen
On Sat, Jan 16, 2021 at 10:12 PM Vik Fearing wrote: > > I haven't looked at this patch in a while, but I hope that ALTER TABLE t > ADD SYSTEM VERSIONING is not adding any columns. That is a bug if it does. > > Yes, that is how I implement it. I don't understand how it became a bug? regards

Re: cgit view availabel

2021-01-17 Thread Victor Yegorov
вс, 17 янв. 2021 г. в 17:19, Magnus Hagander : > > First thing I've noted: > > > > > https://git.postgresql.org/cgit/postgresql.git/commit/960869da0803427d14335bba24393f414b476e2c > > > > silently shows another commit. > > Where did you get that URL from? > I've made it up manually, comparing

evtfoid and evtowner missing in findoidjoins/README

2021-01-17 Thread Joel Jacobson
The below references are already properly documented in https://www.postgresql.org/docs/current/catalog-pg-event-trigger.html but missing in src/tools/findoidjoins/README. Join pg_catalog.pg_event_trigger.evtowner => pg_catalog.pg_authid.oid Join pg_catalog.pg_event_trigger.evtfoid =>

Re: cgit view availabel

2021-01-17 Thread Magnus Hagander
On Sun, Jan 17, 2021 at 5:00 PM Victor Yegorov wrote: > > вс, 17 янв. 2021 г. в 14:48, Magnus Hagander : >> >> After a short time (ahem, several years) of badgering of me my a >> certain community member, I've finally gotten around to putting up a >> cgit instance on our git server, to allow for

Re: cgit view availabel

2021-01-17 Thread Victor Yegorov
вс, 17 янв. 2021 г. в 14:48, Magnus Hagander : > After a short time (ahem, several years) of badgering of me my a > certain community member, I've finally gotten around to putting up a > cgit instance on our git server, to allow for browsing of the git > repositories. You can find this at: > >

Re: POC: Cleaning up orphaned files using undo logs

2021-01-17 Thread Dmitry Dolgov
> On Fri, Dec 04, 2020 at 10:22:42AM +0100, Antonin Houska wrote: > Amit Kapila wrote: > > > On Fri, Nov 13, 2020 at 6:02 PM Antonin Houska wrote: > > > > > > Amit Kapila wrote: > > > > > > > On Thu, Nov 12, 2020 at 2:45 PM Antonin Houska wrote: > > > > > > > > If you want to track at undo

Re: Online checksums patch - once again

2021-01-17 Thread Magnus Hagander
On Fri, Jan 15, 2021 at 11:33 AM Daniel Gustafsson wrote: > > The attached v30 adds the proposed optimizations in this thread as previously > asked for, as well as some small cleanups to the procsignal calling codepath > (replacing single call functions with just calling the function) and some >

Re: list of extended statistics on psql

2021-01-17 Thread Tomas Vondra
On 1/17/21 3:01 AM, Tomas Vondra wrote: On 1/17/21 2:41 AM, Shinoda, Noriyoshi (PN Japan FSIP) wrote: Hi, hackers. I tested this committed feature. It doesn't seem to be available to non-superusers due to the inability to access pg_statistics_ext_data. Is this the expected behavior?

Re: WIP: document the hook system

2021-01-17 Thread Magnus Hagander
On Fri, Jan 15, 2021 at 8:28 AM Peter Eisentraut wrote: > > On 2020-12-31 04:28, David Fetter wrote: > > This could probably use a lot of filling in, but having it in the > > actual documentation beats needing to know folklore even to know > > that the capability is there. > > This patch seems

cgit view availabel

2021-01-17 Thread Magnus Hagander
After a short time (ahem, several years) of badgering of me my a certain community member, I've finally gotten around to putting up a cgit instance on our git server, to allow for browsing of the git repositories. You can find this at: https://git.postgresql.org/cgit/ or specifically for the

Re: Prevent printing "next step instructions" in initdb and pg_upgrade

2021-01-17 Thread Magnus Hagander
On Thu, Jan 7, 2021 at 11:53 AM Peter Eisentraut wrote: > > After pondering this again, I think we can go with initdb > --no-instructions, as in your patch. > > As a minor nitpick, I would leave out the > > else > printf(_("\nSuccess.\n")); > > in the --no-instructions case. OK,

Re: Add session statistics to pg_stat_database

2021-01-17 Thread Magnus Hagander
On Fri, Jan 8, 2021 at 10:34 AM Laurenz Albe wrote: > > On Fri, 2021-01-08 at 12:00 +0900, Masahiro Ikeda wrote: > > 2. monitoring.sgml > > > > > > IIUC, "active_time" includes the time executes a fast-path function > > > > and > > > > "idle in transaction" includes "idle in transaction(aborted)"

Re: Pg14, pg_dumpall and "password_encryption=true"

2021-01-17 Thread Magnus Hagander
On Sat, Jan 16, 2021 at 8:27 AM Noah Misch wrote: > > On Fri, Jan 15, 2021 at 01:35:50PM +0900, Ian Lawrence Barwick wrote: > > $ tail -3 pg_upgrade_utility.log > > ALTER ROLE "postgres" SET "password_encryption" TO 'true'; > > psql:pg_upgrade_dump_globals.sql:75: ERROR: invalid

Re: Determine parallel-safety of partition relations for Inserts

2021-01-17 Thread Amit Langote
On Sat, Jan 16, 2021 at 2:02 PM Amit Kapila wrote: > On Fri, Jan 15, 2021 at 6:45 PM Amit Langote wrote: > > On Fri, Jan 15, 2021 at 9:59 PM Amit Kapila wrote: > > > We want to do this for Inserts where only Select can be parallel and > > > Inserts will always be done by the leader backend.

Re: Dump public schema ownership & seclabels

2021-01-17 Thread Vik Fearing
On 1/17/21 10:41 AM, Noah Misch wrote: > On Sat, Jan 16, 2021 at 02:05:43PM +0100, Vik Fearing wrote: >> On 12/30/20 12:59 PM, Noah Misch wrote: >>> On Tue, Dec 29, 2020 at 05:49:24AM -0800, Noah Misch wrote: https://postgr.es/m/20201031163518.gb4039...@rfd.leadboat.com gave $SUBJECT as

Re: Dump public schema ownership & seclabels

2021-01-17 Thread Noah Misch
On Sat, Jan 16, 2021 at 02:05:43PM +0100, Vik Fearing wrote: > On 12/30/20 12:59 PM, Noah Misch wrote: > > On Tue, Dec 29, 2020 at 05:49:24AM -0800, Noah Misch wrote: > >> https://postgr.es/m/20201031163518.gb4039...@rfd.leadboat.com gave > >> $SUBJECT as > >> one of the constituent projects for

Re: Is Recovery actually paused?

2021-01-17 Thread Dilip Kumar
On Sat, Jan 16, 2021 at 8:59 AM Masahiko Sawada wrote: > > On Wed, Jan 13, 2021 at 9:20 PM Dilip Kumar wrote: > > > > On Wed, Jan 13, 2021 at 3:35 PM Dilip Kumar wrote: > > > > > > On Wed, Jan 13, 2021 at 3:27 PM Yugo NAGATA wrote: > > > > > > > > On Thu, 10 Dec 2020 11:25:23 +0530 > > > >