Re: shared-memory based stats collector

2021-04-01 Thread Kyotaro Horiguchi
At Thu, 1 Apr 2021 19:44:25 -0700, Andres Freund wrote in > Hi, > > I spent quite a bit more time working on the patch. There's are large > changes: > > - postmaster/pgstats.c (which is an incorrect location now that it's not > a subprocess anymore) is split into utils/activity/pgstat.c and >

Fix typo in verify_heapam.c

2021-04-01 Thread Masahiko Sawada
Hi all, I found typos in verify_heapam.c. s/comitted/committed/ Please find an attached patch. Regards, -- Masahiko Sawada EDB: https://www.enterprisedb.com/ fix_typo.patch Description: Binary data

Re: libpq debug log

2021-04-01 Thread Kyotaro Horiguchi
At Fri, 02 Apr 2021 01:45:06 -0400, Tom Lane wrote in > Kyotaro Horiguchi writes: > > At Fri, 2 Apr 2021 02:56:44 +, "iwata@fujitsu.com" > > wrote in > >> Do ErrorResponse and NoticeResponse vary from test to test ...? > >> If so, it seemed difficult to make the trace logs available f

Re: Replication slot stats misgivings

2021-04-01 Thread Bharath Rupireddy
On Fri, Apr 2, 2021 at 9:57 AM vignesh C wrote: > Thanks for the comments, I will fix the comments and provide a patch > for this soon. Here are some comments: 1) How about something like below +(errmsg("skipping \"%s\" replication slot statistics as the statistic coll

Re: Replication slot stats misgivings

2021-04-01 Thread Amit Kapila
On Thu, Apr 1, 2021 at 6:19 PM Masahiko Sawada wrote: > > On Tue, Mar 30, 2021 at 9:58 AM Andres Freund wrote: > > > > IMO, independent of the shutdown / startup issue, it'd be worth writing > > a patch tracking the bytes sent independently of the slot stats storage > > issues. That would also ma

Re: libpq debug log

2021-04-01 Thread Kyotaro Horiguchi
At Fri, 02 Apr 2021 14:40:09 +0900 (JST), Kyotaro Horiguchi wrote in > At Fri, 2 Apr 2021 02:56:44 +, "iwata@fujitsu.com" > wrote in > > Hi Alvaro san > > > > Thank you for your fix of trace log code. > > > > > From: 'alvhe...@alvh.no-ip.org' > > > Sent: Friday, April 2, 2021 11:30

Re: libpq debug log

2021-04-01 Thread Tom Lane
Kyotaro Horiguchi writes: > At Fri, 2 Apr 2021 02:56:44 +, "iwata@fujitsu.com" > wrote in >> Do ErrorResponse and NoticeResponse vary from test to test ...? >> If so, it seemed difficult to make the trace logs available for regression >> test. >> I will also investigate the cause of t

policies with security definer option for allowing inline optimization

2021-04-01 Thread Dan Lynch
RLS policies quals/checks are optimized inline, and so I generally avoid writing a separate procedure so the optimizer can do it's thing. However, if you need a security definer to avoid recursive RLS if you're doing a more complex query say, on a join table, anyone wish there was a flag on the po

Re: pgbench - add pseudo-random permutation function

2021-04-01 Thread Fabien COELHO
See attached v27 proposal. As usual, it is easier to see with the actual attachement:-) -- Fabien.diff --git a/doc/src/sgml/ref/pgbench.sgml b/doc/src/sgml/ref/pgbench.sgml index 50cf22ba6b..84d9566f49 100644 --- a/doc/src/sgml/ref/pgbench.sgml +++ b/doc/src/sgml/ref/pgbench.sgml @@ -1057,7 +

Re: libpq debug log

2021-04-01 Thread Kyotaro Horiguchi
At Fri, 2 Apr 2021 02:56:44 +, "iwata@fujitsu.com" wrote in > Hi Alvaro san > > Thank you for your fix of trace log code. > > > From: 'alvhe...@alvh.no-ip.org' > > Sent: Friday, April 2, 2021 11:30 AM > ... > > It still didn't fix it! Drongo is now reporting a difference in the > >

Re: Fix pg_checksums progress report

2021-04-01 Thread Fujii Masao
On 2021/04/02 14:23, shinya11.k...@nttdata.com wrote: Hi, I found a problem with the pg_checksums.c. The total_size is calculated by scanning the directory. The current_size is calculated by scanning the files, but the current_size does not include the size of NewPages. This may cause pg_c

Re: pgbench - add pseudo-random permutation function

2021-04-01 Thread Fabien COELHO
r = (uint64) (pg_erand48(random_state.xseed) * size); I do not understand why the random values are multiplied by anything in the first place… These are just random integers in the range [0,mask] and [0,size-1], formed in exactly the same way as getrand(). Indeed, erand returns a double,

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

2021-04-01 Thread Julien Rouhaud
On Thu, Apr 01, 2021 at 03:27:11PM -0400, Bruce Momjian wrote: > > OK, I am happy with your design decisions, thanks. Thanks! While double checking I noticed that I failed to remove a (now) useless include of pgstat.h in nodeGatherMerge.c in last version. I'm attaching v22 to fix that, no other

RE: [bug fix] ALTER TABLE SET LOGGED/UNLOGGED on a partitioned table does nothing silently

2021-04-01 Thread tsunakawa.ta...@fujitsu.com
From: Bharath Rupireddy > Attaching a small patch that emits a warning when the persistence setting of a > partitioned table is changed and also added a note into the docs. Please have > a > look at it. Thank you. However, I think I'll withdraw this CF entry since I'm not sure I can take time

Fix pg_checksums progress report

2021-04-01 Thread Shinya11.Kato
Hi, I found a problem with the pg_checksums.c. The total_size is calculated by scanning the directory. The current_size is calculated by scanning the files, but the current_size does not include the size of NewPages. This may cause pg_checksums progress report to not be 100%. I have attached a

RE: Add client connection check during the execution of the query

2021-04-01 Thread tsunakawa.ta...@fujitsu.com
From: Thomas Munro > > Following PostmasterIsAlive(), maybe it's better to name it as > pq_connection_is_alive() pq_client_is_alive(), or pq_frontend_is_alive() like > the pqcomm.c's head comment uses the word frontend? > > I think it's OK, because it matches the name of the GUC. I'm more concer

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

2021-04-01 Thread Michael Paquier
On Fri, Apr 02, 2021 at 12:03:21AM +, Jacob Champion wrote: > On Thu, 2021-04-01 at 10:21 +0900, Michael Paquier wrote: > > This stuff can take advantage of 0d1a3343, and I > > think that we should make the kerberos, ldap, authentication and SSL > > test suites just use connect_ok() and connect

Re: [bug fix] ALTER TABLE SET LOGGED/UNLOGGED on a partitioned table does nothing silently

2021-04-01 Thread Bharath Rupireddy
On Thu, Mar 25, 2021 at 10:21 PM David Steele wrote: > This thread seems to be stalled. Since it represents a bug fix is there > something we can do in the meantime while a real solution is worked out? > > Perhaps just inform the user that nothing was done? Or get something > into the documentatio

Re: Replication slot stats misgivings

2021-04-01 Thread vignesh C
On Fri, Apr 2, 2021 at 9:29 AM Masahiko Sawada wrote: > > On Fri, Apr 2, 2021 at 1:55 AM vignesh C wrote: > > > > On Thu, Apr 1, 2021 at 5:58 PM Amit Kapila wrote: > > > > > > On Thu, Apr 1, 2021 at 3:43 PM vignesh C wrote: > > > > > > > > On Wed, Mar 31, 2021 at 11:32 AM vignesh C wrote: > >

Re: Replication slot stats misgivings

2021-04-01 Thread Masahiko Sawada
On Fri, Apr 2, 2021 at 1:55 AM vignesh C wrote: > > On Thu, Apr 1, 2021 at 5:58 PM Amit Kapila wrote: > > > > On Thu, Apr 1, 2021 at 3:43 PM vignesh C wrote: > > > > > > On Wed, Mar 31, 2021 at 11:32 AM vignesh C wrote: > > > > > > > > On Tue, Mar 30, 2021 at 11:00 AM Andres Freund > > > > wr

Re: New IndexAM API controlling index vacuum strategies

2021-04-01 Thread Peter Geoghegan
On Thu, Apr 1, 2021 at 6:14 AM Robert Haas wrote: > Without offering an opinion on this particular implementation choice, > +1 for the idea of trying to make the table-with-indexes and the > table-without-indexes cases work in ways that will feel similar to the > user. Tables without indexes are p

Re: Add client connection check during the execution of the query

2021-04-01 Thread Thomas Munro
On Fri, Apr 2, 2021 at 1:36 AM Bharath Rupireddy wrote: > Here's a minor comment: it would be good if we have an extra line > after variable assignments, before and after function calls/if > clauses, something like Done in v11. Thanks.

Re: Add client connection check during the execution of the query

2021-04-01 Thread Thomas Munro
On Thu, Apr 1, 2021 at 10:16 PM tsunakawa.ta...@fujitsu.com wrote: > From: Thomas Munro > > I changed my mind. Let's commit the pleasingly simple Linux-only feature > > for > > now, and extend to it to send some kind of no-op message in a later release. > > So this is the version I'd like to go

Re: Flaky vacuum truncate test in reloptions.sql

2021-04-01 Thread Masahiko Sawada
On Fri, Apr 2, 2021 at 9:46 AM Michael Paquier wrote: > > On Thu, Apr 01, 2021 at 10:54:29PM +0900, Masahiko Sawada wrote: > > Looks good to me too. > > Okay, applied and back-patched down to 12 then. Thank you! Regards, -- Masahiko Sawada EDB: https://www.enterprisedb.com/

RE: libpq debug log

2021-04-01 Thread iwata....@fujitsu.com
Hi Alvaro san Thank you for your fix of trace log code. > From: 'alvhe...@alvh.no-ip.org' > Sent: Friday, April 2, 2021 11:30 AM ... > It still didn't fix it! Drongo is now reporting a difference in the expected > trace -- > and the differences all seem to be message lengths. > Now that is pre

Re: shared-memory based stats collector

2021-04-01 Thread Andres Freund
Hi, I spent quite a bit more time working on the patch. There's are large changes: - postmaster/pgstats.c (which is an incorrect location now that it's not a subprocess anymore) is split into utils/activity/pgstat.c and utils/activity/pgstat_kind.c. I don't love the _kind name, but I couldn

