Re: [HACKERS] expanding inheritance in partition bound order

2017-08-16 Thread Ashutosh Bapat
On Thu, Aug 17, 2017 at 10:54 AM, Amit Langote wrote: > On 2017/08/17 13:56, Ashutosh Bapat wrote: >> On Thu, Aug 17, 2017 at 8:06 AM, Amit Langote >> wrote: >>> On 2017/08/17 11:22, Robert Haas wrote: On Wed, Aug 16, 2017 at 10:12 PM, Amit Langote wrote: >> In the catalogs we are

Re: [HACKERS] expanding inheritance in partition bound order

2017-08-16 Thread Amit Langote
On 2017/08/17 13:56, Ashutosh Bapat wrote: > On Thu, Aug 17, 2017 at 8:06 AM, Amit Langote > wrote: >> On 2017/08/17 11:22, Robert Haas wrote: >>> On Wed, Aug 16, 2017 at 10:12 PM, Amit Langote >>> wrote: > In the catalogs we are using full "partitioned" e.g. > pg_partitioned_table. May

Re: [HACKERS] Quorum commit for multiple synchronous replication.

2017-08-16 Thread Michael Paquier
On Thu, Aug 17, 2017 at 2:08 PM, Masahiko Sawada wrote: > On Wed, Aug 16, 2017 at 4:37 PM, Michael Paquier > wrote: >> On Wed, Aug 16, 2017 at 4:24 PM, Masahiko Sawada >> wrote: >>> FWIW, in my opinion if tte current behavior of 'N(a,b)' could confuse >>> users and we want to break the backward

Re: [HACKERS] Orphaned files in base/[oid]

2017-08-16 Thread Chris Travers
On Wed, Aug 16, 2017 at 7:15 PM, Andres Freund wrote: > > > I think this entirely is the wrong approach. We shouldn't add weird > check commands that require locks on pg_class, we should avoid leaving > the orphaned files in the first place. I've upthread outlined > approached how to do so. >

Re: [HACKERS] Quorum commit for multiple synchronous replication.

2017-08-16 Thread Masahiko Sawada
On Wed, Aug 16, 2017 at 4:37 PM, Michael Paquier wrote: > On Wed, Aug 16, 2017 at 4:24 PM, Masahiko Sawada > wrote: >> FWIW, in my opinion if tte current behavior of 'N(a,b)' could confuse >> users and we want to break the backward compatibility, I'd rather like >> to remove that style in Postgr

Re: [HACKERS] [BUGS] [postgresql 10 beta3] unrecognized node type: 90

2017-08-16 Thread Thomas Munro
On Thu, Aug 17, 2017 at 4:37 PM, Amit Kapila wrote: > Note - enable_gathermerge is not present in postgresql.conf. I think > we should add it in the postgresql.conf.sample file. +1 See also https://www.postgresql.org/message-id/CAEepm=0b7ym9mzsviq1d-hnt4koarvejvsfayvfyknv-pvd...@mail.gmail.com

Re: [HACKERS] recovery_target_time = 'now' is not an error but still impractical setting

2017-08-16 Thread Michael Paquier
On Thu, Aug 17, 2017 at 1:28 PM, Tom Lane wrote: > -1 ... every datatype I/O function is entitled to assume it's being > invoked inside a transaction. I do not think we should break that > on a case-by-case basis. So using timestamptz_in directly in xlog.c > was a bad idea, and we need to rethin

Re: [HACKERS] expanding inheritance in partition bound order

2017-08-16 Thread Ashutosh Bapat
On Thu, Aug 17, 2017 at 8:06 AM, Amit Langote wrote: > On 2017/08/17 11:22, Robert Haas wrote: >> On Wed, Aug 16, 2017 at 10:12 PM, Amit Langote >> wrote: In the catalogs we are using full "partitioned" e.g. pg_partitioned_table. May be we should name the column as "inhchildpartit

Re: [HACKERS] [BUGS] [postgresql 10 beta3] unrecognized node type: 90

2017-08-16 Thread Amit Kapila
On Tue, Aug 15, 2017 at 7:16 PM, Tom Lane wrote: > Robert Haas writes: >> On Tue, Aug 15, 2017 at 7:31 AM, Amit Kapila wrote: >>> Attached patch fixes the issue for me. I have locally verified that >>> the gather merge gets executed in rescan path. I haven't added a test >>> case for the same

Re: [HACKERS] recovery_target_time = 'now' is not an error but still impractical setting

2017-08-16 Thread Tom Lane
Michael Paquier writes: > On Tue, Aug 15, 2017 at 11:37 PM, Piotr Stefaniak > wrote: >> At the very least, I think timestamptz_in() should either complain about >> being called outside of transaction or return the expected value, >> because returning year 2000 is unuseful at best. I would also li

Re: [HACKERS] Proposal: Improve bitmap costing for lossy pages

2017-08-16 Thread Dilip Kumar
On Wed, Jul 26, 2017 at 10:35 PM, Robert Haas wrote: > On Thu, Jun 8, 2017 at 10:44 AM, Dilip Kumar wrote: >> On Thu, May 18, 2017 at 8:07 PM, Robert Haas wrote: >> Thanks for the feedback. I haven't yet worked on optimizer side feedback but I have done some work for improving the executor par

Re: [HACKERS] recovery_target_time = 'now' is not an error but still impractical setting

