Re: clean up docs for v12

2019-04-26 Thread Michael Paquier
On Fri, Apr 26, 2019 at 09:56:47PM -0500, Justin Pryzby wrote: > But here's some one-liner excerpts. > > - is 2 bits and maximum is 4095. > Parameters for > + is 2 bits and the maximum is > 4095. Parameters for > > Adding "the" makes it a complete sentence and not a fragment. Not

Re: [PATCH v1] Show whether tables are logged in \dt+

2019-04-26 Thread David Fetter
On Fri, Apr 26, 2019 at 04:22:18PM +0200, Rafia Sabih wrote: > On Fri, 26 Apr 2019 at 14:49, Rafia Sabih wrote: > > > > On Wed, 24 Apr 2019 at 10:30, Fabien COELHO wrote: > > > > > > > > > Hello David, > > > > > > >>> I noticed that there wasn't a bulk way to see table logged-ness in > > > >>>

Re: clean up docs for v12

2019-04-26 Thread Justin Pryzby
On Sat, Apr 27, 2019 at 09:44:20AM +0900, Michael Paquier wrote: > On Fri, Apr 26, 2019 at 12:17:22PM -0500, Justin Pryzby wrote: > > But I think the biggest part of the patch is still not even reviewed ? > > I'm referring to ./*review-docs-for-pg12dev.patch > > Nope. I looked at the patch, and

Re: Optimizer items in the release notes

2019-04-26 Thread David Rowley
On Sat, 27 Apr 2019 at 14:22, Bruce Momjian wrote: > > > * They are hard to explain > > > > That can be true, but we generally get there if not the first time > > then after a few iterations. Authors and committers of the > > improvements are likely to be able to help find suitable wording. > >

Re: Optimizer items in the release notes

2019-04-26 Thread Bruce Momjian
On Sat, Apr 27, 2019 at 02:04:33PM +1200, David Rowley wrote: > On Sat, 27 Apr 2019 at 11:49, Bruce Momjian wrote: > > > > On Wed, Apr 24, 2019 at 02:46:15PM -0400, Adam Brusselback wrote: > > > As a user, I am interested in the optimizer changes for sure, and I > > > actually had wished they

Re: Optimizer items in the release notes

2019-04-26 Thread David Rowley
On Sat, 27 Apr 2019 at 11:49, Bruce Momjian wrote: > > On Wed, Apr 24, 2019 at 02:46:15PM -0400, Adam Brusselback wrote: > > As a user, I am interested in the optimizer changes for sure, and I > > actually had wished they were highlighted more in previous releases. > > > > > I think planner

Re: Calling PrepareTempTablespaces in BufFileCreateTemp

2019-04-26 Thread Michael Paquier
On Fri, Apr 26, 2019 at 11:05:11AM -0400, Tom Lane wrote: > Michael Paquier writes: > The version that I posted left it to GetNextTempTableSpace to assert > that. That seemed cleaner to me than an Assert that has to depend > on interXact. Okay, no objections for that approach as well. Are you

Re: Identity columns should own only one sequence

2019-04-26 Thread Michael Paquier
On Fri, Apr 26, 2019 at 11:55:34AM -0400, Alvaro Herrera wrote: > On 2019-Apr-26, Laurenz Albe wrote: > I think a better overall fix is that that when creating the generated > column (or altering a column to make it generated) we should look for > existing an existing sequence and take ownership

Re: clean up docs for v12

2019-04-26 Thread Michael Paquier
On Fri, Apr 26, 2019 at 12:17:22PM -0500, Justin Pryzby wrote: > But I think the biggest part of the patch is still not even reviewed ? > I'm referring to ./*review-docs-for-pg12dev.patch Nope. I looked at the patch, and as mentioned upthread the suggested changes did not seem like improvements

Re: Fwd: Add tablespace tap test to pg_rewind

2019-04-26 Thread Michael Paquier
On Fri, Apr 26, 2019 at 11:21:48AM -0400, Tom Lane wrote: > I don't think feature freeze precludes adding new test cases. I think as well that adding this stuff into v12 would be fine. Now if there is any objection let's wait for later. -- Michael signature.asc Description: PGP signature

Re: What is an item pointer, anyway?

2019-04-26 Thread Peter Geoghegan
On Fri, Apr 26, 2019 at 5:05 PM Tom Lane wrote: > Yeah, I'd be fine with that, although the disconnect between the type > name and the comment terminology might confuse some people. Maybe, but the fact that the ItemIdData struct consists of bit fields that are all named "lp_*" offers a hint.