Re: TRUNCATE on foreign table

2021-04-01 Thread Fujii Masao
On 2021/04/02 9:37, Kohei KaiGai wrote: It is fair enough for me to reverse the order of actual truncation. How about the updated comments below? This is a multi-relation truncate. We first open and grab exclusive lock on all relations involved, checking permissions (local databas

Re: libpq debug log

2021-04-01 Thread 'alvhe...@alvh.no-ip.org'
On 2021-Apr-01, 'alvhe...@alvh.no-ip.org' wrote: > Ooh, wow ... now that is a silly bug! Thanks, I'll push the fix in a > minute. It still didn't fix it! Drongo is now reporting a difference in the expected trace -- and the differences all seem to be message lengths. Now that is pretty mysterio

Re: Data type correction in pgstat_report_replslot function parameters

2021-04-01 Thread vignesh C
On Thu, Apr 1, 2021 at 11:18 PM Fujii Masao wrote: > > > > On 2021/04/02 2:18, Jeevan Ladhe wrote: > > > > > > On Thu, Apr 1, 2021 at 10:20 PM vignesh C > > wrote: > > > > Hi, > > > > While I was reviewing replication slot statistics code, I found one > > i

Re: Hybrid Hash/Nested Loop joins and caching results from subplans

2021-04-01 Thread David Rowley
On Thu, 1 Apr 2021 at 23:41, houzj.f...@fujitsu.com wrote: > > > I've attached the updated patch. I'll let the CFbot grab this to ensure > > it's > > happy with it before I go looking to push it again. > > Hi, > > I took a look into the patch and noticed some minor things. > > 1. > +

Re: Flaky vacuum truncate test in reloptions.sql

2021-04-01 Thread Michael Paquier
On Thu, Apr 01, 2021 at 10:54:29PM +0900, Masahiko Sawada wrote: > Looks good to me too. Okay, applied and back-patched down to 12 then. -- Michael signature.asc Description: PGP signature

Re: TRUNCATE on foreign table

2021-04-01 Thread Kohei KaiGai
2021年4月1日(木) 18:53 Fujii Masao : > > On 2021/04/01 0:09, Kohei KaiGai wrote: > > What does the "permission checks" mean in this context? > > The permission checks on the foreign tables involved are already checked > > at truncate_check_rel(), by PostgreSQL's standard access control. > > I meant tha

Process initialization labyrinth

2021-04-01 Thread Andres Freund
Hi, While working on the shared memory stats patch I (not for the first time), issues with our process initialization. The concrete issue was that I noticed that some stats early in startup weren't processed correctly - the stats system wasn't initialized yet. I consequently added assertions ensu

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

2021-04-01 Thread Jacob Champion
On Thu, 2021-04-01 at 10:21 +0900, Michael Paquier wrote: > This stuff can take advantage of 0d1a3343, and I > think that we should make the kerberos, ldap, authentication and SSL > test suites just use connect_ok() and connect_fails() from > PostgresNode.pm. They just need to be extended a bit wi

Re: DROP INDEX docs - explicit lock naming

2021-04-01 Thread Michael Paquier
On Thu, Apr 01, 2021 at 08:26:50AM -0400, Greg Rychlewski wrote: > Thanks! I apologize, I added a commitfest entry for this and failed to add > it to my message: https://commitfest.postgresql.org/33/3053/. > > This is my first time submitting a patch and I'm not sure if it needs to be > deleted no

Re: WIP: WAL prefetch (another approach)

2021-04-01 Thread Thomas Munro
On Fri, Mar 19, 2021 at 2:29 PM Tomas Vondra wrote: > On 3/18/21 1:54 AM, Thomas Munro wrote: > > I'm now looking at Horiguchi-san and Heikki's patch[2] to remove > > XLogReader's callbacks, to try to understand how these two patch sets > > are related. I don't really like the way those callbacks

Re: OpenBSD versus semaphores

2021-04-01 Thread Thomas Munro
On Fri, Apr 2, 2021 at 9:42 AM Tom Lane wrote: > Thomas Munro writes: > > On Tue, Jan 8, 2019 at 7:14 PM Tom Lane wrote: > >> So I looked around for an alternative, and found out that modern > >> OpenBSD releases support named POSIX semaphores (though not unnamed > >> ones, at least not shared u

Re: Force lookahead in COPY FROM parsing

2021-04-01 Thread Heikki Linnakangas
On 18/03/2021 17:09, John Naylor wrote: The cfbot thinks this patch no longer applies, but it works for me, so still set to RFC. It looks like it's because the thread to remove the v2 FE/BE protocol was still attached to the commitfest entry. I've deleted that, so let's see if that helps. It

Re: pg_amcheck contrib application

2021-04-01 Thread Robert Haas
On Thu, Apr 1, 2021 at 1:41 PM Robert Haas wrote: > OK, committed. We still need to deal with what you had as 0003 > upthread, so I guess the next step is for me to spend some time > reviewing that one. I did this, and it was a bit depressing. It appears that we now have duplicate checks for xmin

Re: New predefined roles- 'pg_read/write_all_data'

2021-04-01 Thread Stephen Frost
Greetings, * gkokola...@pm.me (gkokola...@pm.me) wrote: > On Monday, November 23, 2020 11:31 PM, Stephen Frost > wrote: > > - Anastasia Lubennikova (a.lubennik...@postgrespro.ru) wrote: > > > > > On 29.10.2020 17:19, Stephen Frost wrote: > > > > > > > - Georgios Kokolatos (gkokola...@protonm

Re: Default role -> Predefined role

2021-04-01 Thread Stephen Frost
Greetings, * Stephen Frost (sfr...@snowman.net) wrote: > Unless there's anything further on this, I'll plan to push in the next > day or so. ... and done. Thanks! Stephen signature.asc Description: PGP signature

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

2021-04-01 Thread Bruce Momjian
On Fri, Apr 2, 2021 at 02:28:02AM +0800, Julien Rouhaud wrote: > Unless I'm missing something query_string isn't a global variable, it's a > parameter passed to exec_simple_query() from postgresMain(). > > It's then passed to the stats collector to be able to be displayed in > pg_stat_activity th

Re: libpq debug log

2021-04-01 Thread 'alvhe...@alvh.no-ip.org'
On 2021-Apr-01, Tom Lane wrote: > So drongo is still failing, and after a bit of looking around at > other code I finally got hit with the clue hammer. Per port.h: > > * On Windows, setvbuf() does not support _IOLBF mode, and interprets that > * as _IOFBF. To add insult to injury, setvbuf(fil

Re: libpq debug log

2021-04-01 Thread 'alvhe...@alvh.no-ip.org'
On 2021-Apr-01, Tom Lane wrote: > "'alvhe...@alvh.no-ip.org'" writes: > > On 2021-Apr-01, Tom Lane wrote: > >> BTW, what in the world is this supposed to accomplish? > >> -(long long) rows_to_send); > >> +(1L << 62) + (long long) rows_to_send); > >

Re: Since '2001-09-09 01:46:40'::timestamp microseconds are lost when extracting epoch

2021-04-01 Thread Peter Eisentraut
On 19.03.21 21:06, Tom Lane wrote: Yeah, I was wondering if we could do something like that, but I hadn't got as far as figuring a way to deal with divisors not a multiple of NBASE. Looking at the proposed code, I wonder if it wouldn't be better to define the function as taking the base-10-log o

Re: libpq debug log

2021-04-01 Thread Tom Lane
So drongo is still failing, and after a bit of looking around at other code I finally got hit with the clue hammer. Per port.h: * On Windows, setvbuf() does not support _IOLBF mode, and interprets that * as _IOFBF. To add insult to injury, setvbuf(file, NULL, _IOFBF, 0) * crashes outright if

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

2021-04-01 Thread Julien Rouhaud
On Thu, Apr 01, 2021 at 01:59:15PM -0400, Bruce Momjian wrote: > On Thu, Apr 1, 2021 at 01:56:42PM -0400, Bruce Momjian wrote: > > You are using: > > > > /* -- > > * pgstat_get_my_queryid() - > > * > > * Return current backend's query identifier. > > */ > >

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

2021-04-01 Thread Bruce Momjian
On Thu, Apr 1, 2021 at 01:56:42PM -0400, Bruce Momjian wrote: > You are using: > > /* -- >* pgstat_get_my_queryid() - >* >* Return current backend's query identifier. >*/ > uint64 > pgstat_get_my_queryid(void) > { >

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

2021-04-01 Thread Bruce Momjian
On Thu, Apr 1, 2021 at 11:30:15PM +0800, Julien Rouhaud wrote: > On Thu, Apr 01, 2021 at 11:05:24PM +0800, Julien Rouhaud wrote: > > On Wed, Mar 31, 2021 at 11:18:45AM -0300, Alvaro Herrera wrote: > > > On 2021-Mar-31, Bruce Momjian wrote: > > > > > > > > I assume it is since Alvaro didn't reply.

Re: Data type correction in pgstat_report_replslot function parameters

2021-04-01 Thread Fujii Masao
On 2021/04/02 2:18, Jeevan Ladhe wrote: On Thu, Apr 1, 2021 at 10:20 PM vignesh C mailto:vignes...@gmail.com>> wrote: Hi, While I was reviewing replication slot statistics code, I found one issue in the data type used for pgstat_report_replslot function parameters. We pass

Re: libpq debug log

2021-04-01 Thread Tom Lane
"'alvhe...@alvh.no-ip.org'" writes: > On 2021-Apr-01, Tom Lane wrote: >> BTW, what in the world is this supposed to accomplish? >> -(long long) rows_to_send); >> +(1L << 62) + (long long) rows_to_send); > It makes the text representation wider, whic

Re: pg_amcheck contrib application

2021-04-01 Thread Robert Haas
On Thu, Apr 1, 2021 at 1:24 PM Mark Dilger wrote: > > On Apr 1, 2021, at 10:20 AM, Robert Haas wrote: > > OK, let's try that again. > Looks good! OK, committed. We still need to deal with what you had as 0003 upthread, so I guess the next step is for me to spend some time reviewing that one. --

Re: pg_amcheck contrib application

2021-04-01 Thread Mark Dilger
> On Apr 1, 2021, at 10:20 AM, Robert Haas wrote: > > On Thu, Apr 1, 2021 at 1:06 PM Mark Dilger > wrote: >> Seems fine other than the typo. > > OK, let's try that again. Looks good! — Mark Dilger EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company

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

2021-04-01 Thread Fujii Masao
On 2021/04/02 1:13, Bharath Rupireddy wrote: On Thu, Apr 1, 2021 at 8:56 PM Fujii Masao wrote: Attaching v21 patch set, rebased onto the latest master. I agree to add the server-level option. But I'm still not sure if it's good idea to also expose that option as GUC. Isn't the server-le

Re: pg_amcheck contrib application

2021-04-01 Thread Robert Haas
On Thu, Apr 1, 2021 at 1:06 PM Mark Dilger wrote: > Seems fine other than the typo. OK, let's try that again. -- Robert Haas EDB: http://www.enterprisedb.com v17-0001-amcheck-Fix-verify_heapam-s-tuple-visibility-che.patch Description: Binary data

Re: Data type correction in pgstat_report_replslot function parameters

2021-04-01 Thread Jeevan Ladhe
On Thu, Apr 1, 2021 at 10:20 PM vignesh C wrote: > Hi, > > While I was reviewing replication slot statistics code, I found one > issue in the data type used for pgstat_report_replslot function > parameters. We pass int64 variables to the function but the function > prototype uses int type. I I fe

Re: pg_amcheck contrib application

2021-04-01 Thread Mark Dilger
> On Apr 1, 2021, at 9:56 AM, Robert Haas wrote: > > On Thu, Apr 1, 2021 at 12:32 PM Mark Dilger > wrote: >>> - If xmax is a multi but seems to be garbled, I changed it to return >>> true rather than false. The inserter is known to have committed by >>> that point, so I think it's OK to try t

Re: pg_amcheck contrib application

2021-04-01 Thread Robert Haas
On Thu, Apr 1, 2021 at 12:32 PM Mark Dilger wrote: > > - If xmax is a multi but seems to be garbled, I changed it to return > > true rather than false. The inserter is known to have committed by > > that point, so I think it's OK to try to deform the tuple. We just > > shouldn't try to check TOAST

Re: Replication slot stats misgivings

2021-04-01 Thread vignesh C
On Thu, Apr 1, 2021 at 5:58 PM Amit Kapila wrote: > > On Thu, Apr 1, 2021 at 3:43 PM vignesh C wrote: > > > > On Wed, Mar 31, 2021 at 11:32 AM vignesh C wrote: > > > > > > On Tue, Mar 30, 2021 at 11:00 AM Andres Freund wrote: > > > > > > > > Hi, > > > > > > > > On 2021-03-30 10:13:29 +0530, vig

Data type correction in pgstat_report_replslot function parameters

2021-04-01 Thread vignesh C
Hi, While I was reviewing replication slot statistics code, I found one issue in the data type used for pgstat_report_replslot function parameters. We pass int64 variables to the function but the function prototype uses int type. I I felt the function parameters should be int64. Attached patch fix

Re: pg_amcheck contrib application

2021-04-01 Thread Mark Dilger
> On Apr 1, 2021, at 8:08 AM, Robert Haas wrote: > > On Wed, Mar 31, 2021 at 12:34 AM Mark Dilger > wrote: >> These changes got lost between v11 and v12. I've put them back, as well as >> updating to use your language. > > Here's an updated patch that includes your 0001 and 0002 plus a bun

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

2021-04-01 Thread Bharath Rupireddy
On Thu, Apr 1, 2021 at 8:56 PM Fujii Masao wrote: > > > Attaching v21 patch set, rebased onto the latest master. > > I agree to add the server-level option. But I'm still not sure if it's good > idea to also expose that option as GUC. Isn't the server-level option enough > for most cases? > > Al

Re: libpq debug log

2021-04-01 Thread 'alvhe...@alvh.no-ip.org'
On 2021-Apr-01, Tom Lane wrote: > BTW, what in the world is this supposed to accomplish? > > -(long long) rows_to_send); > +(1L << 62) + (long long) rows_to_send); > > Various buildfarm members are complaining that the shift distance > is more than