2017-08-16 Thread Michael Paquier
On Tue, Aug 15, 2017 at 11:37 PM, Piotr Stefaniak wrote: > At the very least, I think timestamptz_in() should either complain about > being called outside of transaction or return the expected value, > because returning year 2000 is unuseful at best. I would also like to > become able to do what I

Re: [HACKERS] Extra Vietnamese unaccent rules

2017-08-16 Thread Tom Lane
Michael Paquier writes: > On Thu, Aug 17, 2017 at 6:01 AM, Tom Lane wrote: >> I'm not really qualified to review the Python coding >> style, but I did fix a typo in a comment. > No pythonist here, but a large confusing "if" condition without any > comments is better if split up and explained wit

Re: [HACKERS] SCRAM salt length

2017-08-16 Thread Michael Paquier
On Thu, Aug 17, 2017 at 12:10 AM, Aleksander Alekseev wrote: >> The SCRAM salt length is currently set as >> >> /* length of salt when generating new verifiers */ >> #define SCRAM_DEFAULT_SALT_LEN 12 >> >> without further comment. >> >> I suspect that this length was chosen based on the exampl

Re: [HACKERS] expanding inheritance in partition bound order

2017-08-16 Thread Amit Langote
On 2017/08/17 11:22, Robert Haas wrote: > On Wed, Aug 16, 2017 at 10:12 PM, Amit Langote > wrote: >>> In the catalogs we are using full "partitioned" e.g. pg_partitioned_table. >>> May >>> be we should name the column as "inhchildpartitioned". >> >> Sure. > > I suggest inhpartitioned or inhispar

Re: [HACKERS] One-shot expanded output in psql using \gx

2017-08-16 Thread Stephen Frost
Noah, all, On Wed, Aug 16, 2017 at 22:24 Noah Misch wrote: > On Tue, Aug 15, 2017 at 10:24:34PM +0200, Tobias Bussmann wrote: > > I've tested the new \gx against 10beta and current git HEAD. Actually > one of my favourite features of PostgreSQL 10! However in my environment it > was behaving str

Re: [HACKERS] taking stdbool.h into use

2017-08-16 Thread Michael Paquier
On Wed, Aug 16, 2017 at 11:20 PM, Tom Lane wrote: > Don't know how far back you need to go to find Windows machines > with 4-byte bool, but we have some pretty long-in-the-tooth > buildfarm critters in that lineage, too. >From VS 2003 and upwards the size has always been 1: https://msdn.microsoft

Re: [HACKERS] One-shot expanded output in psql using \gx

2017-08-16 Thread Noah Misch
On Tue, Aug 15, 2017 at 10:24:34PM +0200, Tobias Bussmann wrote: > I've tested the new \gx against 10beta and current git HEAD. Actually one of > my favourite features of PostgreSQL 10! However in my environment it was > behaving strangely. After some debugging I found that \gx does not work if

Re: [HACKERS] expanding inheritance in partition bound order

2017-08-16 Thread Robert Haas
On Wed, Aug 16, 2017 at 10:12 PM, Amit Langote wrote: >> In the catalogs we are using full "partitioned" e.g. pg_partitioned_table. >> May >> be we should name the column as "inhchildpartitioned". > > Sure. I suggest inhpartitioned or inhispartition. inhchildpartitioned seems too long. > There

Re: [HACKERS] expanding inheritance in partition bound order

2017-08-16 Thread Amit Langote
Hi Ashutosh, Thanks for the review and the updated patch. On 2017/08/16 21:48, Ashutosh Bapat wrote: > On Wed, Aug 16, 2017 at 11:06 AM, Amit Langote > wrote: > >> >>> This patch series is blocking a bunch of other things, so it would be >>> nice if you could press forward with this quickly. >>

Re: [HACKERS] Supporting huge pages on Windows

2017-08-16 Thread Thomas Munro
On Wed, Apr 12, 2017 at 7:08 PM, Tsunakawa, Takayuki wrote: > Oh, I got it now. Thanks. The revised patch is attached. The only modified > file is pg_ctl.c. The patch worked as expected. > > It is regrettable that I could not make it in time for PG 10, but I'd > appreciate it if you could re

Re: [HACKERS] Function to move the position of a replication slot

2017-08-16 Thread Craig Ringer
On 17 August 2017 at 09:33, Andres Freund wrote: > On 2017-08-16 21:25:48 -0400, Robert Haas wrote: > > On Wed, Aug 16, 2017 at 5:55 PM, Andres Freund > wrote: > > > I think we should constrain the API to only allow later LSNs than > > > currently in the slot, rather than arbitrary ones. That's

Re: [HACKERS] Extra Vietnamese unaccent rules

2017-08-16 Thread Michael Paquier
On Thu, Aug 17, 2017 at 6:01 AM, Tom Lane wrote: > Pushed into v11. Thanks. > I'm not really qualified to review the Python coding > style, but I did fix a typo in a comment. No pythonist here, but a large confusing "if" condition without any comments is better if split up and explained with co

Re: [HACKERS] [BUGS] Replication to Postgres 10 on Windows is broken

2017-08-16 Thread Tatsuo Ishii
> On Thu, Aug 17, 2017 at 9:15 AM, Tatsuo Ishii wrote: >>> He meant logical replication, >> >> Oh I could not find he meant logical replication in the original >> report. > > The second message of the thread says so, but the first does not > mention logical replication at all. >>From here are men

Re: [HACKERS] Broken link to DocBook XSL Stylesheets

