Re: psql tab completion for \h with IMPORT FOREIGN SCHEMA

2021-03-18 Thread Julien Rouhaud
On Thu, Mar 18, 2021 at 03:58:46PM +0900, Michael Paquier wrote: > > Well, as $subject tells, I just found confusing that \h does not > complete the so-said command, the only one using IMPORT as keyword, > so I'd like to do the following: > --- a/src/bin/psql/tab-complete.c > +++ b/src/bin/psql/ta

Re: A new function to wait for the backend exit after termination

2021-03-18 Thread Fujii Masao
On 2021/03/17 11:58, Kyotaro Horiguchi wrote: The first suggested signature for pg_terminate_backend() with timeout was pg_terminate_backend(pid, timeout). The current signature (pid, wait?, timeout) looks redundant. Maybe the reason for rejecting 0 astimeout is pg_terminate_backend(pid, tru

RE: libpq debug log

2021-03-18 Thread iwata....@fujitsu.com
Hi Alvaro san and Tsunakawa san, Thank you for your review. I updated patch to v27. `make check` output is following. I think it is OK. ``` 2021-03-18 07:02:55.090598 < ReadyForQuery 5 I 2021-03-18 07:02:55.090672 > Terminate 4

Re: [PATCH] pgbench: improve \sleep meta command

2021-03-18 Thread Fujii Masao
On 2021/03/17 16:40, kuroda.hay...@fujitsu.com wrote: Dear Fujii-san, Thank you for updating the patch. Thanks for the review! I understand that you don't want to change the current specification. ```diff + if (usec == 0) + { + char

RE: libpq debug log

2021-03-18 Thread tsunakawa.ta...@fujitsu.com
From: Iwata, Aya/岩田 彩 > > Yes, precisely, 2 bytes for the double quotes needs to be subtracted > > as > > follows: > > > > len = fprintf(...); > > *cursor += (len - 2); > > Thank you for your advice. I changed pqTraceOutputString set cursor to fprintf > return -2. > And I removed cursor m

Re: A new function to wait for the backend exit after termination

2021-03-18 Thread Bharath Rupireddy
On Thu, Mar 18, 2021 at 12:46 PM Fujii Masao wrote: > On 2021/03/17 11:58, Kyotaro Horiguchi wrote: > > The first suggested signature for pg_terminate_backend() with timeout > > was pg_terminate_backend(pid, timeout). The current signature (pid, > > wait?, timeout) looks redundant. Maybe the rea

Re: psql tab completion for \h with IMPORT FOREIGN SCHEMA

2021-03-18 Thread gkokolatos
‐‐‐ Original Message ‐‐‐ On Thursday, March 18, 2021 8:13 AM, Julien Rouhaud wrote: > On Thu, Mar 18, 2021 at 03:58:46PM +0900, Michael Paquier wrote: > > > Well, as $subject tells, I just found confusing that \h does not > > complete the so-said command, the only one using IMPORT a

Re: fdatasync performance problem with large number of DB files

2021-03-18 Thread Paul Guo
About the syncfs patch, my first impression on the guc name sync_after_crash is that it is a boolean type. Not sure about other people's feeling. Do you guys think It is better to rename it to a clearer name like sync_method_after_crash or others?

Re: PoC/WIP: Extended statistics on expressions

2021-03-18 Thread Dean Rasheed
On Wed, 17 Mar 2021 at 21:31, Tomas Vondra wrote: > > I agree applying at least the [(a+b),c] stats is probably the right > approach, as it means we're considering at least the available > information about dependence between the columns. > > I think to improve this, we'll need to teach the code t

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

2021-03-18 Thread Michael Paquier
On Mon, Mar 15, 2021 at 03:50:48PM +, Jacob Champion wrote: > # might need to retry if logging collector process is slow... > my $max_attempts = 180 * 10; > my $first_logfile; > for (my $attempts = 0; $attempts < $max_attempts; $attempts++

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

2021-03-18 Thread Peter Eisentraut
On 15.03.21 18:35, Tom Lane wrote: Anyway, taking a quick look at the v4 patch, the only complaint I have is that it seems a bit bulky and brute-force to duplicate so much code. Is it feasible to share most of the implementation between old and new functions, returning (say) an int64 that can th

Re: libpq debug log

2021-03-18 Thread Kyotaro Horiguchi
At Thu, 18 Mar 2021 07:34:36 +, "tsunakawa.ta...@fujitsu.com" wrote in > From: Iwata, Aya/岩田 彩 > > > Yes, precisely, 2 bytes for the double quotes needs to be subtracted > > > as > > > follows: > > > > > > len = fprintf(...); > > > *cursor += (len - 2); > > > > Thank you for your advic

Re: SSL SNI

2021-03-18 Thread Peter Eisentraut
On 26.02.21 23:27, Greg Stark wrote: Do you mean the IPv6 detection code is not correct? What is the problem? This bit, will recognize ipv4 addresses but not ipv6 addresses: + /* + * Set Server Name Indication (SNI), but not if it's a literal IP address. + * (RFC 6066) + */ + if (!(strspn(con

Re: shared-memory based stats collector

2021-03-18 Thread Andres Freund
Hi, On 2021-03-18 16:56:02 +0900, Kyotaro Horiguchi wrote: > At Tue, 16 Mar 2021 10:27:55 +0900 (JST), Kyotaro Horiguchi > wrote in > > At Mon, 15 Mar 2021 17:49:36 +0900 (JST), Kyotaro Horiguchi > > wrote in > > > Thanks for committing this! I'm very happy to see this reduces the > > > siz

Re: SSL SNI

2021-03-18 Thread Magnus Hagander
On Thu, Mar 18, 2021 at 9:31 AM Peter Eisentraut wrote: > > On 26.02.21 23:27, Greg Stark wrote: > >> Do you mean the IPv6 detection code is not correct? What is the problem? > > > > This bit, will recognize ipv4 addresses but not ipv6 addresses: > > > > + /* > > + * Set Server Name Indication (S

RE: libpq debug log

2021-03-18 Thread tsunakawa.ta...@fujitsu.com
From: Kyotaro Horiguchi > + pqTraceOutputR(const char *message, FILE *f) > + { > + int cursor = 0; > + > + pqTraceOutputInt32(message, &cursor, f); > > I don't understand the reason for spliting message and &cursor here. > > + pqTraceOutputR(const char *message, FILE *f) > + { > +

Query about 'initdb' error

2021-03-18 Thread ??????
Dear hacker:     I am a student from Nanjing University. I have some troubles about command 'initdb'. After I modify sth about system catalog, I use initdb to init the database. But it caused this problem:      'performing post-bootstrap initialization ... Segmentation fault (core dumped)'     '

Re: crash during cascaded foreign key update

2021-03-18 Thread Amit Langote
On Wed, Mar 17, 2021 at 11:01 AM Amit Langote wrote: > On Tue, Mar 16, 2021 at 11:17 PM Tom Lane wrote: > > Amit Langote writes: > > > With HEAD (I think v12 and greater), I see $subject when trying out > > > the following scenario: Actually, the crash is reproducible in all supported versions

Logical Replication vs. 2PC

2021-03-18 Thread Amit Kapila
While reviewing/testing subscriber-side work for $SUBJECT [1], I noticed a problem that seems to need a broader discussion, so started this thread. We can get prepare for the same GID more than once for the cases where we have defined multiple subscriptions for publications on the same server and p

Re: Type of wait events WalReceiverWaitStart and WalSenderWaitForWAL

2021-03-18 Thread Fujii Masao
On 2021/03/17 15:31, Kyotaro Horiguchi wrote: I think it'd be better that they are categorized by what it is waiting for. Yes. And some processes can be waiting for several events at the same moment. In this case we should pick the event that those proceses *mainly* are waiing for, as a wait

Re: Avoid CommandCounterIncrement in RI trigger when INSERT INTO referencing table

2021-03-18 Thread Greg Nancarrow
On Tue, Mar 16, 2021 at 8:41 PM houzj.f...@fujitsu.com < houzj.f...@fujitsu.com> wrote: > > > To support parallel insert into FK relation. > > There are two scenarios need attention. > > 1) foreign key and primary key are on the same table(INSERT's target table). > > (referenced and referencing a

hint Consider using pg_file_read()

2021-03-18 Thread Sergei Kornilov
Hello In src/backend/utils/adt/genfile.c in pg_read_file we have errhint > errhint("Consider using %s, which is part of core, instead.", >"pg_file_read()") Shouldn't pg_read_file() be written here? regards, Sergei

RE: libpq debug log

2021-03-18 Thread iwata....@fujitsu.com
Hi Horiguchi san and Tsunakawa san, Thank you for you review. I update patch to v28. In this patch, I removed array. And I fixed some code according to Horiguchi san and Tsunakawa san review comment. > From: Tsunakawa, Takayuki/綱川 貴之 > Sent: Thursday, March 18, 2021 12:38 PM > I sort of thin

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

2021-03-18 Thread Masahiro Ikeda
On 2021-03-18 13:37, Fujii Masao wrote: On 2021/03/18 11:59, kuroda.hay...@fujitsu.com wrote: Dear Ikeda-san, I confirmed new patch and no problem was found. Thanks. (I'm not a native English speaker, so I cannot check your comments correctly, sorry) One user-visible side-effect by this chan

Re: fdatasync performance problem with large number of DB files

2021-03-18 Thread Thomas Munro
On Thu, Mar 18, 2021 at 8:52 PM Paul Guo wrote: > About the syncfs patch, my first impression on the guc name sync_after_crash > is that it is a boolean type. Not sure about other people's feeling. Do you > guys think > It is better to rename it to a clearer name like sync_method_after_crash or

Re: hint Consider using pg_file_read()

2021-03-18 Thread Magnus Hagander
On Thu, Mar 18, 2021 at 10:58 AM Sergei Kornilov wrote: > > Hello > In src/backend/utils/adt/genfile.c in pg_read_file we have errhint > > > errhint("Consider using %s, which is part of core, instead.", > >"pg_file_read()") > > Shouldn't pg_read_file

Re: New IndexAM API controlling index vacuum strategies

2021-03-18 Thread Masahiko Sawada
On Thu, Mar 18, 2021 at 3:41 PM Peter Geoghegan wrote: > > On Wed, Mar 17, 2021 at 11:23 PM Masahiko Sawada > wrote: > > Attached the updated patch that can be applied on top of your v3 patches. > > Some feedback on this: > > * I think that we can afford to be very aggressive here, because we're

Re: hint Consider using pg_file_read()

2021-03-18 Thread Sergei Kornilov
I noticed that the fix has been committed, thank you! regards, Sergei

Re: row filtering for logical replication

2021-03-18 Thread Rahila Syed
Hi Euler, Please find below some review comments, 1. + + + prqual + pg_node_tree + + Expression tree (in nodeToString() + representation) for the relation's qualifying condition + I think the docs are being incorrectly updated to add a c

Re: [HACKERS] PATCH: Batch/pipelining support for libpq

2021-03-18 Thread Matthieu Garrigues
Thanks a lot for the merge. I did some tests and the master branch runs up to 15% faster than the last patch I tried (v22). Amazing! Cheers, Matthieu Garrigues On Tue, Mar 16, 2021 at 9:00 PM Andres Freund wrote: > > Hi, > > On 2021-03-05 21:35:59 -0300, Alvaro Herrera wrote: > > I'll take the w

Re: fdatasync performance problem with large number of DB files

2021-03-18 Thread Thomas Munro
On Wed, Mar 17, 2021 at 11:42 PM Paul Guo wrote: > I just quickly reviewed the patch (the code part). It looks good. Only > one concern > or question is do_syncfs() for symlink opened fd for syncfs() - I'm > not 100% sure. Alright, let me try to prove that it works the way we want with an experim

Re: SSL SNI

2021-03-18 Thread Peter Eisentraut
On 25.02.21 19:36, Jacob Champion wrote: On Thu, 2021-02-25 at 17:00 +0100, Peter Eisentraut wrote: Just as additional data points, it has come to my attention that both the Go driver ("lib/pq") and the JDBC environment already send SNI automatically. (In the case of JDBC this is done by the Ja

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

2021-03-18 Thread Amit Kapila
On Thu, Mar 18, 2021 at 9:04 AM houzj.f...@fujitsu.com wrote: > > > > If a table parameter value is set and the > > > equivalent toast. parameter is not, the TOAST > > > table > > > will use the table's parameter value. > > > -Specifying these parameters for partitioned tables

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

2021-03-18 Thread Ajin Cherian
On Thu, Mar 18, 2021 at 5:30 PM Peter Smith wrote: > On Thu, Mar 18, 2021 at 5:20 PM Peter Smith wrote: > > > > Please find attached the latest patch set v61* > > > > Please find attached the latest patch set v62 Differences from v61 are: * Rebased to HEAD * Addresses the following feedback i

Re: Logical Replication vs. 2PC

2021-03-18 Thread vignesh C
On Thu, Mar 18, 2021 at 3:16 PM Amit Kapila wrote: > > While reviewing/testing subscriber-side work for $SUBJECT [1], I > noticed a problem that seems to need a broader discussion, so started > this thread. We can get prepare for the same GID more than once for > the cases where we have defined mu

Re: a verbose option for autovacuum

2021-03-18 Thread Masahiko Sawada
On Thu, Mar 18, 2021 at 3:41 PM Michael Paquier wrote: > > On Wed, Mar 17, 2021 at 08:50:26AM -0300, Euler Taveira wrote: > > Since commit 5f8727f5a6, this patch doesn't apply anymore. Fortunately, it > > is > > just a small hunk. I reviewed this patch and it looks good to me. There is > > just

Re: popcount

2021-03-18 Thread John Naylor
Hi David, Just a nitpick: +SET bytea_output TO hex; Since we don't see the string in the output, I don't immediately see the reason to change the output format here? Aside from that, this patch works as expected, and is ready for committer. -- John Naylor EDB: http://www.enterprisedb.com

CDC feature request

2021-03-18 Thread Stepan Yankevych
Hi All! Hopefully I’m using correct mail list If not please show me right direction 😊 I’m quite struggling without native Change Data Capture feature in PostgreSQL. That would be great to implement it, possibly in not so complicated way. Can Logical replication be a little be modified or reused

Re: A reloption for partitioned tables - parallel_workers

2021-03-18 Thread Amit Langote
On Fri, Mar 5, 2021 at 11:06 PM Laurenz Albe wrote: > On Fri, 2021-03-05 at 22:55 +0900, Amit Langote wrote: > > On Fri, Mar 5, 2021 at 10:47 PM Laurenz Albe > > wrote: > > > On Wed, 2021-03-03 at 17:58 +0900, Amit Langote wrote: > > > > For example, with the attached PoC patch: > > > > > > I ha

Re: CDC feature request

2021-03-18 Thread Magnus Hagander
On Thu, Mar 18, 2021 at 2:03 PM Stepan Yankevych wrote: > Hi All! > > > > Hopefully I’m using correct mail list > > If not please show me right direction 😊 > > > > I’m quite struggling without native Change Data Capture feature in > PostgreSQL. > > > > That would be great to implement it, possibl

Re: fdatasync performance problem with large number of DB files

2021-03-18 Thread Fujii Masao
On 2021/03/18 19:19, Thomas Munro wrote: On Thu, Mar 18, 2021 at 8:52 PM Paul Guo wrote: About the syncfs patch, my first impression on the guc name sync_after_crash is that it is a boolean type. Not sure about other people's feeling. Do you guys think It is better to rename it to a clearer

Re: CDC feature request

2021-03-18 Thread Ronan Dunklau
That change table should have at lease few additional columns * Operation (I/D/U) * txid * Commit_time_stamp If you look at logical decoding, that's basically what you have, isn't it? It won't go into a table, but you can consume it into one if you want. Look at for example wal2json for exampl

Re: CDC feature request

2021-03-18 Thread Álvaro Hernández
On 18/3/21 14:03, Stepan Yankevych wrote: > > Hi All! > >   > > Hopefully I’m using correct mail list   > > If not please show me right direction 😊 > >   > > I’m quite struggling without native Change Data Capture feature in > PostgreSQL. > >   > > That would be great to implement it, possibly in

Re: pg_stat_statements and "IN" conditions

2021-03-18 Thread David Steele
On 1/5/21 10:51 AM, Zhihong Yu wrote: +   int         lastExprLenght = 0; Did you mean to name the variable lastExprLenghth ? w.r.t. extracting to helper method, the second and third if (currentExprIdx == pgss_merge_threshold - 1) blocks are similar. It is up to you whether to create the hel

Re: should INSERT SELECT use a BulkInsertState?

2021-03-18 Thread Ibrar Ahmed
On Mon, Mar 8, 2021 at 2:18 PM houzj.f...@fujitsu.com < houzj.f...@fujitsu.com> wrote: > > > > I am very interested in this patch, and I plan to do some > > > > experiments with the > > > patch. > > > > Can you please rebase the patch because it seems can not applied to > > > > the > > > master no

Re: Calendar support in localization

2021-03-18 Thread Surafel Temesgen
On Wed, Mar 17, 2021 at 3:39 PM Thomas Munro wrote: > On Thu, Mar 18, 2021 at 3:48 AM Tom Lane wrote: > > Right, so if this is done by trying to extend Daniel Verite's icu_ext > extension (link given earlier) and Robert's idea of a fast-castable > type, I suppose you might want now()::icu_date +

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

2021-03-18 Thread Bruce Momjian
On Thu, Mar 18, 2021 at 07:29:56AM +0800, Julien Rouhaud wrote: > On Wed, Mar 17, 2021 at 06:32:16PM -0400, Bruce Momjian wrote: > > OK, is that what everyone wants? I think that is what the patch already > > does. > > Note exactly. Right now a custom queryid can be computed even if > compute_qu

Re: [PATCH] Partial foreign key updates in referential integrity triggers

2021-03-18 Thread David Steele
On 1/5/21 4:40 PM, Paul Martinez wrote: I've created a patch to better support referential integrity constraints when using composite primary and foreign keys. This patch allows creating a foreign key using the syntax: I previously proposed this feature about a year ago [1], but I don't fee

Re: fdatasync performance problem with large number of DB files

2021-03-18 Thread Bruce Momjian
On Thu, Mar 18, 2021 at 11:19:13PM +1300, Thomas Munro wrote: > On Thu, Mar 18, 2021 at 8:52 PM Paul Guo wrote: > > About the syncfs patch, my first impression on the guc name sync_after_crash > > is that it is a boolean type. Not sure about other people's feeling. Do you > > guys think > > It is

Re: Query about 'initdb' error

2021-03-18 Thread Tom Lane
"=?gb18030?B?0e7S3bTm?=" <1057206...@qq.com> writes: >     When I do 'make' and 'make install', there is no warning or > error infomation appeared. Compilation step seems to have no problem. Also, I > use gdb to backtrace initdb, the result is as below: > performing post-bootstrap initialization

Re: [HACKERS] make async slave to wait for lsn to be replayed

2021-03-18 Thread Ibrar Ahmed
On Thu, Jan 21, 2021 at 1:30 PM Kyotaro Horiguchi wrote: > Hello. > > At Wed, 18 Nov 2020 15:05:00 +0300, a.pervush...@postgrespro.ru wrote in > > I've changed the BEGIN WAIT FOR LSN statement to core functions > > pg_waitlsn, pg_waitlsn_infinite and pg_waitlsn_no_wait. > > Currently the function

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

2021-03-18 Thread Hannu Krosing
On Thu, Mar 18, 2021 at 5:27 AM Pavel Stehule wrote: > > > There are few main reasons: > > a) compile options are available already - so I don't need invent new syntax > - #OPTION DUMP, #PRINT_STRICT ON, #VARIABLE_CONFLICT ERROR Are these documented anywhere ? At least a quick search for pl/pgs

Re: Wrong statistics for size of XLOG_SWITCH during pg_waldump.

2021-03-18 Thread David Steele
On 1/7/21 2:55 AM, shinya11.k...@nttdata.com wrote: But 0 value maybe looks strange, so in current version I show it like below: Type N (%) Record size (%) FPI size (%) Combined size (%) - --- --- --- --- - --- ... XLOG/SWITCH_JUNK - ( -) 11006248 ( 72.26) - ( -)

Re: a verbose option for autovacuum

2021-03-18 Thread Masahiko Sawada
On Thu, Mar 18, 2021 at 9:13 PM Masahiko Sawada wrote: > > On Thu, Mar 18, 2021 at 3:41 PM Michael Paquier wrote: > > > > On Wed, Mar 17, 2021 at 08:50:26AM -0300, Euler Taveira wrote: > > > Since commit 5f8727f5a6, this patch doesn't apply anymore. Fortunately, > > > it is > > > just a small hu

Re: fdatasync performance problem with large number of DB files

2021-03-18 Thread Bruce Momjian
On Thu, Mar 18, 2021 at 09:54:11AM -0400, Bruce Momjian wrote: > On Thu, Mar 18, 2021 at 11:19:13PM +1300, Thomas Munro wrote: > > On Thu, Mar 18, 2021 at 8:52 PM Paul Guo wrote: > > > About the syncfs patch, my first impression on the guc name > > > sync_after_crash > > > is that it is a boolean

Re: Reloptions for table access methods

2021-03-18 Thread David Steele
On 1/7/21 2:32 PM, Simon Riggs wrote: On Sat, Jan 2, 2021 at 6:44 PM Jeff Davis wrote: On Wed, 2020-12-30 at 21:23 +, Simon Riggs wrote: But you cannot seriously argue that a one line patch that changes user visible behavior can be acceptable in Postgres core without tests or docs or code

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

2021-03-18 Thread Pavel Stehule
čt 18. 3. 2021 v 15:19 odesílatel Hannu Krosing napsal: > On Thu, Mar 18, 2021 at 5:27 AM Pavel Stehule > wrote: > > > > > > There are few main reasons: > > > > a) compile options are available already - so I don't need invent new > syntax - #OPTION DUMP, #PRINT_STRICT ON, #VARIABLE_CONFLICT ERR

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

2021-03-18 Thread Hannu Krosing
I went to archives and read the whole discussion for this from the beginning I did not really understand, why using the ALIAS FOR syntax is significantly harder to implement then #routine_label The things you mentioned as currently using #OPTION seem to be in a different category from the aliases

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

2021-03-18 Thread Hannu Krosing
On Thu, Mar 18, 2021 at 3:45 PM Pavel Stehule wrote: > > > > čt 18. 3. 2021 v 15:19 odesílatel Hannu Krosing napsal: ... >> Variation could be >> >> DECLARE >>fnarg ALIAS FOR FUNCTION a_function_with_an_inconveniently_long_name; >> >> so it is clear that we are aliasing current function name

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

2021-03-18 Thread Pavel Stehule
čt 18. 3. 2021 v 15:49 odesílatel Hannu Krosing napsal: > I went to archives and read the whole discussion for this from the > beginning > > I did not really understand, why using the ALIAS FOR syntax is > significantly > harder to implement then #routine_label > just because it can be used in d

Re: Reduce the time required for a database recovery from archive.

2021-03-18 Thread David Steele
Hi Dimtry, On 1/11/21 2:51 AM, Dmitry Shulga wrote: Hi Stephen Based on our last discussion I redesigned the implementation of WAL archive recovery speed-up. Seems like there should have been a patch attached? In any case the current patch no longer applies so marked Waiting on Author. P

Re: Force lookahead in COPY FROM parsing

2021-03-18 Thread John Naylor
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. To answer the side question of whether it makes

Re: Implement for window functions

2021-03-18 Thread David Steele
Hi Vik, On 1/11/21 5:00 PM, Tom Lane wrote: I started to look through this patch... I see you moved this patch to PG15. If you won't be working on the patch in this CF perhaps it would be better to close it as Returned with Feedback for now and reopen it when you have a new patch? I'll do

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

2021-03-18 Thread Pavel Stehule
čt 18. 3. 2021 v 15:59 odesílatel Hannu Krosing napsal: > On Thu, Mar 18, 2021 at 3:45 PM Pavel Stehule > wrote: > > > > > > > > čt 18. 3. 2021 v 15:19 odesílatel Hannu Krosing > napsal: > ... > >> Variation could be > >> > >> DECLARE > >>fnarg ALIAS FOR FUNCTION a_function_with_an_inconven

Re: should INSERT SELECT use a BulkInsertState?

2021-03-18 Thread Zhihong Yu
Hi, + mtstate->ntuples > bulk_insert_ntuples && + bulk_insert_ntuples >= 0) I wonder why bulk_insert_ntuples == 0 is included in the above. It seems bulk_insert_ntuples having value of 0 should mean not enabling bulk insertions. + } + else + { nit: the else should be on

Re: Key management with tests

2021-03-18 Thread Stephen Frost
Greetings, * Bruce Momjian (br...@momjian.us) wrote: > On Thu, Mar 11, 2021 at 10:31:28PM -0500, Bruce Momjian wrote: > > I have made significant progress on the cluster file encryption feature so > > it is time for me to post a new set of patches. > > Here is a rebase, to keep the cfbot green.

Re: [patch] [doc] Further note required activity aspect of automatic checkpoint and archving

2021-03-18 Thread David Steele
Hi David, On 1/15/21 2:50 PM, David G. Johnston wrote: If the above wants to be made more explicit in this change maybe: "This is mitigated by the fact that archiving, and thus filling, the active WAL segment will not happen if that segment is empty; it will continue as the active segment."

Re: Reduce the time required for a database recovery from archive.

2021-03-18 Thread Andrey Borodin
> 18 марта 2021 г., в 20:04, David Steele написал(а): > it would be nice to support an interface that simply says to the > restore_command, "go get 1gb of WAL and write the files here." +1 to redesigning restore_command and archive_command. Best regards, Andrey Borodin.

Re: Reduce the time required for a database recovery from archive.

2021-03-18 Thread David Steele
On 3/18/21 11:37 AM, Andrey Borodin wrote: 18 марта 2021 г., в 20:04, David Steele написал(а): it would be nice to support an interface that simply says to the restore_command, "go get 1gb of WAL and write the files here." +1 to redesigning restore_command and archive_command. Indeed, ar

Re: pg_stat_statements and "IN" conditions

2021-03-18 Thread Dmitry Dolgov
> On Thu, Mar 18, 2021 at 09:38:09AM -0400, David Steele wrote: > On 1/5/21 10:51 AM, Zhihong Yu wrote: > > > > +   int         lastExprLenght = 0; > > > > Did you mean to name the variable lastExprLenghth ? > > > > w.r.t. extracting to helper method, the second and third > > if (currentExprIdx ==

Re: Rename of triggers for partitioned tables

2021-03-18 Thread David Steele
On 1/15/21 5:26 PM, Alvaro Herrera wrote: On 2020-Nov-27, Arne Roland wrote: I got too annoyed at building queries for gexec all the time. So wrote a patch to fix the issue that the rename of partitioned trigger doesn't affect children. As you say, triggers on children don't necessarily have

Re: Implement for window functions

2021-03-18 Thread Vik Fearing
On 3/18/21 4:12 PM, David Steele wrote: > Hi Vik, > > On 1/11/21 5:00 PM, Tom Lane wrote: >> I started to look through this patch... > > I see you moved this patch to PG15. If you won't be working on the patch > in this CF Correct. I won't be working on this again until I finish my review of th

Re: Implement for window functions

2021-03-18 Thread David Steele
On 3/18/21 12:03 PM, Vik Fearing wrote: On 3/18/21 4:12 PM, David Steele wrote: Hi Vik, On 1/11/21 5:00 PM, Tom Lane wrote: I started to look through this patch... I see you moved this patch to PG15. If you won't be working on the patch in this CF Correct. I won't be working on this again

Re: a verbose option for autovacuum

2021-03-18 Thread Peter Geoghegan
On Thu, Mar 18, 2021 at 5:14 AM Masahiko Sawada wrote: > Okay, I've updated the patch accordingly. If we add > IndexBulkDeleteResult to LVRelStats I think we can remove > IndexBulkDeleteResult function argument also from some other functions > such as lazy_parallel_vacuum_indexes() and vacuum_inde

Re: invalid data in file backup_label problem on windows

2021-03-18 Thread David Steele
On 1/14/21 10:50 PM, Wang, Shenhao wrote: Please feel free to, under the section "Bug fixes". This way, it won't get lost in the traffic of this list. -- Michael Thank you for your advise, added it I'm not sure how I feel about this patch (not really a Windows person) but I do think that

Re: cleanup temporary files after crash

2021-03-18 Thread Tomas Vondra
On 3/17/21 2:34 AM, Euler Taveira wrote: > On Sun, Mar 14, 2021, at 11:01 PM, Thomas Munro wrote: >> On Wed, Mar 10, 2021 at 1:31 AM Michael Paquier > > wrote: >> > On Tue, Mar 09, 2021 at 02:28:43AM +0100, Tomas Vondra wrote: >> > > Let's move this patch forward. Bas

Re: Disable WAL logging to speed up data loading

2021-03-18 Thread David Steele
On 1/17/21 12:16 AM, tsunakawa.ta...@fujitsu.com wrote: From: Osumi, Takamichi/大墨 昂道 I updated my patch to take in those feedbacks ! Have a look at the latest patch. Looks good to me (the status remains ready for committer.) After reading through the thread (but not reading the patch) I am

Re: fdatasync performance problem with large number of DB files

2021-03-18 Thread Fujii Masao
On 2021/03/18 23:03, Bruce Momjian wrote: Are we sure we want to use the word "crash" here? I don't remember seeing it used anywhere else in our user interface. We have GUC restart_after_crash. I guess it is "crash recovery". Maybe call it "recovery_sync_method" +1. This name sounds

Re: Key management with tests

2021-03-18 Thread Bruce Momjian
On Thu, Mar 18, 2021 at 11:31:34AM -0400, Stephen Frost wrote: > Greetings, > > * Bruce Momjian (br...@momjian.us) wrote: > > On Thu, Mar 11, 2021 at 10:31:28PM -0500, Bruce Momjian wrote: > > > I have made significant progress on the cluster file encryption feature so > > > it is time for me to p

Re: Key management with tests

2021-03-18 Thread Alvaro Herrera
Patch 10 uses the term "WAL-skip relations". What does that mean? Is it "relations that are not WAL-logged"? I suppose we already have a term for this; I'm not sure it's a good idea to invent a different term that is only used in this new place. -- Álvaro Herrera39°

Re: Key management with tests

2021-03-18 Thread Stephen Frost
Greetings, * Alvaro Herrera (alvhe...@alvh.no-ip.org) wrote: > Patch 10 uses the term "WAL-skip relations". What does that mean? Is > it "relations that are not WAL-logged"? I suppose we already have a > term for this; I'm not sure it's a good idea to invent a different term > that is only used

Re: GROUP BY DISTINCT

2021-03-18 Thread Tomas Vondra
On 3/16/21 3:52 PM, Tomas Vondra wrote: > > > On 3/16/21 9:21 AM, Vik Fearing wrote: >> On 3/13/21 12:33 AM, Tomas Vondra wrote: >>> Hi Vik, >>> >>> The patch seems quite ready, I have just two comments. >> >> Thanks for taking a look. >> >>> 1) Shouldn't this add another for DISTINCT, somewhere

Re: Key management with tests

2021-03-18 Thread Alvaro Herrera
On 2021-Mar-18, Stephen Frost wrote: > * Alvaro Herrera (alvhe...@alvh.no-ip.org) wrote: > > Patch 10 uses the term "WAL-skip relations". What does that mean? Is > > it "relations that are not WAL-logged"? I suppose we already have a > > term for this; I'm not sure it's a good idea to invent a

Re: Key management with tests

2021-03-18 Thread Stephen Frost
Greetings, * Alvaro Herrera (alvhe...@alvh.no-ip.org) wrote: > On 2021-Mar-18, Stephen Frost wrote: > > > * Alvaro Herrera (alvhe...@alvh.no-ip.org) wrote: > > > Patch 10 uses the term "WAL-skip relations". What does that mean? Is > > > it "relations that are not WAL-logged"? I suppose we alre

Re: cleanup temporary files after crash

2021-03-18 Thread Tomas Vondra
Hmm, crake and florican seem to have failed because of this commit, with this error in the new TAP test: error running SQL: 'psql::1: ERROR: could not open directory "base/pgsql_tmp": No such file or directory' while running 'psql -XAtq -d port=64336 host=/tmp/sv1WjSvj3P dbname='postgres' -f - -

Re: Perform COPY FROM encoding conversions in larger chunks

2021-03-18 Thread John Naylor
I wrote: > I went ahead and rebased these. It looks like FreeBSD doesn't like this for some reason. I also wanted to see if this patch set had any performance effect, with and without changing how UTF-8 is validated, using the blackhole am from https://github.com/michaelpq/pg_plugins/tree/master

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

2021-03-18 Thread Julien Rouhaud
On Thu, Mar 18, 2021 at 09:47:29AM -0400, Bruce Momjian wrote: > On Thu, Mar 18, 2021 at 07:29:56AM +0800, Julien Rouhaud wrote: > > On Wed, Mar 17, 2021 at 06:32:16PM -0400, Bruce Momjian wrote: > > > OK, is that what everyone wants? I think that is what the patch already > > > does. > > > > Not

Re: Perform COPY FROM encoding conversions in larger chunks

2021-03-18 Thread John Naylor
On Thu, Mar 18, 2021 at 2:05 PM John Naylor wrote: > > I wrote: > > > I went ahead and rebased these. > > It looks like FreeBSD doesn't like this for some reason. On closer examination, make check was "terminated", not that the tests failed... -- John Naylor EDB: http://www.enterprisedb.com

Re: New IndexAM API controlling index vacuum strategies

2021-03-18 Thread Peter Geoghegan
On Thu, Mar 18, 2021 at 3:32 AM Masahiko Sawada wrote: > If we have the constant threshold of 1 billion transactions, a vacuum > operation might not be an anti-wraparound vacuum and even not be an > aggressive vacuum, depending on autovacuum_freeze_max_age value. Given > the purpose of skipping in

Re: Key management with tests

2021-03-18 Thread Bruce Momjian
On Thu, Mar 18, 2021 at 02:37:43PM -0300, Álvaro Herrera wrote: > On 2021-Mar-18, Stephen Frost wrote: > > This is discussed in src/backend/access/transam/README, specifically the > > section that talks about Skipping WAL for New RelFileNode. Basically, > > it's the 'wal_level=minimal' optimizatio

Re: Key management with tests

2021-03-18 Thread Bruce Momjian
On Thu, Mar 18, 2021 at 01:46:28PM -0400, Stephen Frost wrote: > * Alvaro Herrera (alvhe...@alvh.no-ip.org) wrote: > > This caught my attention because a comment says "encryption does not > > support WAL-skipped relations", but there's no direct change to the > > definition of RelFileNodeSkippingWA

Re: cleanup temporary files after crash

2021-03-18 Thread Tomas Vondra
On 3/18/21 6:51 PM, Tomas Vondra wrote: > Hmm, > > crake and florican seem to have failed because of this commit, with this > error in the new TAP test: > > error running SQL: 'psql::1: ERROR: could not open directory > "base/pgsql_tmp": No such file or directory' > while running 'psql -XAtq -d

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

2021-03-18 Thread Bruce Momjian
On Fri, Mar 19, 2021 at 02:06:56AM +0800, Julien Rouhaud wrote: > On Thu, Mar 18, 2021 at 09:47:29AM -0400, Bruce Momjian wrote: > > On Thu, Mar 18, 2021 at 07:29:56AM +0800, Julien Rouhaud wrote: > > > Note exactly. Right now a custom queryid can be computed even if > > > compute_queryid is off,

Re: GROUP BY DISTINCT

2021-03-18 Thread Tomas Vondra
On 3/18/21 6:25 PM, Tomas Vondra wrote: > On 3/16/21 3:52 PM, Tomas Vondra wrote: >> >> >> On 3/16/21 9:21 AM, Vik Fearing wrote: >>> On 3/13/21 12:33 AM, Tomas Vondra wrote: Hi Vik, The patch seems quite ready, I have just two comments. >>> >>> Thanks for taking a look. >>>

Re: libpq compression

2021-03-18 Thread Daniil Zakhlystov
The following review has been posted through the commitfest application: make installcheck-world: tested, passed Implements feature: tested, passed Spec compliant: tested, passed Documentation:tested, passed Hi, I've compared the different libpq compression approaches

Re: [HACKERS] Custom compression methods

2021-03-18 Thread Robert Haas
On Thu, Mar 18, 2021 at 10:22 AM Dilip Kumar wrote: > I just realized that in the last patch (0003) I forgot to remove 2 > unused functions, CompressionMethodToId and CompressionIdToMethod. > Removed in the latest patch. I spent a little time polishing 0001 and here's what I came up with. I adjus

Re: cleanup temporary files after crash

2021-03-18 Thread Euler Taveira
On Thu, Mar 18, 2021, at 4:20 PM, Tomas Vondra wrote: > I think a better way to test this would be to use a tuple lock: I predicated such issues with this test. Your suggestion works for me. Maybe you should use less rows in the session 2 query. > setup: > > create table t (a int unique); > >

Re: default result formats setting

2021-03-18 Thread Peter Eisentraut
On 09.03.21 19:04, Tom Lane wrote: The implementation feels weird though, mainly in that I don't like Peter's choices for where to put the code. pquery.c is not where I would have expected to find the support for this, and I do not have any confidence that applying the format conversion while fi

Maintaining a list of pgindent commits for "git blame" to ignore

2021-03-18 Thread Peter Geoghegan
Recent versions of git are capable of maintaining a list of commits for "git blame" to ignore: https://www.moxio.com/blog/43/ignoring-bulk-change-commits-with-git-blame I tried this out myself, using my own list of pgindent commits. It works very well -- much better than what you get when you ask

Re: cleanup temporary files after crash

2021-03-18 Thread Tomas Vondra
On 3/18/21 9:06 PM, Euler Taveira wrote: > On Thu, Mar 18, 2021, at 4:20 PM, Tomas Vondra wrote: >> I think a better way to test this would be to use a tuple lock: > I predicated such issues with this test. Your suggestion works for me. Maybe > you should use less rows in the session 2 query. >

  1   2   >