Re: truncating timestamps on arbitrary intervals

2021-04-01 Thread John Naylor
On Thu, Apr 1, 2021 at 9:11 AM Salek Talangi wrote: > > Hi all, > > it might be a bit late now, but do you know that TimescaleDB already has a similar feature, named time_bucket? > https://docs.timescale.com/latest/api#time_bucket > Perhaps that can help with some design decisions. Yes, thanks I'

Re: Support ALTER SUBSCRIPTION ... ADD/DROP PUBLICATION ... syntax

2021-04-01 Thread Bharath Rupireddy
On Tue, Mar 23, 2021 at 8:39 PM Japin Li wrote: > I check the duplicates for newpublist in merge_publications(). The code is > copied from publicationListToArray(). IMO, we can have the same code inside a function, probably named "check_duplicates_in_publist" or some other better name: static voi

Re: Asynchronous Append on postgres_fdw nodes.

2021-04-01 Thread Etsuro Fujita
On Fri, Apr 2, 2021 at 12:09 AM Tom Lane wrote: > The buildfarm points out that this fails under valgrind. > I easily reproduced it here: > Sorta looks like something is relying on a pointer into the relcache > to be valid for longer than it can safely rely on that. The > CLOBBER_CACHE_ALWAYS an

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

2021-04-01 Thread Julien Rouhaud
On Thu, Apr 01, 2021 at 11:05:24PM +0800, Julien Rouhaud wrote: > On Wed, Mar 31, 2021 at 11:18:45AM -0300, Alvaro Herrera wrote: > > On 2021-Mar-31, Bruce Momjian wrote: > > > > > > I assume it is since Alvaro didn't reply. I am planning to apply this > > > soon. > > > > I'm afraid I don't know

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

