Re: [PATCH] Provide more information to filter_prepare

2021-03-28 Thread Amit Kapila
On Mon, Mar 29, 2021 at 11:42 AM Amit Kapila wrote: > > On Thu, Mar 25, 2021 at 2:07 PM Markus Wanner > wrote: > > > > On 22.03.21 09:50, Markus Wanner wrote: > > > thank you for reconsidering this patch. I updated it to include the > > > required adjustments to the documentation. Please review

RE: libpq debug log

2021-03-28 Thread tsunakawa.ta...@fujitsu.com
From: 'alvhe...@alvh.no-ip.org' > > > (Hey, what the heck is that "Z" at the end of the message? I thought > > > the error ended right at the \x00 ...) > > > > We'll investigate these issues. > > For what it's worth, I did fix this problem in patch 0005 that I > attached. The problem was that o

RE: libpq debug log

2021-03-28 Thread tsunakawa.ta...@fujitsu.com
From: Kyotaro Horiguchi > It's better to be short as far as it is clear enough. Actually '<' to > 'F' and '>' to 'B' is clear enough to me. So I don't need a longer > notation. Agreed, because the message format description in the PG manual uses F and B. Regards Takayuki Tsunakawa

Re: [PATCH] Provide more information to filter_prepare

2021-03-28 Thread Amit Kapila
On Thu, Mar 25, 2021 at 2:07 PM Markus Wanner wrote: > > On 22.03.21 09:50, Markus Wanner wrote: > > thank you for reconsidering this patch. I updated it to include the > > required adjustments to the documentation. Please review. > > I tweaked the wording in the docs a bit, resulting in a v3 of

Re: Walsender may fail to send wal to the end.

2021-03-28 Thread Michael Paquier
On Fri, Mar 26, 2021 at 10:16:40AM -0700, Andres Freund wrote: > Hi, > > On 2021-03-26 18:20:14 +0900, Kyotaro Horiguchi wrote: > > This is because XLogSendPhysical detects removal of the wal segment > > currently reading by shutdown checkpoint. However, there' no fear of > > overwriting of WAL s

Re: name of enum used in 'Cache if PathTarget and RestrictInfos contain volatile functions'

2021-03-28 Thread Peter Smith
On Mon, Mar 29, 2021 at 1:15 PM Zhihong Yu wrote: > > Hi, > I was looking at: > Cache if PathTarget and RestrictInfos contain volatile functions > > VOLATILITY_NOVOLATILE caught my attention. Since the enum values don't start > with HAS, I think VOLATILITY_NONVOLATILE would be easier to read. >

Re: invalid data in file backup_label problem on windows

2021-03-28 Thread Michael Paquier
On Sun, Mar 28, 2021 at 09:29:10AM -0400, Andrew Dunstan wrote: > - vital to the backup working, and must be written without modification. > + vital to the backup working and must be written without > modification, which > + may include opening the file in binary mode. += "on Windows"?

Re: TRUNCATE on foreign table

2021-03-28 Thread Michael Paquier
On Mon, Mar 29, 2021 at 10:53:14AM +0900, Fujii Masao wrote: > I understand the motivation of this. But the other DMLs like UPDATE also > do the same thing for foreign tables? That is, when those DML commands > are executed on foreign tables, their changes are WAL-logged in a publisher > side, > e

Re: libpq debug log

2021-03-28 Thread Kyotaro Horiguchi
At Mon, 29 Mar 2021 00:02:58 -0300, "'alvhe...@alvh.no-ip.org'" wrote in > On 2021-Mar-29, tsunakawa.ta...@fujitsu.com wrote: > > > > (Hey, what the heck is that "Z" at the end of the message? I thought > > > the error ended right at the \x00 ...) > > > > We'll investigate these issues. > >

Re: libpq debug log