Re: "Routine Reindexing" docs should be updated to reference REINDEX CONCURRENTLY

2019-04-26 Thread Michael Paquier
On Fri, Apr 26, 2019 at 10:53:35AM -0400, Tom Lane wrote: > +1. Maybe say "... which requires only a > SHARE UPDATE EXCLUSIVE lock." Thanks for the review. Committed with your suggested change. -- Michael signature.asc Description: PGP signature

Re: What is an item pointer, anyway?

2019-04-26 Thread Tom Lane
Peter Geoghegan writes: > I was proposing that we not rename any struct at all, and continue to > call ItemId[Data]s "line pointers" only. Yeah, I'd be fine with that, although the disconnect between the type name and the comment terminology might confuse some people.

Re: What is an item pointer, anyway?

2019-04-26 Thread Peter Geoghegan
On Fri, Apr 26, 2019 at 4:57 PM Tom Lane wrote: > ItemId[Data] is somewhat less widely referenced, but I'm still not > much in favor of renaming that type. I think fixing comments to > uniformly call it an item ID would be more reasonable. (We should > leave the "line pointer" terminology in

Re: What is an item pointer, anyway?

2019-04-26 Thread Tom Lane
Ashwin Agrawal writes: > On Fri, Apr 26, 2019 at 2:19 PM Peter Geoghegan wrote: >> ISTM that the >> least confusing way of removing the ambiguity would be to no longer >> refer to ItemIds as item pointers, without changing anything else. How many places would we be changing to clean that up? >

Re: What is an item pointer, anyway?

2019-04-26 Thread Peter Geoghegan
On Fri, Apr 26, 2019 at 4:23 PM Ashwin Agrawal wrote: > How about we rename ItemPointerData to TupleIdentifier or ItemIdentifier > instead and leave ItemPointer or Item confined to AM term, where item can be > tuple, datum or anything else ? I'm not a fan of that idea, because the reality is

Re: Optimizer items in the release notes

2019-04-26 Thread Bruce Momjian
On Wed, Apr 24, 2019 at 02:46:15PM -0400, Adam Brusselback wrote: > As a user, I am interested in the optimizer changes for sure, and I > actually had wished they were highlighted more in previous releases. > > > I think planner smarts are arguably one of our weakest areas when > > compared to the

Re: What is an item pointer, anyway?