2021-04-01 Thread Fujii Masao
On 2021/02/22 14:55, Bharath Rupireddy wrote: On Thu, Feb 4, 2021 at 9:36 AM Bharath Rupireddy wrote: On Wed, Feb 3, 2021 at 4:22 PM Fujii Masao wrote: Maybe my explanation in the previous email was unclear. What I think is; If the server-level option is explicitly specified, its setting

Re: Asynchronous Append on postgres_fdw nodes.

2021-04-01 Thread Tom Lane
Etsuro Fujita writes: > Pushed. The buildfarm points out that this fails under valgrind. I easily reproduced it here: ==00:00:03:42.115 3410499== Syscall param epoll_wait(events) points to unaddressable byte(s) ==00:00:03:42.115 3410499==at 0x58E926B: epoll_wait (epoll_wait.c:30) ==00:00:03

Re: pg_amcheck contrib application

2021-04-01 Thread Robert Haas
On Wed, Mar 31, 2021 at 12:34 AM Mark Dilger wrote: > These changes got lost between v11 and v12. I've put them back, as well as > updating to use your language. Here's an updated patch that includes your 0001 and 0002 plus a bunch of changes by me. I intend to commit this version unless somebo

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

2021-04-01 Thread Julien Rouhaud
On Wed, Mar 31, 2021 at 11:18:45AM -0300, Alvaro Herrera wrote: > On 2021-Mar-31, Bruce Momjian wrote: > > > > I assume it is since Alvaro didn't reply. I am planning to apply this > > soon. > > I'm afraid I don't know enough about how parallel query works to make a > good assessment on this bei