2021-03-28 Thread 'alvhe...@alvh.no-ip.org'
On 2021-Mar-29, tsunakawa.ta...@fujitsu.com wrote: > > (Hey, what the heck is that "Z" at the end of the message? I thought > > the error ended right at the \x00 ...) > > We'll investigate these issues. For what it's worth, I did fix this problem in patch 0005 that I attached. The problem was

Re: Get memory contexts of an arbitrary backend process

2021-03-28 Thread torikoshia
On 2021-03-26 14:08, Kyotaro Horiguchi wrote: At Fri, 26 Mar 2021 14:02:49 +0900, Fujii Masao wrote in On 2021/03/26 13:28, Kyotaro Horiguchi wrote: >> "some contexts are omitted" >> "n child contexts: total_bytes = ..." > Sorry I missed that is already implemented. So my opnion is I agree >

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

2021-03-28 Thread Zhihong Yu
Hi, For show_resultcache_info() + if (rcstate->shared_info != NULL) + { The negated condition can be used with a return. This way, the loop can be unindented. + * ResultCache nodes are intended to sit above a parameterized node in the + * plan tree in order to cache results from them. Since

name of enum used in 'Cache if PathTarget and RestrictInfos contain volatile functions'

2021-03-28 Thread Zhihong Yu
Hi, I was looking at: Cache if PathTarget and RestrictInfos contain volatile functions VOLATILITY_NOVOLATILE caught my attention. Since the enum values don't start with HAS, I think VOLATILITY_NO*N*VOLATILE would be easier to read. Actually I think since the enums are defined in VolatileFunction

Re: wal stats questions

2021-03-28 Thread Kyotaro Horiguchi
At Mon, 29 Mar 2021 11:09:00 +0900 (JST), Kyotaro Horiguchi wrote in > At Fri, 26 Mar 2021 10:07:45 -0700, Andres Freund wrote > in > > Hi, > > > > On 2021-03-25 16:37:10 +0900, Kyotaro Horiguchi wrote: > > > On the other hand, the counters are incremented in XLogInsertRecord() > > > and I t

Re: wal stats questions

2021-03-28 Thread Kyotaro Horiguchi
At Fri, 26 Mar 2021 10:07:45 -0700, Andres Freund wrote in > Hi, > > On 2021-03-25 16:37:10 +0900, Kyotaro Horiguchi wrote: > > On the other hand, the counters are incremented in XLogInsertRecord() > > and I think we don't want add instructions there. > > I don't really buy this. Setting a bool

Re: multi-install PostgresNode

2021-03-28 Thread Michael Paquier
On Thu, Mar 25, 2021 at 09:23:22AM +0100, Peter Eisentraut wrote: > On 25.03.21 04:47, Michael Paquier wrote: >> This would imply an installation with some fancy --bindir or --libdir >> specified in ./configure. Never say never, but I also think that what >> has been committed is fine. > > /usr/l

Re: Allow matching whole DN from a client certificate

2021-03-28 Thread Michael Paquier
On Fri, Mar 26, 2021 at 09:34:03AM -0400, Andrew Dunstan wrote: > OK, here's a new patch. I hope to commit this within a few days. Thanks! + switch (port->hba->clientcertname) + { + case clientCertDN: + peer_username = port->peer_dn; + break; + default: +

Re: Bug on update timing of walrcv->flushedUpto variable

2021-03-28 Thread Kyotaro Horiguchi
Hi. (Added Nathan, Andrey and Heikki in Cc:) At Fri, 26 Mar 2021 23:44:21 +0800, "蔡梦娟(玊于)" wrote in > Hi, all > > Recently, I found a bug on update timing of walrcv->flushedUpto variable, > consider the following scenario, there is one Primary node, one Standby node > which streaming from P

Re: TRUNCATE on foreign table

2021-03-28 Thread Fujii Masao
On 2021/03/29 9:31, Kohei KaiGai wrote: Fujii-san, XLOG_HEAP_TRUNCATE record is written even for the truncation of a foreign table. Why is this necessary? Foreign-tables are often used to access local data structure, like columnar data files on filesystem, not only remote accesses like pos

Re: row filtering for logical replication

2021-03-28 Thread Euler Taveira
On Thu, Mar 25, 2021, at 8:15 AM, Peter Eisentraut wrote: > I have committed the 0001 patch. > > Attached are a few fixup patches that I recommend you integrate into > your patch set. They address backward compatibility with PG13, and a > few more stylistic issues. > > I suggest you combine yo

RE: libpq debug log

2021-03-28 Thread tsunakawa.ta...@fujitsu.com
From: alvhe...@alvh.no-ip.org > > Proposed changes on top of v29. > > This last one uses libpq_pipeline -t and verifies the output against an > expected > trace file. Applies on top of all the previous patches. I attach the whole > lot, > so that the CF bot has a chance to run it. Thank you

RE: libpq debug log

2021-03-28 Thread tsunakawa.ta...@fujitsu.com
From: alvhe...@alvh.no-ip.org > I added an option to the new libpq_pipeline program that it activates > libpq trace. It works nicely and I think we can add that to the > regression tests. That's good news. Thank you. > 1. The trace output for the error message won't be very nice, because it

Re: TRUNCATE on foreign table

2021-03-28 Thread Kohei KaiGai
Fujii-san, > XLOG_HEAP_TRUNCATE record is written even for the truncation of > a foreign table. Why is this necessary? > Foreign-tables are often used to access local data structure, like columnar data files on filesystem, not only remote accesses like postgres_fdw. In case when we want to impleme

Re: TRUNCATE on foreign table

2021-03-28 Thread Kohei KaiGai
Onishi-san, The v5 patch contains full-contents of "src/backend/commands/tablecmds.c.orig". Please check it. 2021年3月28日(日) 2:37 Kazutaka Onishi : > > Fujii-san, > > Thank you for your review! > Now I prepare v5 patch and I'll answer to your each comment. please > check this again. > m(_ _)m > > 1

Re: [HACKERS] Custom compression methods (buildfarm xupgrade)

2021-03-28 Thread Justin Pryzby
On Sun, Mar 28, 2021 at 04:48:29PM -0400, Andrew Dunstan wrote: > Nothing is hidden here - the diffs are reported, see for example > > What we're comparing here

Re: Getting better results from valgrind leak tracking

2021-03-28 Thread David Rowley
On Wed, 17 Mar 2021 at 15:31, Andres Freund wrote: > I'm a bit confused about the precise design of rs_private / > ParallelBlockTableScanWorkerData, specifically why it's been added to > TableScanDesc, instead of just adding it to HeapScanDesc? And why is it > allocated unconditionally, instead of

Re: Add docs stub for recovery.conf

2021-03-28 Thread Stephen Frost
Greetings, * Euler Taveira (eu...@eulerto.com) wrote: > On Sun, Mar 28, 2021, at 2:22 PM, Stephen Frost wrote: > > Unless there's anything further, will commit these soon. > I briefly looked at this patch and have a few comments. > > + > + pg_receivexlog renamed to > pg_recievewal > > s/pg_rec

Re: MultiXact\SLRU buffers configuration

2021-03-28 Thread Thomas Munro
On Sat, Mar 27, 2021 at 6:31 PM Andrey Borodin wrote: > > 27 марта 2021 г., в 01:26, Thomas Munro написал(а): > > , and murmurhash which is inlineable and > > branch-free. > I think pageno is a hash already. Why hash any further? And pages accessed > together will have smaller access time due t

Re: [HACKERS] Custom compression methods

2021-03-28 Thread Andrew Dunstan
On 3/24/21 12:45 PM, Tom Lane wrote: > 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

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

2021-03-28 Thread Vik Fearing
On 3/28/21 1:26 PM, Joel Jacobson wrote: > On Sun, Mar 28, 2021, at 12:25, Vik Fearing wrote: >> On 3/27/21 9:27 PM, Joel Jacobson wrote: >>> Imagine if we could simply write the SQL query like this: >>> >>> SELECT DISTINCT od.order_id.customer_id.company_name >>> FROM order_details AS od >>> WHERE

Re: Add docs stub for recovery.conf

2021-03-28 Thread Euler Taveira
On Sun, Mar 28, 2021, at 2:22 PM, Stephen Frost wrote: > Unless there's anything further, will commit these soon. I briefly looked at this patch and have a few comments. + + pg_receivexlog renamed to pg_recievewal s/pg_recievewal/pg_receivewal/ + + Obsolete or renamed features, settings and fi

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

2021-03-28 Thread Bernd Helmle
Am Mittwoch, dem 24.03.2021 um 17:32 +0100 schrieb Bernd Helmle: > > 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 > > explicitl

Re: Add docs stub for recovery.conf

2021-03-28 Thread Stephen Frost
Greetings, * Stephen Frost (sfr...@snowman.net) wrote: > Awesome, attached is just a rebase (not that anything really changed). > Unless someone wants to speak up, I'll commit this soonish (hopefully > tomorrow, but at least sometime later this week). Alright, as this took a bit more playing with

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

2021-03-28 Thread Pavel Stehule
ne 28. 3. 2021 v 17:58 odesílatel Julien Rouhaud napsal: > On Sun, Mar 28, 2021 at 05:12:10PM +0200, Pavel Stehule wrote: > > > > Yes, this has a benefit just for plpgsql. I can imagine a little bit > > different API of plpgsql that allows more direct calls than now. For > example > > > > static

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

2021-03-28 Thread Julien Rouhaud
On Sun, Mar 28, 2021 at 05:12:10PM +0200, Pavel Stehule wrote: > > Yes, this has a benefit just for plpgsql. I can imagine a little bit > different API of plpgsql that allows more direct calls than now. For example > > static PLpgSQL_function * > do_compile(FunctionCallInfo fcinfo, > <--><--> H

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

2021-03-28 Thread Stephen Frost
Greetings, * Stephen Frost (sfr...@snowman.net) wrote: > * 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 co

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

2021-03-28 Thread Pavel Stehule
ne 28. 3. 2021 v 16:04 odesílatel Julien Rouhaud napsal: > On Sun, Mar 28, 2021 at 03:52:35PM +0200, Joel Jacobson wrote: > > On Sun, Mar 28, 2021, at 15:12, Pavel Stehule wrote: > > > Maybe I don't understand your proposal well, I am sorry. Creating your > own language should not be hard, but in

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

2021-03-28 Thread Andrew Dunstan
On 3/28/21 10:04 AM, Tom Lane wrote: > Andrew Dunstan writes: >> On 3/27/21 5:11 PM, Alvaro Herrera wrote: >>> This seems pretty dangerous -- you just have to create one more FK, and >>> suddenly a query that worked perfectly fine, now starts throwing errors >>> because it's now ambiguous. Feel

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

2021-03-28 Thread Joel Jacobson
On Sun, Mar 28, 2021, at 16:04, Tom Lane wrote: > Andrew Dunstan mailto:andrew%40dunslane.net>> writes: > > Maybe. I don't recall ever having seen a column with more than one FK. > > Is that a common thing? In itself it seems like a bad idea. > > Yeah, that aspect seems like a complete show-stoppe

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

2021-03-28 Thread Tom Lane
Andrew Dunstan writes: > On 3/27/21 5:11 PM, Alvaro Herrera wrote: >> This seems pretty dangerous -- you just have to create one more FK, and >> suddenly a query that worked perfectly fine, now starts throwing errors >> because it's now ambiguous. Feels a bit like JOIN NATURAL, which many >> peop

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

2021-03-28 Thread Julien Rouhaud
On Sun, Mar 28, 2021 at 03:52:35PM +0200, Joel Jacobson wrote: > On Sun, Mar 28, 2021, at 15:12, Pavel Stehule wrote: > > Maybe I don't understand your proposal well, I am sorry. Creating your own > > language should not be hard, but in this case the plpgsql is not well > > extendable. The import

Re: [PATCH] Enhancements to pg_stat_statements contrib extension

2021-03-28 Thread Julien Rouhaud
Hi, On Sun, Mar 28, 2021 at 09:05:10AM +0200, Yoan SULTAN wrote: > > *Needs :* > Formerly, Oracle DBA, I used to query v$sql to know the latest queries > issued by each session with their timestamp. I found postgresql > pg_stat_statements very useful for this need, but the aggregation did not > a

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

2021-03-28 Thread Joel Jacobson
On Sun, Mar 28, 2021, at 15:12, Pavel Stehule wrote: > Maybe I don't understand your proposal well, I am sorry. Creating your own > language should not be hard, but in this case the plpgsql is not well > extendable. The important structures are private. You can do it, but you > should do a full

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

2021-03-28 Thread Pavel Stehule
ne 28. 3. 2021 v 14:39 odesílatel Joel Jacobson napsal: > On Sun, Mar 28, 2021, at 13:51, Pavel Stehule wrote: > > There were some similar tools already. Personally I like the current > state, where tables should be explicitly defined, and join should be > explicitly defined. The joining of tabl

Re: invalid data in file backup_label problem on windows

2021-03-28 Thread Andrew Dunstan
On 3/26/21 2:45 PM, David Steele wrote: > On 3/26/21 1:20 PM, Magnus Hagander wrote: >> On Fri, Mar 26, 2021 at 5:52 PM Andrew Dunstan >> wrote: >>> On 3/26/21 10:19 AM, David Steele wrote: > No, the problem is you are using copy/paste and in doing so you are > *changing'* the value

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

2021-03-28 Thread Andrew Dunstan
On 3/27/21 5:11 PM, Alvaro Herrera wrote: > On 2021-Mar-27, Joel Jacobson wrote: > >> If there would be multiple foreign keys on a column we try to follow, >> the query planner would throw an error forcing the user to use explicit >> joins instead. > This seems pretty dangerous -- you just have

Re: [PATCH] Hooks at XactCommand level

2021-03-28 Thread Julien Rouhaud
On Sat, Mar 20, 2021 at 06:33:24PM +0800, Julien Rouhaud wrote: > > So, I have nothing more to say about the patch itself. At that point, I guess > that we can't keep postponing that topic, and we should either: > > - commit this patch, or Álvaro's one based on a new grammar keyword for BEGIN >

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

2021-03-28 Thread Pavel Stehule
ne 28. 3. 2021 v 14:45 odesílatel Joel Jacobson napsal: > On Sun, Mar 28, 2021, at 14:27, Pavel Stehule wrote: > > ne 28. 3. 2021 v 13:49 odesílatel Joel Jacobson > napsal: > > It would of course be a problem since other plpgsql extensions could be in > conflict with such a label, > so maybe we

Re: [Proposal] Global temporary tables

2021-03-28 Thread Andrew Dunstan
On 3/17/21 7:59 AM, wenjing wrote: > ok > > The cause of the problem is that the name of the dependent function > (readNextTransactionID) has changed. I fixed it. > > This patch(V43) is base on 9fd2952cf4920d563e9cea51634c5b364d57f71a > > Wenjing > > I have fixed this patch so that a) it applies

RE: invalid data in file backup_label problem on windows

2021-03-28 Thread wangsh.f...@fujitsu.com
Hi, David Steele wrote: >On 3/26/21 1:20 PM, Magnus Hagander wrote: >> On Fri, Mar 26, 2021 at 5:52 PM Andrew Dunstan wrote: >>> On 3/26/21 10:19 AM, David Steele wrote: > No, the problem is you are using copy/paste and in doing so you are > *changing'* the value that is being retur

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

2021-03-28 Thread Joel Jacobson
On Sun, Mar 28, 2021, at 14:27, Pavel Stehule wrote: > ne 28. 3. 2021 v 13:49 odesílatel Joel Jacobson napsal: >> __It would of course be a problem since other plpgsql extensions could be in >> conflict with such a label, >> so maybe we could allow creating a new language, "plmycorp", using the s

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

2021-03-28 Thread Joel Jacobson
On Sun, Mar 28, 2021, at 13:51, Pavel Stehule wrote: > There were some similar tools already. Personally I like the current state, > where tables should be explicitly defined, and join should be explicitly > defined. The joining of tables is not cheap - and I like the visibility of > this. On t

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

2021-03-28 Thread Pavel Stehule
ne 28. 3. 2021 v 13:49 odesílatel Joel Jacobson napsal: > +1 > > I really like this feature. > > Is there a way to avoid having to write the "#ROUTINE_LABEL" for every > function defined? > > I'm thinking if a company writing a lot of plpgsql functions want to > decide on a company wide hard-code

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

2021-03-28 Thread Joel Jacobson
On Sat, Mar 27, 2021, at 22:11, Alvaro Herrera wrote: > On 2021-Mar-27, Joel Jacobson wrote: > > > If there would be multiple foreign keys on a column we try to follow, > > the query planner would throw an error forcing the user to use explicit > > joins instead. > > This seems pretty dangerous

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

2021-03-28 Thread Pavel Stehule
ne 28. 3. 2021 v 13:27 odesílatel Joel Jacobson napsal: > On Sun, Mar 28, 2021, at 12:25, Vik Fearing wrote: > > On 3/27/21 9:27 PM, Joel Jacobson wrote: > > Imagine if we could simply write the SQL query like this: > > > > SELECT DISTINCT od.order_id.customer_id.company_name > > FROM order_detai

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

2021-03-28 Thread Joel Jacobson
+1 I really like this feature. Is there a way to avoid having to write the "#ROUTINE_LABEL" for every function defined? I'm thinking if a company writing a lot of plpgsql functions want to decide on a company wide hard-coded label to use for all their plpgsql functions. Could it be set global

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

2021-03-28 Thread Joel Jacobson
On Sun, Mar 28, 2021, at 12:25, Vik Fearing wrote: > On 3/27/21 9:27 PM, Joel Jacobson wrote: > > Imagine if we could simply write the SQL query like this: > > > > SELECT DISTINCT od.order_id.customer_id.company_name > > FROM order_details AS od > > WHERE od.product_id.product_name = 'Chocolade';

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

2021-03-28 Thread Vik Fearing
On 3/27/21 9:27 PM, Joel Jacobson wrote: > Hi, > > The database Neo4j has a language called "Cypher" where one of the key > selling points is they "don’t need join tables". > > Here is an example from > https://neo4j.com/developer/cypher/guide-sql-to-cypher/ > > SQL: > > SELECT DISTINCT c.com

Re: [Proposal] Global temporary tables

2021-03-28 Thread Pavel Stehule
Hi I wrote simple benchmarks. I checked the possible slowdown of connections to postgres when GTT is used. /usr/local/pgsql/master/bin/pgbench -c 10 -C -f script4.sql -t 1000 script has one line just with INSERT or SELECT LIMIT 1; PATCH insert to global temp table (with connect) -- 349 tps (10

Re: [Proposal] Global temporary tables

2021-03-28 Thread Pavel Stehule
Hi st 17. 3. 2021 v 12:59 odesílatel wenjing napsal: > ok > > The cause of the problem is that the name of the dependent function > (readNextTransactionID) has changed. I fixed it. > > This patch(V43) is base on 9fd2952cf4920d563e9cea51634c5b364d57f71a > > Wenjing > I tested this patch and make