2017-08-16 Thread Masahiko Sawada
On Thu, Aug 17, 2017 at 3:52 AM, Peter Eisentraut wrote: > On 6/20/17 22:20, Masahiko Sawada wrote: >> Hi, >> >> In J.2. Tool Sets section of documentation, there is a link to DocBook >> XSL Stylesheets but that link seems no longer available. I got 404 >> error. >> >> J.2. Tool Sets >>

Re: [HACKERS] Function to move the position of a replication slot

2017-08-16 Thread Andres Freund
On 2017-08-16 21:25:48 -0400, Robert Haas wrote: > On Wed, Aug 16, 2017 at 5:55 PM, Andres Freund wrote: > > I think we should constrain the API to only allow later LSNs than > > currently in the slot, rather than arbitrary ones. That's why I was > > thinking of "forward". I'm not convinced it's

Re: [HACKERS] [BUGS] Replication to Postgres 10 on Windows is broken

2017-08-16 Thread Michael Paquier
On Thu, Aug 17, 2017 at 9:15 AM, Tatsuo Ishii wrote: >> He meant logical replication, > > Oh I could not find he meant logical replication in the original > report. The second message of the thread says so, but the first does not mention logical replication at all. >From here are mentioned PG 9.6

Re: [HACKERS] Function to move the position of a replication slot

2017-08-16 Thread Robert Haas
On Wed, Aug 16, 2017 at 5:55 PM, Andres Freund wrote: > I think we should constrain the API to only allow later LSNs than > currently in the slot, rather than arbitrary ones. That's why I was > thinking of "forward". I'm not convinced it's a good / safe idea to > allow arbitrary values to be set.

Re: [HACKERS] expanding inheritance in partition bound order

2017-08-16 Thread Amit Langote
Hi Amit, Thanks for the comments. On 2017/08/16 20:30, Amit Khandekar wrote: > On 16 August 2017 at 11:06, Amit Langote > wrote: > >> Attached updated patches. > > Thanks Amit for the patches. > > I too agree with the overall approach taken for keeping the locking > order consistent: it's be

Re: [HACKERS] Function to move the position of a replication slot

2017-08-16 Thread Michael Paquier
On Thu, Aug 17, 2017 at 9:19 AM, Craig Ringer wrote: > pg_advance_replication_slot(...) > > ERROR's on logical slot, for now. Physical slots only. > > Forward-only. > > Future work to allow it to use the logical decoding infrastructure to > fast-forward a slot by reading only catalog change inform

Re: [HACKERS] Fix number skipping in to_number

2017-08-16 Thread Thomas Munro
On Thu, Aug 10, 2017 at 10:21 PM, Oliver Ford wrote: > Prevents an issue where numbers can be skipped in the to_number() > function when the format mask contains a "G" or a "," but the input > string doesn't contain a separator. This resolves the TODO item "Fix > to_number() handling for values no

Re: [HACKERS] [COMMITTERS] pgsql: Include foreign tables in information_schema.table_privileges

2017-08-16 Thread Peter Eisentraut
On 8/16/17 07:27, Robert Haas wrote: > On Tue, Aug 15, 2017 at 7:41 PM, Peter Eisentraut wrote: >> Include foreign tables in information_schema.table_privileges >> >> This appears to have been an omission in the original commit >> 0d692a0dc9f. All related information_schema views already include

Re: [HACKERS] [PATCH] pageinspect function to decode infomasks

2017-08-16 Thread Craig Ringer
On 16 August 2017 at 23:14, Robert Haas wrote: > On Tue, Aug 15, 2017 at 4:36 PM, Tomas Vondra > wrote: > > You might say that people investigating issues in this area of code > should > > be aware of how HEAP_XMIN_FROZEN is defined, and perhaps you're right ... > > Yes, I think that's what I wo

Re: [HACKERS] Function to move the position of a replication slot

2017-08-16 Thread Craig Ringer
On 17 August 2017 at 07:30, Michael Paquier wrote: > > Definitely agreed on that. Any move function would need to check if > the WAL position given by caller is already newer than what's > available in the local pg_wal (minimum of all other slots), with a > shared lock that would need to be taken

Re: [HACKERS] [BUGS] Replication to Postgres 10 on Windows is broken

2017-08-16 Thread Tatsuo Ishii
> He meant logical replication, Oh I could not find he meant logical replication in the original report. > but the code in question here is the same > for streaming replication, or whatever it's called. Yes. Best regards, -- Tatsuo Ishii SRA OSS, Inc. Japan English: http://www.sraoss.co.jp/inde

Re: [HACKERS] Atomics for heap_parallelscan_nextpage()

2017-08-16 Thread David Rowley
On 17 August 2017 at 01:20, Heikki Linnakangas wrote: > Looks reasonable. I edited the comments and the variable names a bit, to my > liking, and committed. Thanks! Thanks for committing. I've just been catching up on all that went on while I was sleeping. Thanks for handling the cleanup too. I'

Re: [HACKERS] [BUGS] Replication to Postgres 10 on Windows is broken

2017-08-16 Thread Tatsuo Ishii
> In practice it's largely about architecture, I think. You definitely > need the same endianness and floating-point format, which are hardware, > and you need the same MAXALIGN, which is partly hardware but in principle > could be chosen differently in different ABI conventions for the same > har

Re: [HACKERS] Subscription code improvements