Re: ModifyTable overheads in generic plans

2021-04-01 Thread Amit Langote
On Thu, Apr 1, 2021 at 10:12 PM Amit Langote wrote: > > On Thu, Apr 1, 2021 at 3:12 AM Tom Lane wrote: > > Amit Langote writes: > > > [ v14-0002-Initialize-result-relation-information-lazily.patch ] > > Needs YA rebase over 86dc90056. > > Done. I will post the updated results for -Mprepared ben

Re: libpq debug log

2021-04-01 Thread Tom Lane
BTW, what in the world is this supposed to accomplish? -(long long) rows_to_send); +(1L << 62) + (long long) rows_to_send); Various buildfarm members are complaining that the shift distance is more than the width of "long", which I'd just fix with s

Re: Rename of triggers for partitioned tables

2021-04-01 Thread Arne Roland
Alvaro Herrera wrote: > I think the child cannot not have a corresponding trigger. If you try > to drop the trigger on child, it should say that it cannot be dropped > because the trigger on parent requires it. So I don't think there's any > case where altering name of trigger in parent would rai

Re: sepgsql logging

2021-04-01 Thread Dave Page
On Thu, Apr 1, 2021 at 3:23 PM Tom Lane wrote: > Andrew Dunstan writes: > > On 4/1/21 8:32 AM, Dave Page wrote: > >> It seems to me that sepgsql should also log the denial, but flag that > >> permissive mode is on. > > > +1 for doing what selinux does if possible. > > +1. If selinux itself is d

