Re: Is it worth accepting multiple CRLs?

2021-01-14 Thread Peter Eisentraut
On 2020-08-31 11:03, Kyotaro Horiguchi wrote: At Tue, 18 Aug 2020 16:43:47 +0900 (JST), Kyotaro Horiguchi wrote in Thank you very much. I'll do that after some polishing. A near-by discussion about OpenSSL3.0 conflicts with this but it's easy to follow. Rebased. Fixed bogus tests and strang

Re: Asynchronous Append on postgres_fdw nodes.

2021-01-14 Thread Kyotaro Horiguchi
At Sat, 19 Dec 2020 17:55:22 +0900, Etsuro Fujita wrote in > On Mon, Dec 14, 2020 at 4:01 PM Kyotaro Horiguchi > wrote: > > At Sat, 12 Dec 2020 18:25:57 +0900, Etsuro Fujita > > wrote in > > > On Fri, Nov 20, 2020 at 3:51 PM Kyotaro Horiguchi > > > wrote: > > > > The reason for > > > > the e

Re: Logical Replication - behavior of ALTER PUBLICATION .. DROP TABLE and ALTER SUBSCRIPTION .. REFRESH PUBLICATION

2021-01-14 Thread japin
On Fri, 15 Jan 2021 at 14:50, Bharath Rupireddy wrote: > On Fri, Jan 15, 2021 at 11:33 AM Hou, Zhijie > wrote: >> >> > On Thu, Jan 14, 2021 at 5:36 PM Li Japin wrote >> > > Do we really need to access PUBLICATIONRELMAP in this patch? What if >> > > we just set it to false in the else conditi

Re: Wrong HINT during database recovery when occur a minimal wal.

2021-01-14 Thread lchch1...@sina.cn
Sorry, I don't known why it showed in wrong format, and try to correct it. - When I do PITR in a strange step, I get this FATAL: 2021-01-15 15:02:52.364 CST [14958] FATAL: hot standby is not possible because wal_level was not set to "replica" or higher on the primary server 2021-01-15 15:0

Re: WIP: document the hook system

2021-01-14 Thread Peter Eisentraut
On 2020-12-31 04:28, David Fetter wrote: This could probably use a lot of filling in, but having it in the actual documentation beats needing to know folklore even to know that the capability is there. This patch seems quite short of a state where one could begin to evaluate it. Documenting t

Wrong HINT during database recovery when occur a minimal wal.

2021-01-14 Thread lchch1990
Hello hackers, When I do PITR in a strange step, I get this FATAL: 2021-01-15 15:02:52.364 CST [14958] FATAL: hot standby is not possible because wal_level was not set to "replica" or higher on the primary server2021-01-15 15:02:52.364 CST [14958] HINT: Either set wal_level to "replica" on the

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

2021-01-14 Thread Peter Eisentraut
On 2020-10-12 23:54, David G. Johnston wrote: --- a/doc/src/sgml/backup.sgml +++ b/doc/src/sgml/backup.sgml @@ -722,6 +722,8 @@ test ! -f /mnt/server/archivedir/000100A90065 && cp pg_wal/0      short archive_timeout — it will bloat your archive      storage.  archive_timeout setti

Re: Add Nullif case for eval_const_expressions_mutator

2021-01-14 Thread Peter Eisentraut
On 2021-01-12 07:43, Hou, Zhijie wrote: I think this patch should be about a tenth the size. Try modeling it on the T_SubscriptingRef-etc case, ie, use ece_generic_processing and then ece_evaluate_expr to cover the generic cases. OpExpr is common enough to deserve specially optimized code, but

fdatasync(2) on macOS

2021-01-14 Thread Thomas Munro
Hello hackers, While following along with the nearby investigation into weird cross-version Apple toolchain issues that confuse configure, I noticed that the newer buildfarm Macs say: checking for fdatasync... (cached) yes That's a bit strange because there's no man page and no declaration: che

Re: Logical Replication - behavior of ALTER PUBLICATION .. DROP TABLE and ALTER SUBSCRIPTION .. REFRESH PUBLICATION