2017-08-16 Thread Peter Eisentraut
On 8/8/17 05:58, Masahiko Sawada wrote: > Are you planning to work on remaining patches 0005 and 0006 that > improve the subscription codes in PG11 cycle? If not, I will take over > them and work on the next CF. Based on your assessment, the remaining patches were not required bug fixes. So I thi

Re: [HACKERS] [BUGS] Replication to Postgres 10 on Windows is broken

2017-08-16 Thread Peter Eisentraut
On 8/16/17 19:41, Michael Paquier wrote: > On Thu, Aug 17, 2017 at 8:13 AM, Tatsuo Ishii wrote: >> Do we allow streaming replication among different OS? > > No. WAL is a binary format. > >> I thought it is >> required that primary and standbys are same platform (in my >> understanding this means

Re: [HACKERS] [BUGS] Replication to Postgres 10 on Windows is broken

2017-08-16 Thread Tom Lane
Michael Paquier writes: > On Thu, Aug 17, 2017 at 8:13 AM, Tatsuo Ishii wrote: >> Do we allow streaming replication among different OS? > No. WAL is a binary format. >> I thought it is >> required that primary and standbys are same platform (in my >> understanding this means the same hardware a

Re: [HACKERS] Re: [COMMITTERS] pgsql: Don't force-assign transaction id when exporting a snapshot.

2017-08-16 Thread Peter Eisentraut
On 8/14/17 13:57, Andres Freund wrote: > On 2017-08-14 13:55:29 -0400, Peter Eisentraut wrote: >> On 8/12/17 07:32, Petr Jelinek wrote: >>> This commit has side effect that it makes it possible to export >>> snapshots on the standbys. This makes it possible to do pg_dump -j on >>> standby with cons

Re: [HACKERS] [BUGS] Replication to Postgres 10 on Windows is broken

2017-08-16 Thread Michael Paquier
On Thu, Aug 17, 2017 at 8:13 AM, Tatsuo Ishii wrote: > Do we allow streaming replication among different OS? No. WAL is a binary format. > I thought it is > required that primary and standbys are same platform (in my > understanding this means the same hardware architecture and OS) in > streamin

Re: [HACKERS] Server crash due to SIGBUS(Bus Error) when trying to access the memory created using dsm_create().

2017-08-16 Thread Thomas Munro
On Thu, Jun 29, 2017 at 12:24 PM, Thomas Munro wrote: > fallocate-v5.patch Added to commitfest so we don't lose track of this. I'm mainly concerned about the fact that we have a way for PostgreSQL to die that looks exactly like a bug, when really it's masking an out-of-memory condition that a DB

Re: [HACKERS] Function to move the position of a replication slot

2017-08-16 Thread Michael Paquier
On Thu, Aug 17, 2017 at 7:14 AM, Tom Lane wrote: > Andres Freund writes: >> On 2017-08-16 17:06:42 -0400, Tom Lane wrote: >>> If I understand what this is meant to do, maybe better >>> pg_move_replication_slot_lsn() or pg_change_replication_slot_lsn() ? >>> The point being that you're adjusting t

Re: [HACKERS] [BUGS] Replication to Postgres 10 on Windows is broken

2017-08-16 Thread Tatsuo Ishii
> Thank you Tom Lane, > This patch fixes the problem. > > With this patch, streaming replication started working (replication to > Windows) > > (Tested for Linux to Windows replication) Do we allow streaming replication among different OS? I thought it is required that primary and standbys are s

Re: [HACKERS] Function to move the position of a replication slot

2017-08-16 Thread Andres Freund
On 2017-08-16 18:14:45 -0400, Tom Lane wrote: > Andres Freund writes: > > On 2017-08-16 17:06:42 -0400, Tom Lane wrote: > >> If I understand what this is meant to do, maybe better > >> pg_move_replication_slot_lsn() or pg_change_replication_slot_lsn() ? > >> The point being that you're adjusting t

Re: [HACKERS] Hash Functions

2017-08-16 Thread Tom Lane
Kenneth Marshall writes: > On Wed, Aug 16, 2017 at 05:58:41PM -0400, Tom Lane wrote: >> ... In fact, on perusing the linked-to page >> http://burtleburtle.net/bob/hash/doobs.html >> Bob says specifically that taking b and c from this hash does not >> produce a fully random 64-bit result. He has a

Re: [HACKERS] Atomics for heap_parallelscan_nextpage()

2017-08-16 Thread Tom Lane
Andres Freund writes: > On August 16, 2017 3:09:27 PM PDT, Tom Lane wrote: >> I wonder whether it's sensible to have --enable-cassert have the effect >> of filling memory allocated by ShmemAlloc or the DSA code with junk (as >> palloc does) instead of leaving it at zeroes. It's not modeling the

Re: [HACKERS] Hash Functions

2017-08-16 Thread Kenneth Marshall
On Wed, Aug 16, 2017 at 05:58:41PM -0400, Tom Lane wrote: > Robert Haas writes: > > Attached is a quick sketch of how this could perhaps be done (ignoring > > for the moment the relatively-boring opclass pushups). It introduces > > a new function hash_any_extended which differs from hash_any() in

Re: [HACKERS] Atomics for heap_parallelscan_nextpage()

2017-08-16 Thread Andres Freund
On August 16, 2017 3:09:27 PM PDT, Tom Lane wrote: >Heikki Linnakangas writes: >> On 08/17/2017 12:20 AM, Tom Lane wrote: >>> Indeed, gaur fails with >>> 2017-08-16 17:09:38.315 EDT [13043:11] PANIC: stuck spinlock >detected at pg_atomic_compare_exchange_u64_impl, atomics.c:196 > >> I was able

Re: [HACKERS] Function to move the position of a replication slot

2017-08-16 Thread Tom Lane
Alvaro Herrera writes: > Andres Freund wrote: >> I think we should constrain the API to only allow later LSNs than >> currently in the slot, rather than arbitrary ones. That's why I was >> thinking of "forward". I'm not convinced it's a good / safe idea to >> allow arbitrary values to be set. >

Re: [HACKERS] Function to move the position of a replication slot

2017-08-16 Thread Alvaro Herrera
Andres Freund wrote: > On 2017-08-16 17:06:42 -0400, Tom Lane wrote: > > If I understand what this is meant to do, maybe better > > pg_move_replication_slot_lsn() or pg_change_replication_slot_lsn() ? > > The point being that you're adjusting the LSN pointer contained > > in the slot, which is dis

Re: [HACKERS] Function to move the position of a replication slot

2017-08-16 Thread Tom Lane
Andres Freund writes: > On 2017-08-16 17:06:42 -0400, Tom Lane wrote: >> If I understand what this is meant to do, maybe better >> pg_move_replication_slot_lsn() or pg_change_replication_slot_lsn() ? >> The point being that you're adjusting the LSN pointer contained >> in the slot, which is distin

Re: [HACKERS] Atomics for heap_parallelscan_nextpage()

2017-08-16 Thread Tom Lane
Heikki Linnakangas writes: > On 08/17/2017 12:20 AM, Tom Lane wrote: >> Indeed, gaur fails with >> 2017-08-16 17:09:38.315 EDT [13043:11] PANIC: stuck spinlock detected at >> pg_atomic_compare_exchange_u64_impl, atomics.c:196 > I was able to reproduce this locally, with --disable-atomics, but o

Re: [HACKERS] Hash Functions

2017-08-16 Thread Tom Lane
Robert Haas writes: > Attached is a quick sketch of how this could perhaps be done (ignoring > for the moment the relatively-boring opclass pushups). It introduces > a new function hash_any_extended which differs from hash_any() in that > (a) it combines both b and c into the result and (b) it ac

Re: [HACKERS] Function to move the position of a replication slot

2017-08-16 Thread Andres Freund
On 2017-08-16 17:06:42 -0400, Tom Lane wrote: > Andres Freund writes: > > On 2017-08-16 12:24:11 -0400, Peter Eisentraut wrote: > >> On 5/4/17 08:05, Magnus Hagander wrote: > >>> PFA a patch that adds a new function, pg_move_replication_slot, that > >>> makes it possible to move the location of a

Re: [HACKERS] Atomics for heap_parallelscan_nextpage()

2017-08-16 Thread Heikki Linnakangas
On 08/17/2017 12:20 AM, Tom Lane wrote: Andres Freund writes: On 2017-08-16 16:20:28 +0300, Heikki Linnakangas wrote: + pg_atomic_write_u64(&target->phs_nallocated, 0); It's not ok to initialize an atomic with pg_atomic_write_u64 - works well enough for "plain" atomics, but the fallbac

Re: [HACKERS] Hash Functions

2017-08-16 Thread Robert Haas
On Wed, Aug 16, 2017 at 12:38 PM, Tom Lane wrote: > Robert Haas writes: >> After some further thought, I propose the following approach to the >> issues raised on this thread: > >> 1. Allow hash functions to have a second, optional support function, >> similar to what we did for btree opclasses i

Re: [HACKERS] taking stdbool.h into use

2017-08-16 Thread Tom Lane
I wrote: > gaur/pademelon isn't booted up right now, but it might provide > an example of a system that lacks altogether. > (If it doesn't, I'd be willing to concede that we need not > consider that scenario anymore.) For the record --- pademelon (vendor cc on that box) doesn't have at all. gau

Re: [HACKERS] Atomics for heap_parallelscan_nextpage()

2017-08-16 Thread Tom Lane
Andres Freund writes: > On 2017-08-16 16:20:28 +0300, Heikki Linnakangas wrote: > + pg_atomic_write_u64(&target->phs_nallocated, 0); > It's not ok to initialize an atomic with pg_atomic_write_u64 - works > well enough for "plain" atomics, but the fallback implementation isn't > ok with it. Yo

Re: [HACKERS] Function to move the position of a replication slot

2017-08-16 Thread Tom Lane
Andres Freund writes: > On 2017-08-16 12:24:11 -0400, Peter Eisentraut wrote: >> On 5/4/17 08:05, Magnus Hagander wrote: >>> PFA a patch that adds a new function, pg_move_replication_slot, that >>> makes it possible to move the location of a replication slot without >>> actually consuming all the

Re: [HACKERS] Extra Vietnamese unaccent rules

2017-08-16 Thread Tom Lane
Dang Minh Huong writes: > On 2017/07/05 15:28, Michael Paquier wrote: >> (Surprised to see that generate_unaccent_rules.py is inconsistent on >> MacOS, runs fine on Linux). FWIW, I got identical results from running the script on current macOS (Sierra) and Linux (RHEL6). >> Testing with characte

Re: [HACKERS] Function to move the position of a replication slot

2017-08-16 Thread Andres Freund
On 2017-08-16 12:24:11 -0400, Peter Eisentraut wrote: > On 5/4/17 08:05, Magnus Hagander wrote: > > PFA a patch that adds a new function, pg_move_replication_slot, that > > makes it possible to move the location of a replication slot without > > actually consuming all the WAL on it. > > The name k

Re: [HACKERS] Garbled comment in postgresGetForeignJoinPaths

2017-08-16 Thread Tom Lane
Robert Haas writes: > On Wed, Aug 16, 2017 at 3:44 PM, Tom Lane wrote: >> Will you fix it, or shall I? > Whichever you like. It's your commit, you can do the honors. regards, tom lane -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make chang

Re: [HACKERS] Garbled comment in postgresGetForeignJoinPaths

2017-08-16 Thread Robert Haas
On Wed, Aug 16, 2017 at 3:44 PM, Tom Lane wrote: > Robert Haas writes: >> On Wed, Aug 16, 2017 at 3:02 PM, Robert Haas wrote: >>> On Wed, Aug 16, 2017 at 2:16 PM, Tom Lane wrote: The current text of the comment dates to commit 177c56d60, and looking at that commit makes it pretty clea

Re: [HACKERS] Garbled comment in postgresGetForeignJoinPaths

2017-08-16 Thread Tom Lane
Robert Haas writes: > On Wed, Aug 16, 2017 at 3:02 PM, Robert Haas wrote: >> On Wed, Aug 16, 2017 at 2:16 PM, Tom Lane wrote: >>> The current text of the comment dates to commit 177c56d60, and looking at >>> that commit makes it pretty clear that the line I'm complaining of >>> belonged to the p

Re: [HACKERS] Atomics for heap_parallelscan_nextpage()

2017-08-16 Thread Tom Lane
Heikki Linnakangas writes: > On 08/16/2017 09:00 PM, Tom Lane wrote: >> I don't buy that argument. A caller might think "Why do I need >> shm_toc_estimate, when I can compute the *exact* size I need?". >> And it would have worked, up till this proposed patch. > Well, no. The size of the shm_toc

Re: [HACKERS] distinct estimate of a hard-coded VALUES list

2017-08-16 Thread Tom Lane
Jeff Janes writes: > This patch still applies, and I think the argument for it is still valid. > So I'm going to make a commit-fest entry for it. Is there additional > evidence we should gather? I think we had consensus to apply this at the start of the next development cycle; I just forgot to d

Re: [HACKERS] Atomics for heap_parallelscan_nextpage()

2017-08-16 Thread Andres Freund
On 2017-08-16 16:20:28 +0300, Heikki Linnakangas wrote: > On 05/06/2017 04:57 PM, David Rowley wrote: > > Andres mentioned in [2] that it might be worth exploring using atomics > > to do the same job. So I went ahead and did that, and came up with the > > attached, which is a slight variation on wh

Re: [HACKERS] Atomics for heap_parallelscan_nextpage()

2017-08-16 Thread Andres Freund
On 2017-08-16 14:09:08 -0400, Tom Lane wrote: > >> I'm not sure that that's good enough, and I'm damn sure that it > >> shouldn't be undocumented. > > > 8 byte alignment would be good enough, so BUFFERALIGN ought to be > > sufficient. But it'd be nicer to have a separate more descriptive knob. >

Re: [HACKERS] Garbled comment in postgresGetForeignJoinPaths

2017-08-16 Thread Robert Haas
On Wed, Aug 16, 2017 at 3:02 PM, Robert Haas wrote: > On Wed, Aug 16, 2017 at 2:16 PM, Tom Lane wrote: >> Robert Haas writes: >>> On Wed, Aug 16, 2017 at 12:31 PM, Tom Lane wrote: --> * reconstruct the row for EvalPlanQual(). Find an alternative local path Should the marked lin

Re: [HACKERS] Garbled comment in postgresGetForeignJoinPaths

2017-08-16 Thread Robert Haas
On Wed, Aug 16, 2017 at 2:16 PM, Tom Lane wrote: > Robert Haas writes: >> On Wed, Aug 16, 2017 at 12:31 PM, Tom Lane wrote: >>> --> * reconstruct the row for EvalPlanQual(). Find an alternative local >>> path >>> Should the marked line simply be deleted? If not, what correction is >>> appropr

Re: [HACKERS] Atomics for heap_parallelscan_nextpage()

2017-08-16 Thread Heikki Linnakangas
On 08/16/2017 09:00 PM, Tom Lane wrote: Robert Haas writes: On Wed, Aug 16, 2017 at 1:44 PM, Tom Lane wrote: I was feeling a bit uncomfortable with the BUFFERALIGN_DOWN() for a different reason: if the caller has specified the exact amount of space it needs, having shm_toc_create discard some

Re: [HACKERS] Broken link to DocBook XSL Stylesheets

2017-08-16 Thread Peter Eisentraut
On 6/20/17 22:20, Masahiko Sawada wrote: > Hi, > > In J.2. Tool Sets section of documentation, there is a link to DocBook > XSL Stylesheets but that link seems no longer available. I got 404 > error. > > J.2. Tool Sets > > > A

Re: [HACKERS] Logical replication: stuck spinlock at ReplicationSlotRelease

2017-08-16 Thread Peter Eisentraut
On 6/23/17 20:58, Peter Eisentraut wrote: > On 6/23/17 16:15, Andres Freund wrote: >> On 2017-06-23 13:26:58 -0400, Alvaro Herrera wrote: >>> Hmm, so for instance in LogicalIncreaseRestartDecodingForSlot() we have >>> some elog(DEBUG1) calls with the slot spinlock held. That's probably >>> uncool.

Re: [HACKERS] Garbled comment in postgresGetForeignJoinPaths

2017-08-16 Thread Tom Lane
Robert Haas writes: > On Wed, Aug 16, 2017 at 12:31 PM, Tom Lane wrote: >> --> * reconstruct the row for EvalPlanQual(). Find an alternative local path >> Should the marked line simply be deleted? If not, what correction is >> appropriate? > Hmm, wow. My first thought was that it should just

Re: [HACKERS] Atomics for heap_parallelscan_nextpage()

2017-08-16 Thread Tom Lane
Andres Freund writes: > On 2017-08-16 13:40:09 -0400, Tom Lane wrote: >> I was wondering why the shm_toc code was using BUFFERALIGN and not >> MAXALIGN, and I now suspect that the answer is "it's an entirely >> undocumented kluge to make the atomics code not crash on 32-bit >> machines, so long as

Re: [HACKERS] 10 beta docs: different replication solutions

2017-08-16 Thread Peter Eisentraut
On 7/30/17 21:34, Steve Singer wrote: > We don't seem to describe logical replication on > > https://www.postgresql.org/docs/10/static/different-replication-solutions.html > > The attached patch adds a section. Committed with some further tweaking, thanks! -- Peter Eisentraut http

Re: [HACKERS] Atomics for heap_parallelscan_nextpage()

2017-08-16 Thread Tom Lane
Robert Haas writes: > On Wed, Aug 16, 2017 at 1:44 PM, Tom Lane wrote: >> I was feeling a bit uncomfortable with the BUFFERALIGN_DOWN() for a >> different reason: if the caller has specified the exact amount of space it >> needs, having shm_toc_create discard some could lead to an unexpected >> f

Re: [HACKERS] Atomics for heap_parallelscan_nextpage()

2017-08-16 Thread Andres Freund
On August 16, 2017 10:47:23 AM PDT, Robert Haas wrote: >On Wed, Aug 16, 2017 at 1:40 PM, Tom Lane wrote: >> I was wondering why the shm_toc code was using BUFFERALIGN and not >> MAXALIGN, and I now suspect that the answer is "it's an entirely >> undocumented kluge to make the atomics code not c

Re: [HACKERS] Atomics for heap_parallelscan_nextpage()

2017-08-16 Thread Robert Haas
On Wed, Aug 16, 2017 at 1:44 PM, Tom Lane wrote: > I was feeling a bit uncomfortable with the BUFFERALIGN_DOWN() for a > different reason: if the caller has specified the exact amount of space it > needs, having shm_toc_create discard some could lead to an unexpected > failure. Well, that's why H

Re: [HACKERS] Atomics for heap_parallelscan_nextpage()

2017-08-16 Thread Andres Freund
On 2017-08-16 13:44:28 -0400, Tom Lane wrote: > Andres Freund writes: > > Don't think we require BUFFERALIGN - MAXALIGN ought to be > > sufficient. > > Uh, see my other message just now. Yup, you're right. > > The use of BUFFERALIGN presumably is to space out things > > into different cachelin

Re: [HACKERS] Atomics for heap_parallelscan_nextpage()

2017-08-16 Thread Robert Haas
On Wed, Aug 16, 2017 at 1:40 PM, Tom Lane wrote: > I was wondering why the shm_toc code was using BUFFERALIGN and not > MAXALIGN, and I now suspect that the answer is "it's an entirely > undocumented kluge to make the atomics code not crash on 32-bit > machines, so long as nobody puts a pg_atomic_

Re: [HACKERS] Atomics for heap_parallelscan_nextpage()

2017-08-16 Thread Andres Freund
On 2017-08-16 13:40:09 -0400, Tom Lane wrote: > I wrote: > > I can confirm that on dromedary, that regression test case is attempting > > to create a TOC with a not-well-aligned size: 93268 = 0x16c54 bytes. > > ... although, on closer look, it still seems like we have a fundamental > bit of schizo

Re: [HACKERS] Atomics for heap_parallelscan_nextpage()

2017-08-16 Thread Tom Lane
Andres Freund writes: > Don't think we require BUFFERALIGN - MAXALIGN ought to be > sufficient. Uh, see my other message just now. > The use of BUFFERALIGN presumably is to space out things > into different cachelines, but that doesn't really seem to be important > with this. Then we can just a

Re: [HACKERS] Atomics for heap_parallelscan_nextpage()

2017-08-16 Thread Tom Lane
I wrote: > I can confirm that on dromedary, that regression test case is attempting > to create a TOC with a not-well-aligned size: 93268 = 0x16c54 bytes. ... although, on closer look, it still seems like we have a fundamental bit of schizophrenia here, because on this machine $ grep ALIGN pg_con

Re: [HACKERS] Atomics for heap_parallelscan_nextpage()

2017-08-16 Thread Tom Lane
Heikki Linnakangas writes: > On 08/16/2017 08:10 PM, Andres Freund wrote: >> Seems like we'd just have to add alignment of the total size to >> shm_toc_estimate()? > Yeah, that's the gist of it. I can confirm that on dromedary, that regression test case is attempting to create a TOC with a not-w

Re: [HACKERS] Atomics for heap_parallelscan_nextpage()

2017-08-16 Thread Andres Freund
Hi, On 2017-08-16 20:19:29 +0300, Heikki Linnakangas wrote: > diff --git a/src/backend/storage/ipc/shm_toc.c > b/src/backend/storage/ipc/shm_toc.c > index 9f259441f0..121d5a1ec9 100644 > --- a/src/backend/storage/ipc/shm_toc.c > +++ b/src/backend/storage/ipc/shm_toc.c > @@ -44,7 +44,7 @@ shm_toc_

Re: [HACKERS] Atomics for heap_parallelscan_nextpage()

2017-08-16 Thread Robert Haas
On Wed, Aug 16, 2017 at 1:19 PM, Heikki Linnakangas wrote: > Yeah, that's the gist of it. > > The attached patch seems to fix this. I'm not too familiar with this DSM > stuff, but this seems right to me. Unless someone has a better idea soon, > I'll commit this to make the buildfarm happy. Mmm, c

Re: [HACKERS] Garbled comment in postgresGetForeignJoinPaths

2017-08-16 Thread Robert Haas
On Wed, Aug 16, 2017 at 12:31 PM, Tom Lane wrote: > postgres_fdw.c around line 4500: > > /* > * If there is a possibility that EvalPlanQual will be executed, we need > * to be able to reconstruct the row using scans of the base relations. > * GetExistingLocalJoinPath will find a

Re: [HACKERS] Atomics for heap_parallelscan_nextpage()

2017-08-16 Thread Heikki Linnakangas
On 08/16/2017 08:10 PM, Andres Freund wrote: Afaict shm_create/shm_toc_allocate don't actually guarantee that the end of the toc's memory is suitably aligned. But I didn't yet have any coffee, so ... Robert, I'm not quite sure what the intended behaviour of shm_toc is wrt alignment. I see that

Re: [HACKERS] Hash Functions

2017-08-16 Thread Robert Haas
On Wed, Aug 16, 2017 at 12:38 PM, Tom Lane wrote: > Robert Haas writes: >> After some further thought, I propose the following approach to the >> issues raised on this thread: > >> 1. Allow hash functions to have a second, optional support function, >> similar to what we did for btree opclasses i

Re: [HACKERS] Orphaned files in base/[oid]

2017-08-16 Thread Andres Freund
On 2017-08-16 14:20:02 +0200, Chris Travers wrote: > So having throught about this a bit more, and having had some real-world > experience with the script now, I have an idea that might work and some > questions to make it succeed. > > My thinking is to add a new form of vacuum called VACUUM FSCK.

Re: [HACKERS] Atomics for heap_parallelscan_nextpage()

2017-08-16 Thread Andres Freund
On 2017-08-16 09:57:35 -0700, Peter Geoghegan wrote: > On Wed, Aug 16, 2017 at 9:55 AM, Andres Freund wrote: > > On 2017-08-16 11:16:58 -0400, Tom Lane wrote: > >> Heikki Linnakangas writes: > >> > A couple of 32-bit x86 buildfarm members don't seem to be happy with > >> > this. I'll investigate,

Re: [HACKERS] Atomics for heap_parallelscan_nextpage()

2017-08-16 Thread Andres Freund
Robert, Tom, On 2017-08-16 09:55:15 -0700, Andres Freund wrote: > > Not sure if this is your bug or if it's exposing a pre-existing > > deficiency in the atomics code, viz, failure to ensure that > > pg_atomic_uint64 is actually a 64-bit-aligned type. Andres? > I suspect it's the former. Suspe

Re: [HACKERS] [COMMITTERS] pgsql: Simplify plpgsql's check for simple expressions.

2017-08-16 Thread Tom Lane
Robert Haas writes: > You want to push something, or should I do it? Go for it. regards, tom lane -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers

Re: [HACKERS] Atomics for heap_parallelscan_nextpage()

2017-08-16 Thread Peter Geoghegan
On Wed, Aug 16, 2017 at 9:55 AM, Andres Freund wrote: > On 2017-08-16 11:16:58 -0400, Tom Lane wrote: >> Heikki Linnakangas writes: >> > A couple of 32-bit x86 buildfarm members don't seem to be happy with >> > this. I'll investigate, but if anyone has a clue, I'm all ears... >> >> dromedary's is

Re: [HACKERS] Atomics for heap_parallelscan_nextpage()

2017-08-16 Thread Andres Freund
On 2017-08-16 11:16:58 -0400, Tom Lane wrote: > Heikki Linnakangas writes: > > A couple of 32-bit x86 buildfarm members don't seem to be happy with > > this. I'll investigate, but if anyone has a clue, I'm all ears... > > dromedary's issue seems to be alignment: > > TRAP: UnalignedPointer("(((u

Re: [HACKERS] [COMMITTERS] pgsql: Simplify plpgsql's check for simple expressions.

2017-08-16 Thread Robert Haas
On Wed, Aug 16, 2017 at 12:49 PM, Tom Lane wrote: > Robert Haas writes: >> On Wed, Aug 16, 2017 at 11:56 AM, Tom Lane wrote: >>> I can get on board with that statement. Can you draft a better wording? > >> Here is an attempt. Feel free to edit. > > I think s/plan/query/ in the last bit would b

Re: [HACKERS] [COMMITTERS] pgsql: Simplify plpgsql's check for simple expressions.

2017-08-16 Thread Tom Lane
Robert Haas writes: > On Wed, Aug 16, 2017 at 11:56 AM, Tom Lane wrote: >> I can get on board with that statement. Can you draft a better wording? > Here is an attempt. Feel free to edit. I think s/plan/query/ in the last bit would be better. Perhaps +* However, if force_parallel_mo

  1   2   >