Re: sepgsql logging

2021-04-01 Thread Tom Lane
Andrew Dunstan writes: > On 4/1/21 8:32 AM, Dave Page wrote: >> It seems to me that sepgsql should also log the denial, but flag that >> permissive mode is on. > +1 for doing what selinux does if possible. +1. If selinux itself is doing that, it's hard to see a reason why we should not; and I c

Re: [POC] verifying UTF-8 using SIMD instructions

2021-04-01 Thread John Naylor
v9 is just a rebase. -- John Naylor EDB: http://www.enterprisedb.com From e876049ad3b153e8725ab23f65ae8f021a970470 Mon Sep 17 00:00:00 2001 From: John Naylor Date: Thu, 1 Apr 2021 08:24:05 -0400 Subject: [PATCH v9] Replace pg_utf8_verifystr() with two faster implementations: On x86-64, we use S

Re: sepgsql logging

2021-04-01 Thread Andrew Dunstan
On 4/1/21 8:32 AM, Dave Page wrote: > Hi > > I've been trying to figure out selinux with sepgsql (which is proving > quite difficult as there is an almost total lack of > documentation/blogs etc. on the topic) and ran into an issue. Whilst > my system had selinux in enforcing mode, I mistakenly h

Re: Support for NSS as a libpq TLS backend