2019-04-26 Thread Ashwin Agrawal
On Fri, Apr 26, 2019 at 2:19 PM Peter Geoghegan wrote: > itemid.h introduces the struct ItemIdData as follows: > > /* > * An item pointer (also called line pointer) on a buffer page > > Meanwhile, itemptr.h introduces the struct ItemPointerData as follows: > > /* > * ItemPointer: > * > *

Re: BUG #15672: PostgreSQL 11.1/11.2 crashed after dropping a partition table

2019-04-26 Thread Tom Lane
I went ahead and pushed the stopgap patches, along with regression tests based on yours. The tests show the current (i.e. wrong) behavior for index comment and relfilenode reuse. I think that whenever we fix that, we can just adjust the expected output instead of adding more tests.

What is an item pointer, anyway?

2019-04-26 Thread Peter Geoghegan
itemid.h introduces the struct ItemIdData as follows: /* * An item pointer (also called line pointer) on a buffer page Meanwhile, itemptr.h introduces the struct ItemPointerData as follows: /* * ItemPointer: * * This is a pointer to an item within a disk page of a known file * (for

Re: Regression test PANICs with master-standby setup on same machine

2019-04-26 Thread Andres Freund
Hi, On 2019-04-26 17:29:56 +0900, Kyotaro HORIGUCHI wrote: > Win32 implement cannot have symbolic link feature as Linux-like > OSes for some restrictions. (Windows 7 and 10 behave differently, > as I heard.) > > So the 0002 patch implemnets "fake" symbolic link as mentioned in > its commit

Initializing LWLock Array from Server Code

2019-04-26 Thread Souvik Bhattacherjee
Hi, I have created a shared hash table in partitioned mode inside the postgres server code. In order to guard the partitions, I'm trying to initialize an array of LWLocks. The code that I'm trying to use for that is void RequestNamedLWLockTranche

Re: BUG #15672: PostgreSQL 11.1/11.2 crashed after dropping a partition table

2019-04-26 Thread Tom Lane
Alvaro Herrera writes: > Um, this one doesn't apply because of yesterday's 87259588d0ab. Before we spend too much time on minutiae, we should ask ourselves whether this patch is even going in the right direction. I'm not sure. One point is that if we simply adopt the old index as-is, we won't

Re: clean up docs for v12

2019-04-26 Thread Justin Pryzby
Hi, On Tue, Apr 23, 2019 at 11:50:42AM +0900, Michael Paquier wrote: > On Mon, Apr 22, 2019 at 12:19:55PM -0400, Alvaro Herrera wrote: > > On 2019-Apr-22, Andres Freund wrote: > >> I think it'd be better just to fix s/the all/that all/. > > > > (and s/if's/if it's/) > > FWIW, I have noticed

Re: BUG #15781: subselect on foreign table (postgres_fdw) can crash (segfault)

2019-04-26 Thread Tom Lane
Etsuro Fujita writes: > (2019/04/26 3:24), Tom Lane wrote: >> If we do leave it like this, then the only way for postgres_fdw to >> avoid trouble is to not have any entries in fdw_exprs that exactly >> match entries in fdw_scan_tlist. So that pretty much devolves back >> to what I said before:

RE: psql - add SHOW_ALL_RESULTS option

2019-04-26 Thread Fabien COELHO
Hello Aya-san, Thanks for this review. There is space (+--' '). Please delete it. It is cause of regression test failed. Indeed, unsure how I could do that. Fixed. IMHO this new setting should be on by default: few people know about \; so it would not change anything for most, and I do

Re: Segfault when restoring -Fd dump on current HEAD

2019-04-26 Thread Alvaro Herrera
Thanks! Pushed. Marking the open item as closed too. -- Álvaro Herrerahttps://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

Re: Identity columns should own only one sequence

2019-04-26 Thread Alvaro Herrera
On 2019-Apr-26, Laurenz Albe wrote: > What do you think of the patch I just posted on this thread to > remove ownership automatically when the default is dropped, as Michael > suggested? I think that would make things much more intuitive from > the user's perspective. I think a better overall

Re: BUG #15672: PostgreSQL 11.1/11.2 crashed after dropping a partition table

2019-04-26 Thread Alvaro Herrera
Hi, Please trim the quoted text in your reply. On 2019-Apr-26, Amit Langote wrote: > Per Alvaro's report, regression tests added weren't portable. Fixed that > in the attached updated patch. Um, this one doesn't apply because of yesterday's 87259588d0ab. -- Álvaro Herrera

Re: Fwd: Add tablespace tap test to pg_rewind

2019-04-26 Thread Tom Lane
Alvaro Herrera writes: > On 2019-Apr-26, Michael Paquier wrote: >> On Fri, Apr 26, 2019 at 10:11:24AM -0400, Alvaro Herrera wrote: >>> I just noticed this thread. What do we think of adding this test to >>> pg12? (The patch doesn't apply verbatim, but it's a small update to get >>> it to

Re: Fwd: Add tablespace tap test to pg_rewind

2019-04-26 Thread Alvaro Herrera
On 2019-Apr-26, Michael Paquier wrote: > On Fri, Apr 26, 2019 at 10:11:24AM -0400, Alvaro Herrera wrote: > > I just noticed this thread. What do we think of adding this test to > > pg12? (The patch doesn't apply verbatim, but it's a small update to get > > it to apply.) > > Could you let me

Re: Calling PrepareTempTablespaces in BufFileCreateTemp

2019-04-26 Thread Tom Lane
Michael Paquier writes: > I think that one piece is missing from the patch. Wouldn't it be > better to add an assertion at the beginning of OpenTemporaryFile() to > make sure that PrepareTempTablespaces() has been called when interXact > is true? We could just go with that: > Assert(!interXact

Re: findTargetlistEntrySQL92() and COLLATE clause

2019-04-26 Thread Tom Lane
Amit Langote writes: > I couldn't find old discussions or source code comments about this, but > has someone encountered the following error and wondered whether it's > working that way for a reason? > select a::text, b from foo order by 1, 2 collate "C"; > ERROR: collations are not supported

Re: "Routine Reindexing" docs should be updated to reference REINDEX CONCURRENTLY

2019-04-26 Thread Tom Lane
Michael Paquier writes: > On Thu, Apr 25, 2019 at 01:34:41PM -0700, Peter Geoghegan wrote: >> The documentation has a section called "Routine Reindexing", which >> explains how to simulate REINDEX CONCURRENTLY with a sequence of >> creation and replacement steps. This should be updated to

Re: Execute INSERT during a parallel operation

2019-04-26 Thread Rafia Sabih
On Sun, 14 Apr 2019 at 04:11, Donald Dong wrote: > > Hi, > > I'm trying to use the SPI to save the executed plans in the ExecutorEnd. When > the plan involves multiple workers, the insert operations would trigger an > error: cannot execute INSERT during a parallel operation. > > I wonder if

Re: REINDEX INDEX results in a crash for an index of pg_class since 9.6

2019-04-26 Thread Tom Lane
Andres Freund writes: > On 2019-04-25 17:12:33 -0400, Tom Lane wrote: >> Andres Freund writes: >>> I was wondering if we should just pass in the pg_class tuple as an "out" >>> argument, instead of pointers to relfilnode/relfrozenxid/relminmxid. >> Yeah, possibly. The whole business with xids

RE: Copy data to DSA area

2019-04-26 Thread Ideriha, Takeshi
Hi, I've updated Thomas's quick PoC. >From: Ideriha, Takeshi [mailto:ideriha.take...@jp.fujitsu.com] >Sent: Wednesday, April 17, 2019 2:07 PM >>From: Ideriha, Takeshi [mailto:ideriha.take...@jp.fujitsu.com] >>Sent: Wednesday, December 5, 2018 2:42 PM >>Subject: RE: Copy data to DSA area > >Things

Re: Fwd: Add tablespace tap test to pg_rewind

2019-04-26 Thread Michael Paquier
On Fri, Apr 26, 2019 at 10:11:24AM -0400, Alvaro Herrera wrote: > I just noticed this thread. What do we think of adding this test to > pg12? (The patch doesn't apply verbatim, but it's a small update to get > it to apply.) Could you let me have a look at it? I have not tested on Windows, but

Re: [PATCH v1] Show whether tables are logged in \dt+

2019-04-26 Thread Rafia Sabih
On Fri, 26 Apr 2019 at 14:49, Rafia Sabih wrote: > > On Wed, 24 Apr 2019 at 10:30, Fabien COELHO wrote: > > > > > > Hello David, > > > > >>> I noticed that there wasn't a bulk way to see table logged-ness in psql, > > >>> so I made it part of \dt+. > > >> > > >> Applies, compiles, works for me.

Re: set relispartition when attaching child index

2019-04-26 Thread Alvaro Herrera
On 2019-Apr-25, Amit Langote wrote: > BTW, this will need to be back-patched to 11. Done, thanks for the patch. I added the test in master, but obviously it doesn't work in pg11, so I just verified manually that relispartition is set correctly. I don't think it's worth doing more, though there

Re: Fwd: Add tablespace tap test to pg_rewind

2019-04-26 Thread Alvaro Herrera
I just noticed this thread. What do we think of adding this test to pg12? (The patch doesn't apply verbatim, but it's a small update to get it to apply.) -- Álvaro Herrerahttps://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

Re: Segfault when restoring -Fd dump on current HEAD

2019-04-26 Thread Tomas Vondra
On Fri, Apr 26, 2019 at 11:55:17AM +0900, Michael Paquier wrote: On Thu, Apr 25, 2019 at 12:54:06PM -0700, Andres Freund wrote: I think that'd make sense. The rest of the RMT probably isn't awake however, so I think it'd be good to give them 24h to object. It would be nice to clean all that

Re: Identity columns should own only one sequence

2019-04-26 Thread Laurenz Albe
On Fri, 2019-04-26 at 15:23 +0200, Peter Eisentraut wrote: > > So if one tries to convert a "serial" column to an identity column, > > the following can happen: > > > > test=> CREATE TABLE ser(id serial); > > CREATE TABLE > > test=> ALTER TABLE ser ALTER id ADD GENERATED ALWAYS AS IDENTITY; > >

Re: Identity columns should own only one sequence

2019-04-26 Thread Peter Eisentraut
On 2019-04-14 17:51, Laurenz Albe wrote: > Identity columns don't work if they own more than one sequence. Well, they shouldn't, because then how do they know which sequence they should use? > So if one tries to convert a "serial" column to an identity column, > the following can happen: > >

Re: [PATCH v1] Show whether tables are logged in \dt+

2019-04-26 Thread Rafia Sabih
On Wed, 24 Apr 2019 at 10:30, Fabien COELHO wrote: > > > Hello David, > > >>> I noticed that there wasn't a bulk way to see table logged-ness in psql, > >>> so I made it part of \dt+. > >> > >> Applies, compiles, works for me. > >> > >> ISTM That temporary-ness is not shown either. Maybe the

Re: BUG #15781: subselect on foreign table (postgres_fdw) can crash (segfault)

2019-04-26 Thread Etsuro Fujita
(2019/04/26 3:24), Tom Lane wrote: PG Bug reporting form writes: [ this crashes if ft4 is a postgres_fdw foreign table: ] select exists(select c1 from ft4), avg(c1) from ft4 where c1 = (select max(c1) from ft4); Hm, the max() subquery isn't necessary, this is sufficient: select

Re: "Routine Reindexing" docs should be updated to reference REINDEX CONCURRENTLY

2019-04-26 Thread Peter Eisentraut
On 2019-04-26 05:05, Michael Paquier wrote: > On Thu, Apr 25, 2019 at 01:34:41PM -0700, Peter Geoghegan wrote: >> The documentation has a section called "Routine Reindexing", which >> explains how to simulate REINDEX CONCURRENTLY with a sequence of >> creation and replacement steps. This should be

Re: Identity columns should own only one sequence

2019-04-26 Thread Laurenz Albe
On Thu, 2019-04-25 at 09:55 +0900, Michael Paquier wrote: > On Sun, Apr 14, 2019 at 05:51:47PM +0200, Laurenz Albe wrote: > > test=> INSERT INTO ser (id) VALUES (DEFAULT); > > ERROR: more than one owned sequence found > > Yes this should never be user-triggerable, so it seems that we need to >

Re: [HACKERS] advanced partition matching algorithm for partition-wise join

2019-04-26 Thread Rajkumar Raghuwanshi
On Wed, Apr 24, 2019 at 4:56 PM amul sul wrote: > Attached version is rebase atop of the latest master head(fdc7efcc30), also > incorporates the Ashutosh's suggestion, thanks. > Thanks for rebase patch, patches applied cleanly on PG head. I did some crash testing with extra test case [0006

Re: New vacuum option to do only freezing

2019-04-26 Thread Masahiko Sawada
On Fri, Apr 26, 2019 at 12:11 AM Robert Haas wrote: > > On Tue, Apr 23, 2019 at 7:09 AM Masahiko Sawada wrote: > > For the second issue, I've changed lazy vacuum so that it reports both > > the number of kilobytes we freed and the number of kilobytes can be > > freed after index cleanup. > > I

Re: pgsql: Allow insert and update tuple routing and COPY for foreign table

2019-04-26 Thread Etsuro Fujita
(2019/04/26 13:58), Etsuro Fujita wrote: (2019/04/26 13:20), Amit Langote wrote: + Note that this function is also called when inserting routed tuples into + a foreign-table partition or executingCOPY FROM on + a foreign table, in which case it is called in a different way than it + is in

Re: Remove page-read callback from XLogReaderState.

2019-04-26 Thread Kyotaro HORIGUCHI
Hello. Thank you for looking this. At Thu, 25 Apr 2019 13:58:20 +0200, Antonin Houska wrote in <18581.1556193500@localhost> > Kyotaro HORIGUCHI wrote: > > > Hello. As mentioned before [1], read_page callback in > > XLogReaderState is a cause of headaches. Adding another > > remote-controlling

Re: Regression test PANICs with master-standby setup on same machine

2019-04-26 Thread Kyotaro HORIGUCHI
Hello. Win32 implement cannot have symbolic link feature as Linux-like OSes for some restrictions. (Windows 7 and 10 behave differently, as I heard.) So the 0002 patch implemnets "fake" symbolic link as mentioned in its commit message. Also I fixed 0001 slightly. regards. At Thu, 25 Apr 2019

Re: Calling PrepareTempTablespaces in BufFileCreateTemp

2019-04-26 Thread Michael Paquier
On Thu, Apr 25, 2019 at 10:40:01AM -0700, Ashwin Agrawal wrote: > Is there (easy) way to assert for that assumption? If yes, then can add the > same and make it not rickety. IsTransactionState() would be enough? -- Michael signature.asc Description: PGP signature

Re: Calling PrepareTempTablespaces in BufFileCreateTemp

2019-04-26 Thread Michael Paquier
On Thu, Apr 25, 2019 at 12:45:03PM -0400, Tom Lane wrote: > I still remain concerned that invoking catalog lookups from fd.c is a darn > bad idea, even if we have a fallback for it to work (for some value of > "work") in non-transactional states. It's not really hard to envision > that kind of