2021-01-14 Thread Bharath Rupireddy
On Fri, Jan 15, 2021 at 11:33 AM Hou, Zhijie wrote: > > > On Thu, Jan 14, 2021 at 5:36 PM Li Japin wrote > > > Do we really need to access PUBLICATIONRELMAP in this patch? What if > > > we just set it to false in the else condition of (if (publish && > > > (relkind != RELKIND_PARTITIONED_TABLE ||

Re: adding wait_start column to pg_locks

2021-01-14 Thread torikoshia
Thanks for your reviewing and comments! On 2021-01-14 12:39, Ian Lawrence Barwick wrote: Looking at the code, this happens as the wait start time is being recorded in the lock record itself, so always contains the value reported by the latest lock acquisition attempt. I think you are right a

Re: Logical Replication - behavior of ALTER PUBLICATION .. DROP TABLE and ALTER SUBSCRIPTION .. REFRESH PUBLICATION

2021-01-14 Thread Bharath Rupireddy
On Thu, Jan 14, 2021 at 10:53 AM Amit Kapila wrote: > > 0002 - Invalidates the relation map cache in subscriber syscache > > invalidation callbacks. Currently, I'm setting entry->state to > > SUBREL_STATE_UNKNOWN in the new invalidation function that's > > introduced logicalrep_relmap_invalidate,

RE: Logical Replication - behavior of ALTER PUBLICATION .. DROP TABLE and ALTER SUBSCRIPTION .. REFRESH PUBLICATION

2021-01-14 Thread Hou, Zhijie
> On Thu, Jan 14, 2021 at 5:36 PM Li Japin wrote > > Do we really need to access PUBLICATIONRELMAP in this patch? What if > > we just set it to false in the else condition of (if (publish && > > (relkind != RELKIND_PARTITIONED_TABLE || pub->pubviaroot))) > > > > Thank for you review. I agree with

Re: Yet another fast GiST build

2021-01-14 Thread Peter Eisentraut
On 2021-01-12 14:49, Heikki Linnakangas wrote: I suggest calling BuildIndexValueDescription() from your own custom debug instrumentation code. Thanks for the hint, Peter! This function does exactly what I want to do. But I have no Relation inside gist_page_items(bytea) function... probably, I'l

Re: Transactions involving multiple postgres foreign servers, take 2

2021-01-14 Thread Masahiko Sawada
On Fri, Jan 15, 2021 at 4:03 AM Zhihong Yu wrote: > > Hi, > For v32-0008-Prepare-foreign-transactions-at-commit-time.patch : Thank you for reviewing the patch! > > + boolhave_notwophase = false; > > Maybe name the variable have_no_twophase so that it is easier to read. Fixed. > > +

fix typo in reorderbuffer.c

2021-01-14 Thread Hou, Zhijie
Hi I found a possible typo in reorderbuffer.c  *   has got a combocid. Combocid's are only valid for the duration of a Combocid's ==>> Combocids Attatching a small patch to correct it. Best regards, houzj 0001-fix-typo.patch Description: 0001-fix-typo.patch

Pg14, pg_dumpall and "password_encryption=true"

2021-01-14 Thread Ian Lawrence Barwick
Greetings Consider the following: postgres=# SELECT current_setting('server_version'); current_setting - 12.5 (1 row) postgres=# SELECT * FROM pg_db_role_setting WHERE setrole = 10; setdatabase | setrole | setconfig -+---

Re: vacuum_cost_page_miss default value and modern hardware

2021-01-14 Thread Masahiko Sawada
On Thu, Jan 14, 2021 at 9:24 AM Peter Geoghegan wrote: > > On Wed, Jan 6, 2021 at 7:43 PM Peter Geoghegan wrote: > > More concretely, we could perhaps lower vacuum_cost_page_miss to 5. It > > has had the value as 10 as its default since 2004 (just like > > vacuum_cost_page_dirty, whose default ha

RE: invalid data in file backup_label problem on windows

2021-01-14 Thread Wang, Shenhao
Hi, Michael >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 Best Regards, Shenhao Wang

Re: [bug fix] Fix the size calculation for shmem TOC

2021-01-14 Thread Fujii Masao
On 2021/01/14 18:15, Fujii Masao wrote: On 2021/01/14 17:47, tsunakawa.ta...@fujitsu.com wrote: Hello, The attached patch fixes a trivial mistake in the calculation of shmem TOC.  The original code allocates unduly large memory because it adds the result of add_size() to its left argume

Re: invalid data in file backup_label problem on windows

2021-01-14 Thread Michael Paquier
On Fri, Jan 15, 2021 at 03:29:57AM +, Wang, Shenhao wrote: > On windows, if a backup_label file contains a windows(CRLF) line ending. > Recovering from this backup will failed. > > I think this is a problem, can I add this to commitfest? Please feel free to, under the section "Bug fixes". Th

RE: invalid data in file backup_label problem on windows

2021-01-14 Thread Wang, Shenhao
Hi, again: On windows, if a backup_label file contains a windows(CRLF) line ending. Recovering from this backup will failed. I think this is a problem, can I add this to commitfest? Best Regards, Shenhao Wang -Original Message- From: Wang, Shenhao Sent: Sunday, January 10, 2021 8:58 P

Re: Logical Replication - behavior of ALTER PUBLICATION .. DROP TABLE and ALTER SUBSCRIPTION .. REFRESH PUBLICATION

2021-01-14 Thread Amit Kapila
On Thu, Jan 14, 2021 at 5:36 PM Li Japin wrote: > > On Jan 14, 2021, at 1:25 PM, Amit Kapila wrote: > > Attaching following two patches: > > 0001 - Makes publisher to not publish the changes for the alter > publication ... dropped tables. Original patch is by japin, I added > comments, changed th

Re: Remove PG_SHA*_DIGEST_STRING_LENGTH from sha2.h

2021-01-14 Thread Michael Paquier
On Thu, Jan 14, 2021 at 03:11:12PM +0900, Michael Paquier wrote: > I have just noticed that aef8948 has removed the last reference to > PG_SHA256_DIGEST_STRING_LENGTH in the code (this was getting used to > know the length of a SHA256 digest encoded to hex for checksum > manifests, but pg_hex_enc_l

Re: adding wait_start column to pg_locks

2021-01-14 Thread Ian Lawrence Barwick
2021年1月15日(金) 3:45 Robert Haas : > On Wed, Jan 13, 2021 at 10:40 PM Ian Lawrence Barwick > wrote: > > It looks like the logical place to store the value is in the PROCLOCK > > structure; ... > > That seems surprising, because there's one PROCLOCK for every > combination of a process and a lock. B

RE: POC: postgres_fdw insert batching

2021-01-14 Thread tsunakawa.ta...@fujitsu.com
From: Tomas Vondra > Attached is v9 with all of those tweaks, except for moving the BatchSize call > to > BeginForeignModify - I tried that, but it did not seem like an improvement, > because we'd still need the checks for API callbacks in ExecInsert for > example. > So I decided not to do that.

Re: O(n^2) system calls in RemoveOldXlogFiles()

2021-01-14 Thread Michael Paquier
On Fri, Jan 15, 2021 at 03:25:24PM +1300, Thomas Munro wrote: > Thanks Michael! Another notch for the unnecessary system call > hitlist: https://wiki.postgresql.org/wiki/Syscall_Reduction A quick question. How much does it matter in terms of micro-performance for this code path depending on max/

Re: pg_preadv() and pg_pwritev()

2021-01-14 Thread Sergey Shinderuk
On 15.01.2021 04:45, Tom Lane wrote: Hence, I propose the attached. This works as far as I can tell to fix the problem you're seeing. Yes, it works fine. Thank you very much.

Re: O(n^2) system calls in RemoveOldXlogFiles()

2021-01-14 Thread Thomas Munro
On Fri, Jan 15, 2021 at 3:07 PM Michael Paquier wrote: > On Wed, Jan 13, 2021 at 04:27:25PM +0900, Michael Paquier wrote: > > I have been looking again at that, and the rebased version that Andres > > has provided would take care of that. Any thoughts? > > Hearing nothing, I have applied the thin

Re: pg_preadv() and pg_pwritev()

2021-01-14 Thread Sergey Shinderuk
On 15.01.2021 05:04, Tom Lane wrote: on her machine there's no detail at all: % xcrun --verbose --no-cache --show-sdk-path /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk The same on my machine. I get details for --find, but not for --show-sdk-path. So I'm not sure what to make

Re: O(n^2) system calls in RemoveOldXlogFiles()

2021-01-14 Thread Michael Paquier
On Wed, Jan 13, 2021 at 04:27:25PM +0900, Michael Paquier wrote: > I have been looking again at that, and the rebased version that Andres > has provided would take care of that. Any thoughts? Hearing nothing, I have applied the thing on HEAD after more tests and more reads of the code. -- Michael

Re: pg_preadv() and pg_pwritev()

2021-01-14 Thread Sergey Shinderuk
On 15.01.2021 04:53, Sergey Shinderuk wrote: I see that "xcrun --sdk macosx --show-sdk-path" really calls "/Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -sdk macosx -version Path" under the hood. ... and caches the result. xcodebuild not called without --no-cache. So it stil

Re: pg_preadv() and pg_pwritev()

2021-01-14 Thread Tom Lane
Sergey Shinderuk writes: > I see that "xcrun --sdk macosx --show-sdk-path" really calls > "/Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -sdk > macosx -version Path" under the hood. Hmm. I found something odd on my wife's Mac: although on my other machines, I get something like

Re: pg_preadv() and pg_pwritev()

2021-01-14 Thread Sergey Shinderuk
On 15.01.2021 01:13, Tom Lane wrote: than relying entirely on xcodebuild. Maybe there's a case for trying "xcrun --sdk macosx --show-sdk-path" in between; in my tests that seemed noticeably faster than invoking xcodebuild, and I've not yet seen a case where it gave a different answer. I see

Re: pg_preadv() and pg_pwritev()

2021-01-14 Thread Tom Lane
Sergey Shinderuk writes: > On 15.01.2021 01:13, Tom Lane wrote: >> Also, after re-reading [1] I am not at all excited about trying to >> remove the -isysroot switches from our *FLAGS. What I propose to do >> is keep that, but improve our mechanism for choosing a default value >> for PG_SYSROOT.

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

2021-01-14 Thread Fujii Masao
On 2021/01/14 20:36, Bharath Rupireddy wrote: On Thu, Jan 14, 2021 at 3:52 PM Fujii Masao wrote: - if (!HeapTupleIsValid(tup)) - elog(ERROR, "cache lookup failed for user mapping %u", entry->key); - umform = (Form_pg_user_mapping) GETSTRUCT(tup); - server = G

Re: pg_preadv() and pg_pwritev()

2021-01-14 Thread Sergey Shinderuk
On 14.01.2021 21:05, Tom Lane wrote: After considerable playing around, I'm guessing that the reason -no_weak_imports doesn't help is that it rejects calls that are marked as weak references on the *calling* side. Since AC_CHECK_FUNCS doesn't bother to #include the relevant header file, the comp

Re: vacuum_cost_page_miss default value and modern hardware

2021-01-14 Thread Peter Geoghegan
On Thu, Jan 14, 2021 at 10:42 AM Robert Haas wrote: > There are also users I've seen get hosed by vacuuming too > aggressively. I have seen this happen in two ways. One is too much > dirty data. The other is too much read I/O, pushing hot data out of > the cache, leading to a storm of random I/O l

Re: vacuum_cost_page_miss default value and modern hardware

2021-01-14 Thread Peter Geoghegan
On Thu, Jan 14, 2021 at 9:29 AM Magnus Hagander wrote: > Do you have any actual metrics between specifically choosing the value > 3? Or is that off a gut feeling? I have no metrics, exactly, but I'm sure that the trend I mentioned about page cleaning/dirtying being the bottleneck more and more th

Re: pg_preadv() and pg_pwritev()

2021-01-14 Thread Sergey Shinderuk
On 15.01.2021 01:13, Tom Lane wrote: I borrowed my wife's Mac, which is still on Catalina and up to now never had Xcode on it, and found some very interesting things. Step 1: download/install Xcode 12.3, open it, agree to license, wait for it to finish "installing components". At this point, /L

Re: Add table access method as an option to pgbench

2021-01-14 Thread David Zhang
On 2021-01-09 5:44 a.m., youichi aramaki wrote: + " create tables with using specified table access method,\n" In my opinion, this sentence should be "create tables with specified table access method" or "create tables using specified table access m

Re: Transactions involving multiple postgres foreign servers, take 2

2021-01-14 Thread Zhihong Yu
For v32-0002-postgres_fdw-supports-commit-and-rollback-APIs.patch : + entry->changing_xact_state = true; ... + entry->changing_xact_state = abort_cleanup_failure; I don't see return statement in between the two assignments. I wonder why entry->changing_xact_state is set to true, and later bei

Re: WIP: System Versioned Temporal Table

2021-01-14 Thread Ryan Lambert
On Thu, Jan 14, 2021 at 2:22 PM Simon Riggs wrote: > On Thu, Jan 14, 2021 at 5:46 PM Surafel Temesgen > wrote: > > > On Fri, Jan 8, 2021 at 7:50 PM Ryan Lambert > wrote: > >> > >> I prefer to have them hidden by default. This was mentioned up-thread > with no decision, it seems the standard is

Re: pg_preadv() and pg_pwritev()

2021-01-14 Thread Tom Lane
I borrowed my wife's Mac, which is still on Catalina and up to now never had Xcode on it, and found some very interesting things. Step 1: download/install Xcode 12.3, open it, agree to license, wait for it to finish "installing components". At this point, /Library/Developer/CommandLineTools doesn

Re: WIP: System Versioned Temporal Table

2021-01-14 Thread Simon Riggs
On Thu, Jan 14, 2021 at 5:42 PM Surafel Temesgen wrote: > > Hi Simon, > Thank you for all the work you does No problem. > On Mon, Jan 11, 2021 at 5:02 PM Simon Riggs > wrote: >> >> >> >> * Anomalies around use of CURRENT_TIMESTAMP are not discussed or resolved. >> Probably need to add a test t

Re: WIP: System Versioned Temporal Table

2021-01-14 Thread Simon Riggs
On Thu, Jan 14, 2021 at 5:46 PM Surafel Temesgen wrote: > On Fri, Jan 8, 2021 at 7:50 PM Ryan Lambert wrote: >> >> I prefer to have them hidden by default. This was mentioned up-thread with >> no decision, it seems the standard is ambiguous. MS SQL appears to have >> flip-flopped on this dec

Re: Cirrus CI (Windows help wanted)

2021-01-14 Thread Thomas Munro
On Wed, Jan 13, 2021 at 3:04 AM Andrew Dunstan wrote: > OK, I got this working. Thanks Andrew. This is great! > # cirrus does something odd with this command, so it's stuck in a bat file > # and copied to the docker container and then executed > COPY ci/inst-tools.bat . > RUN \

Re: new heapcheck contrib module

2021-01-14 Thread Robert Haas
On Mon, Jan 11, 2021 at 1:16 PM Mark Dilger wrote: > Added in v32, along with adding pg_amcheck to @contrib_uselibpq, > @contrib_uselibpgport, and @contrib_uselibpgcommon exit_utils.c fails to achieve the goal of making this code independent of pg_dump, because of: #ifdef WIN32 if (para

Re: Transactions involving multiple postgres foreign servers, take 2

2021-01-14 Thread Zhihong Yu
Hi, For v32-0008-Prepare-foreign-transactions-at-commit-time.patch : + boolhave_notwophase = false; Maybe name the variable have_no_twophase so that it is easier to read. +* Two-phase commit is not required if the number of servers performed performed -> performing +

Re: adding wait_start column to pg_locks

2021-01-14 Thread Robert Haas
On Wed, Jan 13, 2021 at 10:40 PM Ian Lawrence Barwick wrote: > It looks like the logical place to store the value is in the PROCLOCK > structure; ... That seems surprising, because there's one PROCLOCK for every combination of a process and a lock. But, a process can't be waiting for more than on

Re: vacuum_cost_page_miss default value and modern hardware

2021-01-14 Thread Robert Haas
On Thu, Jan 14, 2021 at 12:29 PM Magnus Hagander wrote: > +1 for this in principle. I'm not opposed to this change and I agree that the relative expense of dirtying a page is higher than what the current defaults suggest. So I also think Peter is going in the right general direction, though like

Re: pg_preadv() and pg_pwritev()

2021-01-14 Thread Tom Lane
I wrote: > It seems like the more productive approach would be to try to identify > the right sysroot to use. I wonder if there is some less messy way > to find out the compiler's default sysroot than to scrape it out of > -v output. This is, of course, not terribly well documented by Apple. But

Re: pg_preadv() and pg_pwritev()

2021-01-14 Thread Tom Lane
Sergey Shinderuk writes: > On 14.01.2021 18:42, Tom Lane wrote: >>> I noticed that "cc" invoked from command line uses: >>> -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk >> Hm, how did you determine that exactly? > % cc -v tmp.c > ... > -isysroot /Library/Developer/CommandLi

Re: WIP: System Versioned Temporal Table

2021-01-14 Thread Surafel Temesgen
Hi Ryan On Fri, Jan 8, 2021 at 7:50 PM Ryan Lambert wrote: > I prefer to have them hidden by default. This was mentioned up-thread > with no decision, it seems the standard is ambiguous. MS SQL appears to > have flip-flopped on this decision [1]. > > I will change it to hidden by default if th

Re: WIP: System Versioned Temporal Table

2021-01-14 Thread Surafel Temesgen
Hi Simon, Thank you for all the work you does On Mon, Jan 11, 2021 at 5:02 PM Simon Riggs wrote: > > > * Anomalies around use of CURRENT_TIMESTAMP are not discussed or resolved. > Probably need to add a test that end_timestamp > start_timestamp or ERROR, > which effectively enforces serializabil

Re: vacuum_cost_page_miss default value and modern hardware

2021-01-14 Thread Magnus Hagander
On Thu, Jan 14, 2021 at 1:24 AM Peter Geoghegan wrote: > > On Wed, Jan 6, 2021 at 7:43 PM Peter Geoghegan wrote: > > More concretely, we could perhaps lower vacuum_cost_page_miss to 5. It > > has had the value as 10 as its default since 2004 (just like > > vacuum_cost_page_dirty, whose default ha

Re: [HACKERS] [PATCH] Generic type subscripting

2021-01-14 Thread Dian M Fay
On Thu Jan 14, 2021 at 10:04 AM EST, Dmitry Dolgov wrote: > > On Tue, Jan 12, 2021 at 08:02:59PM +0100, Pavel Stehule wrote: > > ne 10. 1. 2021 v 19:52 odesílatel Pavel Stehule > > napsal: > > > > I tested behaviour and I didn't find anything other than the mentioned > > issue. > > > > Now I can c

Re: WIP: System Versioned Temporal Table

2021-01-14 Thread Surafel Temesgen
Hi Andrew, On Fri, Jan 8, 2021 at 4:38 PM Andrew Dunstan wrote: > > On 1/8/21 7:33 AM, Simon Riggs wrote: > > > > * What happens if you ask for a future time? > > It will give an inconsistent result as it scans, so we should refuse a > > query for time > current_timestamp. > > > That seems like a

Re: psql \df choose functions by their arguments

2021-01-14 Thread Greg Sabino Mullane
Thanks for the feedback: new version v5 (attached) has int8, plus the suggested code formatting. Cheers, Greg v5-psql-df-pick-function-by-type.patch Description: Binary data

Re: pg_preadv() and pg_pwritev()

2021-01-14 Thread Sergey Shinderuk
On 14.01.2021 18:42, Tom Lane wrote: I noticed that "cc" invoked from command line uses: -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk Hm, how did you determine that exactly? % echo 'int main(void){}' >tmp.c % cc -v tmp.c Apple clang version 12.0.0 (clang-1200.0.32.28) T

NOT VALID for Unique Indexes

2021-01-14 Thread Simon Riggs
As you may be aware the NOT VALID qualifier currently only applies to CHECK and FK constraints, but not yet to unique indexes. I have had customer requests to change that. It's a reasonably common requirement to be able to change an index to/from a unique index, i.e. Unique -> NonUnique or NonUniq

Re: Stronger safeguard for archive recovery not to miss data

2021-01-14 Thread Laurenz Albe
On Tue, 2020-12-08 at 03:08 +, osumi.takami...@fujitsu.com wrote: > On Thursday, November 26, 2020 4:29 PM > Kyotaro Horiguchi wrote: > > At Thu, 26 Nov 2020 07:18:39 +, "osumi.takami...@fujitsu.com" > > wrote in > > > The attached patch is intended to prevent a scenario that archive > >

Re: pg_preadv() and pg_pwritev()

2021-01-14 Thread Tom Lane
Sergey Shinderuk writes: > I noticed that "cc" invoked from command line uses: > -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk Hm, how did you determine that exactly? regards, tom lane

Re: CheckpointLock needed in CreateCheckPoint()?

2021-01-14 Thread Robert Haas
On Thu, Jan 7, 2021 at 1:02 AM Amul Sul wrote: > As per this comment, it seems to be that we don't really need this LW lock. We > could have something else instead if we are afraid of having multiple > checkpoints at any given time which isn't possible, btw. Yeah, I think this lock is useless. In

Re: outdated references to replication timeout

2021-01-14 Thread John Naylor
On Thu, Jan 14, 2021 at 1:55 AM Michael Paquier wrote: > > On Wed, Jan 13, 2021 at 11:28:55PM +0900, Fujii Masao wrote: > > On Wed, Jan 13, 2021 at 10:51 PM John Naylor < john.nay...@enterprisedb.com> wrote: > >> It is strange, now that I think about it. My thinking was that the > >> former wordin

Re: POC: postgres_fdw insert batching

2021-01-14 Thread Tomas Vondra
On 1/14/21 2:57 PM, Amit Langote wrote: > On Thu, Jan 14, 2021 at 21:57 Tomas Vondra > mailto:tomas.von...@enterprisedb.com>> > wrote: > > On 1/14/21 9:58 AM, Amit Langote wrote: > > Hi, > > > > On Thu, Jan 14, 2021 at 2:41 AM Tomas Vondra > >

Re: [HACKERS] [PATCH] Generic type subscripting

2021-01-14 Thread Dmitry Dolgov
> On Tue, Jan 12, 2021 at 08:02:59PM +0100, Pavel Stehule wrote: > ne 10. 1. 2021 v 19:52 odesílatel Pavel Stehule > napsal: > > I tested behaviour and I didn't find anything other than the mentioned > issue. > > Now I can check this feature from plpgsql, and it is working. Because there > is no s

Re: Logical Replication - behavior of ALTER PUBLICATION .. DROP TABLE and ALTER SUBSCRIPTION .. REFRESH PUBLICATION

2021-01-14 Thread Li Japin
> On Jan 14, 2021, at 8:44 PM, Amit Kapila wrote: > > On Thu, Jan 14, 2021 at 6:02 PM japin wrote: >> >> On Thu, 14 Jan 2021 at 20:19, Bharath Rupireddy wrote: >>> On Thu, Jan 14, 2021 at 5:36 PM Li Japin wrote Do we really need to access PUBLICATIONRELMAP in this patch? What if we

Re: POC: postgres_fdw insert batching

2021-01-14 Thread Amit Langote
On Thu, Jan 14, 2021 at 21:57 Tomas Vondra wrote: > On 1/14/21 9:58 AM, Amit Langote wrote: > > Hi, > > > > On Thu, Jan 14, 2021 at 2:41 AM Tomas Vondra > > wrote: > >> On 1/13/21 3:43 PM, Tomas Vondra wrote: > >>> Thanks for the report. Yeah, I think there's a missing check in > >>> ExecInsert.

cost_sort vs cost_agg

2021-01-14 Thread Andy Fan
Currently the cost_sort doesn't consider the number of columns to sort, which means the cost of SELECT * FROM t ORDER BY a; equals with the SELECT * FROM t ORDER BY a, b; which is obviously wrong. The impact of this is when we choose the plan for SELECT DISTINCT * FROM t ORDER BY c between: Sor

Re: ResourceOwner refactoring

2021-01-14 Thread Heikki Linnakangas
On 14/01/2021 12:15, kuroda.hay...@fujitsu.com wrote: I put some comments. Thanks for the review! Throughout, some components don’t have helper functions. (e.g. catcache has ResOwnerReleaseCatCache, but tupdesc doesn't.) I think it should be unified. Hmm. ResOwnerReleaseTupleDesc() does exi

Re: Is Recovery actually paused?

2021-01-14 Thread Yugo NAGATA
On Wed, 13 Jan 2021 17:49:43 +0530 Dilip Kumar wrote: > On Wed, Jan 13, 2021 at 3:35 PM Dilip Kumar wrote: > > > > On Wed, Jan 13, 2021 at 3:27 PM Yugo NAGATA wrote: > > > > > > On Thu, 10 Dec 2020 11:25:23 +0530 > > > Dilip Kumar wrote: > > > > > > > > > However, I wonder users don't expect p

Re: POC: postgres_fdw insert batching

2021-01-14 Thread Tomas Vondra
On 1/14/21 9:58 AM, Amit Langote wrote: > Hi, > > On Thu, Jan 14, 2021 at 2:41 AM Tomas Vondra > wrote: >> On 1/13/21 3:43 PM, Tomas Vondra wrote: >>> Thanks for the report. Yeah, I think there's a missing check in >>> ExecInsert. Adding >>> >>> (!resultRelInfo->ri_TrigDesc->trig_insert_after_r

Re: profiling

2021-01-14 Thread Heikki Linnakangas
On 14/01/2021 12:14, Павел Еремин wrote: Hello. I am interested in the question of profiling. As far as I understand, this issue has not been resolved in postgres. And I see the urgency of this problem. Are there any postgres development plans for this functionality? What exactly do you mean by

Re: Logical Replication - behavior of ALTER PUBLICATION .. DROP TABLE and ALTER SUBSCRIPTION .. REFRESH PUBLICATION

2021-01-14 Thread Amit Kapila
On Thu, Jan 14, 2021 at 6:02 PM japin wrote: > > On Thu, 14 Jan 2021 at 20:19, Bharath Rupireddy wrote: > > On Thu, Jan 14, 2021 at 5:36 PM Li Japin wrote > >> Do we really need to access PUBLICATIONRELMAP in this patch? What if > >> we just set it to false in the else condition of (if (publish &

Re: Logical Replication - behavior of ALTER PUBLICATION .. DROP TABLE and ALTER SUBSCRIPTION .. REFRESH PUBLICATION

2021-01-14 Thread japin
On Thu, 14 Jan 2021 at 20:19, Bharath Rupireddy wrote: > On Thu, Jan 14, 2021 at 5:36 PM Li Japin wrote >> Do we really need to access PUBLICATIONRELMAP in this patch? What if >> we just set it to false in the else condition of (if (publish && >> (relkind != RELKIND_PARTITIONED_TABLE || pub->pub

Re: Logical Replication - behavior of ALTER PUBLICATION .. DROP TABLE and ALTER SUBSCRIPTION .. REFRESH PUBLICATION

2021-01-14 Thread Bharath Rupireddy
On Thu, Jan 14, 2021 at 5:36 PM Li Japin wrote > Do we really need to access PUBLICATIONRELMAP in this patch? What if > we just set it to false in the else condition of (if (publish && > (relkind != RELKIND_PARTITIONED_TABLE || pub->pubviaroot))) > > Thank for you review. I agree with you, it does

Re: Fix typo about WalSndPrepareWrite

2021-01-14 Thread japin
On Thu, 14 Jan 2021 at 15:32, Kyotaro Horiguchi wrote: > At Thu, 14 Jan 2021 06:46:35 +, Li Japin wrote in >> >> On Jan 14, 2021, at 12:56 PM, Ashutosh Bapat >> mailto:ashutosh.bapat@gmail.com>> wrote: >> >> Hi Japin, >> Thanks for the report. >> >> I think that comment is correct.

Re: Logical Replication - behavior of ALTER PUBLICATION .. DROP TABLE and ALTER SUBSCRIPTION .. REFRESH PUBLICATION

2021-01-14 Thread Li Japin
On Jan 14, 2021, at 1:25 PM, Amit Kapila mailto:amit.kapil...@gmail.com>> wrote: On Wed, Jan 13, 2021 at 5:40 PM Bharath Rupireddy mailto:bharath.rupireddyforpostg...@gmail.com>> wrote: On Wed, Jan 13, 2021 at 3:16 PM Bharath Rupireddy mailto:bharath.rupireddyforpostg...@gmail.com>> wrote: O

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

2021-01-14 Thread Bharath Rupireddy
On Thu, Jan 14, 2021 at 3:52 PM Fujii Masao wrote: > - if (!HeapTupleIsValid(tup)) > - elog(ERROR, "cache lookup failed for user mapping %u", > entry->key); > - umform = (Form_pg_user_mapping) GETSTRUCT(tup); > - server = GetForeignServer(umform->umserver); > -

profiling

2021-01-14 Thread Павел Еремин
Hello. I am interested in the question of profiling. As far as I understand, this issue has not been resolved in postgres. And I see the urgency of this problem. Are there any postgres development plans for this functionality? regards, Eremin Pavel.

Re: proposal: schema variables

2021-01-14 Thread Josef Šimánek
I did some testing locally. All runs smoothly, compiled without warning. Later on (once merged) it would be nice to write down a documentation page for the whole feature as a set next to documented individual commands. It took me a few moments to understand how this works. I was looking how to cr

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

2021-01-14 Thread Fujii Masao
On 2021/01/09 10:12, Bharath Rupireddy wrote: On Fri, Jan 8, 2021 at 9:55 AM Bharath Rupireddy wrote: I will make the changes and post a new patch set soon. Attaching v9 patch set that has addressed the review comments on the disconnect function returning setof records, documentation change

RE: ResourceOwner refactoring

2021-01-14 Thread kuroda.hay...@fujitsu.com
Hi, I put some comments. Throughout, some components don’t have helper functions. (e.g. catcache has ResOwnerReleaseCatCache, but tupdesc doesn't.) I think it should be unified. [catcache.c] > +/* support for catcache refcount management */ > +static inline void > +ResourceOwnerEnlargeCatCacheRe

Re: Get memory contexts of an arbitrary backend process

2021-01-14 Thread torikoshia
Since pg_get_target_backend_memory_contexts() waits to dump memory and it could lead dead lock as below. - session1 BEGIN; TRUNCATE t; - session2 BEGIN; TRUNCATE t; -- wait - session1 SELECT * FROM pg_get_target_backend_memory_contexts(2>); --wait Thanks for notifying me, Fujii-s

Re: Yet another fast GiST build

2021-01-14 Thread Andrey Borodin
> 14 янв. 2021 г., в 04:47, Peter Geoghegan написал(а): > > On Tue, Jan 12, 2021 at 5:49 AM Heikki Linnakangas wrote: >> I did a bit of cleanup on the function signature. The .sql script >> claimed that gist_page_items() took bytea as argument, but in reality it >> was a relation name, as text

Re: remove unneeded pstrdup in fetch_table_list

2021-01-14 Thread Amit Kapila
On Thu, Jan 14, 2021 at 10:51 AM Tom Lane wrote: > > Michael Paquier writes: > > On Thu, Jan 14, 2021 at 01:17:57AM +, Hou, Zhijie wrote: > Thanks. I am thinking to backpatch this even though there is no > problem reported from any production system. What do you think? > > > text_to

Re: proposal: schema variables

2021-01-14 Thread Erik Rijkers
On 2021-01-14 07:35, Pavel Stehule wrote: [schema-variables-20210114.patch.gz] Build is fine. My (small) list of tests run OK. I did notice a few more documentation peculiarities: 'The PostgreSQL has schema variables' should be 'PostgreSQL has schema variables' A lin

Re: [bug fix] Fix the size calculation for shmem TOC

2021-01-14 Thread Fujii Masao
On 2021/01/14 17:47, tsunakawa.ta...@fujitsu.com wrote: Hello, The attached patch fixes a trivial mistake in the calculation of shmem TOC. The original code allocates unduly large memory because it adds the result of add_size() to its left argument. Thanks for the report and patch! The p

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

2021-01-14 Thread Tang, Haiying
Hi Greg, Amit Cc:hackers > > > 4. Have you checked the overhead of this on the planner for > > > different kinds of statements like inserts into tables having 100 > > > or 500 partitions? Similarly, it is good to check the overhead of > > > domain related checks added in the patch. > > > > > >

Re: POC: postgres_fdw insert batching

2021-01-14 Thread Amit Langote
Hi, On Thu, Jan 14, 2021 at 2:41 AM Tomas Vondra wrote: > On 1/13/21 3:43 PM, Tomas Vondra wrote: > > Thanks for the report. Yeah, I think there's a missing check in > > ExecInsert. Adding > > > > (!resultRelInfo->ri_TrigDesc->trig_insert_after_row) > > > > solves this. But now I'm wondering if

[bug fix] Fix the size calculation for shmem TOC

2021-01-14 Thread tsunakawa.ta...@fujitsu.com
Hello, The attached patch fixes a trivial mistake in the calculation of shmem TOC. The original code allocates unduly large memory because it adds the result of add_size() to its left argument. Regards Takayuki Tsunakawa 0001-Fix-size-calculation-for-shmem-TOC.patch Description: 0001-Fix-

Re: [PATCH] Identify LWLocks in tracepoints

2021-01-14 Thread Craig Ringer
On Thu, 14 Jan 2021 at 15:56, Peter Eisentraut < peter.eisentr...@enterprisedb.com> wrote: > On 2020-12-19 06:00, Craig Ringer wrote: > > Patch 1 fixes a bogus tracepoint where an lwlock__acquire event would be > > fired from LWLockWaitForVar, despite that function never actually > > acquiring the

Re: [PATCH] Identify LWLocks in tracepoints

2021-01-14 Thread Craig Ringer
On Wed, 13 Jan 2021 at 19:19, Dmitry Dolgov <9erthali...@gmail.com> wrote: > > On Sat, Dec 19, 2020 at 01:00:01PM +0800, Craig Ringer wrote: > > > > The attached patch set follows on from the discussion in [1] "Add LWLock > > blocker(s) information" by adding the actual LWLock* and the numeric > >

Re: Protect syscache from bloating with negative cache entries

2021-01-14 Thread Kyotaro Horiguchi
Hello. The commit 4656e3d668 (debug_invalidate_system_caches_always) conflicted with this patch. Rebased. regards. -- Kyotaro Horiguchi NTT Open Source Software Center >From ec069488fd2675369530f3f967f02a7b683f0a7f Mon Sep 17 00:00:00 2001 From: Kyotaro Horiguchi Date: Wed, 18 Nov 2020 16:54:3

Re: In-placre persistance change of a relation

2021-01-14 Thread Kyotaro Horiguchi
At Tue, 12 Jan 2021 18:58:08 +0900 (JST), Kyotaro Horiguchi wrote in > At Fri, 08 Jan 2021 17:52:21 +0900 (JST), Kyotaro Horiguchi > wrote in > > At Fri, 08 Jan 2021 14:47:05 +0900 (JST), Kyotaro Horiguchi > > wrote in > > > This version RelationChangePersistence() is changed not to choose

Re: Improper use about DatumGetInt32

2021-01-14 Thread Michael Paquier
On Wed, Jan 13, 2021 at 09:27:37AM +0100, Peter Eisentraut wrote: > Interesting idea. Here is a patch that incorporates that. Thanks for adding some coverage. This patch needs a small rebase as Heikki has just introduced some functions for gist, bumping the module to 1.9 (no need to bump to 1.10