2021-04-01 Thread Stephen Frost
Greetings, * Michael Paquier (mich...@paquier.xyz) wrote: > On Wed, Mar 31, 2021 at 10:15:15PM +, Jacob Champion wrote: > > I think we're going to need some analogue to PQinitOpenSSL() to help > > client applications cut through the mess, but I'm not sure what it > > should look like, or how w

Re: libpq debug log

2021-04-01 Thread Tom Lane
"'alvhe...@alvh.no-ip.org'" writes: > Eh, so I forgot to strdup(optarg[optind]). Apparently that works fine > in glibc but other getopt implementations are likely not so friendly. Hmm ... interesting theory, but I don't think I buy it, since the program isn't doing anything that should damage ar

Re: Flaky vacuum truncate test in reloptions.sql

2021-04-01 Thread Masahiko Sawada
On Thu, Apr 1, 2021 at 5:49 PM Michael Paquier wrote: > > On Thu, Apr 01, 2021 at 10:58:25AM +0300, Arseny Sher wrote: > > How about the attached? Thank you for updating the patch! > Sounds fine to me. Sawada-san? Looks good to me too. Regards, -- Masahiko Sawada EDB: https://www.enterpris

Re: Crash in BRIN minmax-multi indexes

2021-04-01 Thread Zhihong Yu
Hi, Tomas: Thanks for the correction. I think switching to interval_cmp_value() would be better (with a comment explaining why). Cheers On Thu, Apr 1, 2021 at 6:23 AM Tomas Vondra wrote: > On 4/1/21 3:09 PM, Zhihong Yu wrote: > > Hi, > > Can you try this patch ? > > > > Thanks > > > > diff --g

Re: Crash in BRIN minmax-multi indexes

2021-04-01 Thread Tomas Vondra
On 4/1/21 3:09 PM, Zhihong Yu wrote: > Hi, > Can you try this patch ? > > Thanks > > diff --git a/src/backend/access/brin/brin_minmax_multi.c > b/src/backend/access/brin/brin_minmax_multi.c > index 70109960e8..25d6d2e274 100644 > --- a/src/backend/access/brin/brin_minmax_multi.c > +++ b/src/backe

Re: truncating timestamps on arbitrary intervals

2021-04-01 Thread Salek Talangi
Hi all, it might be a bit late now, but do you know that TimescaleDB already has a similar feature, named time_bucket? https://docs.timescale.com/latest/api#time_bucket Perhaps that can help with some design decisions. I saw your feature on Depesz' "Waiting for PostgreSQL 14" and remembered readin

Re: New IndexAM API controlling index vacuum strategies

2021-04-01 Thread Robert Haas
On Wed, Mar 31, 2021 at 9:44 PM Masahiko Sawada wrote: > > But let me think about it...I suppose we could do it when one-pass > > VACUUM considers vacuuming a range of FSM pages every > > VACUUM_FSM_EVERY_PAGES. That's kind of similar to index vacuuming, in > > a way -- it wouldn't be too bad to c

Re: ModifyTable overheads in generic plans

2021-04-01 Thread Amit Langote
On Thu, Apr 1, 2021 at 3:12 AM Tom Lane wrote: > Amit Langote writes: > > [ v14-0002-Initialize-result-relation-information-lazily.patch ] > Needs YA rebase over 86dc90056. Done. I will post the updated results for -Mprepared benchmarks I did in the other thread shortly. -- Amit Langote EDB: h

Re: Crash in BRIN minmax-multi indexes

2021-04-01 Thread Zhihong Yu
Hi, Can you try this patch ? Thanks diff --git a/src/backend/access/brin/brin_minmax_multi.c b/src/backend/access/brin/brin_minmax_multi.c index 70109960e8..25d6d2e274 100644 --- a/src/backend/access/brin/brin_minmax_multi.c +++ b/src/backend/access/brin/brin_minmax_multi.c @@ -2161,7 +2161,7 @@

Re: Replication slot stats misgivings

2021-04-01 Thread Masahiko Sawada
On Tue, Mar 30, 2021 at 9:58 AM Andres Freund wrote: > > IMO, independent of the shutdown / startup issue, it'd be worth writing > a patch tracking the bytes sent independently of the slot stats storage > issues. That would also make the testing for the above cheaper... Agreed. I think the bytes

Re: libpq debug log

2021-04-01 Thread 'alvhe...@alvh.no-ip.org'
On 2021-Mar-31, Tom Lane wrote: > I wrote: > > That is weird - only test 4 (of 8) runs at all, the rest seem to > > fail to connect. What's different about pipelined_insert? > > Oh ... there's a pretty obvious theory. pipelined_insert is > the only one that is not asked to write a trace file. >

Re: Add client connection check during the execution of the query

2021-04-01 Thread Bharath Rupireddy
On Thu, Apr 1, 2021 at 11:29 AM Thomas Munro wrote: > > On Tue, Mar 30, 2021 at 10:00 AM Thomas Munro wrote: > > If we want to ship this in v14 we have to make a decision ASAP: > > > > 1. Ship the POLLHUP patch (like v9) that only works reliably on > > Linux. Maybe disable the feature completel

sepgsql logging

2021-04-01 Thread Dave Page
Hi I've been trying to figure out selinux with sepgsql (which is proving quite difficult as there is an almost total lack of documentation/blogs etc. on the topic) and ran into an issue. Whilst my system had selinux in enforcing mode, I mistakenly had sepgsql in permissive mode. I created a table

Re: Replication slot stats misgivings

2021-04-01 Thread Amit Kapila
On Thu, Apr 1, 2021 at 3:43 PM vignesh C wrote: > > On Wed, Mar 31, 2021 at 11:32 AM vignesh C wrote: > > > > On Tue, Mar 30, 2021 at 11:00 AM Andres Freund wrote: > > > > > > Hi, > > > > > > On 2021-03-30 10:13:29 +0530, vignesh C wrote: > > > > On Tue, Mar 30, 2021 at 6:28 AM Andres Freund >

Re: DROP INDEX docs - explicit lock naming

2021-04-01 Thread Greg Rychlewski
Thanks! I apologize, I added a commitfest entry for this and failed to add it to my message: https://commitfest.postgresql.org/33/3053/. This is my first time submitting a patch and I'm not sure if it needs to be deleted now or if you are supposed to add yourself as a committer. On Thu, Apr 1, 20

Re: Failed assertion on standby while shutdown

2021-04-01 Thread Fujii Masao
On 2021/03/31 19:51, Maxim Orlov wrote: On 2021-03-30 20:44, Maxim Orlov wrote: The following review has been posted through the commitfest application: make installcheck-world:  tested, passed Implements feature:   tested, passed Spec compliant:   not tested Documentation:

Re: Autovacuum on partitioned table (autoanalyze)

2021-04-01 Thread yuzuko
Hi Tomas, Thank you for reviewing the patch. > Firstly, the patch propagates the changes_since_analyze values from > do_analyze_rel, i.e. from the worker after it analyzes the relation. > That may easily lead to cases with unnecessary analyzes - consider a > partitioned with 4 child relations: >

RE: Hybrid Hash/Nested Loop joins and caching results from subplans

2021-04-01 Thread houzj.f...@fujitsu.com
> I've attached the updated patch. I'll let the CFbot grab this to ensure it's > happy with it before I go looking to push it again. Hi, I took a look into the patch and noticed some minor things. 1. + case T_ResultCache: + ptype = "ResultCache"; +

Re: Any objections to implementing LogicalDecodeMessageCB for pgoutput?

2021-04-01 Thread Amit Kapila
On Wed, Nov 25, 2020 at 8:58 AM Euler Taveira wrote: > > On Wed, 18 Nov 2020 at 03:04, David Pirotte wrote: >> >> On Fri, Nov 6, 2020 at 7:05 AM Ashutosh Bapat >> wrote: >>> >>> +/* >>> + * Write MESSAGE to stream >>> + */ >>> +void >>> +logicalrep_write_message(StringInfo out, ReorderBufferTXN

Re: Replication slot stats misgivings

2021-04-01 Thread vignesh C
On Wed, Mar 31, 2021 at 11:32 AM vignesh C wrote: > > On Tue, Mar 30, 2021 at 11:00 AM Andres Freund wrote: > > > > Hi, > > > > On 2021-03-30 10:13:29 +0530, vignesh C wrote: > > > On Tue, Mar 30, 2021 at 6:28 AM Andres Freund wrote: > > > > Any chance you could write a tap test exercising a few

Re: Get memory contexts of an arbitrary backend process

2021-04-01 Thread Fujii Masao
On 2021/03/31 15:16, Kyotaro Horiguchi wrote: + The memory contexts will be logged based on the log configuration set. For example: How do you think? How about "The memory contexts will be logged in the server log" ? I think "server log" doesn't suggest any concrete target. Or just using

Re: TRUNCATE on foreign table

2021-04-01 Thread Fujii Masao
On 2021/04/01 0:09, Kohei KaiGai wrote: What does the "permission checks" mean in this context? The permission checks on the foreign tables involved are already checked at truncate_check_rel(), by PostgreSQL's standard access control. I meant that's the permission check that happens in the r

  1   2   >