Re: Commit 4dba331cb3 broke ATTACH PARTITION behaviour.

2018-03-30 Thread Kyotaro HORIGUCHI
At Thu, 29 Mar 2018 13:04:06 -0300, Alvaro Herrera wrote in <20180329160406.ii2wgbkmlnfxtwbt@alvherre.pgsql> > Rushabh Lathia wrote: > > On Thu, Mar 29, 2018 at 7:46 PM, Alvaro Herrera > > wrote: > > > > Hmm, offhand I don't quite see why this

Re: Feature Request - DDL deployment with logical replication

2018-03-30 Thread Chris Travers
On Fri, Mar 30, 2018 at 9:26 AM, Konstantin Knizhnik < k.knizh...@postgrespro.ru> wrote: > > > Our team in PostgresPro is also very interested in this discussion, > because we are using logical decoding in multimaster. > Right now in multimaster DDLs are replicated in this same way as in >

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

2018-03-30 Thread Nikhil Sontakke
Hi Petr, Andres and Tomas >>> Thanks. I think the README is a good start, but I think we also need to >>> improve the comments, which is usually more detailed than the README. >>> For example, it's not quite acceptable that LogicalLockTransaction and >>> LogicalUnlockTransaction have about no

Re: JIT compiling with LLVM v12.2

2018-03-30 Thread Konstantin Knizhnik
On 30.03.2018 02:14, Andres Freund wrote: Hi, On 2018-03-29 19:57:42 +0700, John Naylor wrote: Hi Andres, I spent some time over pouring over the JIT README, and I've attached a patch with some additional corrections as well as some stylistic suggestions. The latter may be debatable, but I'm

Re: pgbench doc typos

2018-03-30 Thread Fabien COELHO
Hello Edmund, Thanks for the check. You might consider turning the patch as ready in the cf app. Fixing the abs/hash bracketing seems clear. The wasn't sure about rewriting "mod(i, bj)" as "mod(i, j)", because there could be some convention about parameter names, but I can't think of

Typo in xlog.c

2018-03-30 Thread Michael Paquier
Hi all, I just bumped into the attached. Thanks, -- Michael diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.c index cb9c2a29cb..0bca449eac 100644 --- a/src/backend/access/transam/xlog.c +++ b/src/backend/access/transam/xlog.c @@ -2157,7 +2157,7 @@

Re: csv format for psql

2018-03-30 Thread Pavel Stehule
2018-03-30 0:15 GMT+02:00 David G. Johnston : > On Thu, Mar 29, 2018 at 7:30 AM, Daniel Verite > wrote: > >> Personally I think the benefit of sharing fieldsep is not worth these >> problems, but I'm waiting for the discussion to continue with

Re: Changing WAL Header to reduce contention during ReserveXLogInsertLocation()

2018-03-30 Thread Simon Riggs
On 29 March 2018 at 23:16, Tomas Vondra wrote: > > > On 03/29/2018 11:18 PM, Tom Lane wrote: >> Tomas Vondra writes: >>> If each WAL record has xl_curr, then we know to which position the >>> record belongs (after verifying the

Re: Typo in xlog.c

2018-03-30 Thread Magnus Hagander
On Fri, Mar 30, 2018 at 10:01 AM, Michael Paquier wrote: > Hi all, > > I just bumped into the attached. > Thanks, applied. -- Magnus Hagander Me: https://www.hagander.net/ Work: https://www.redpill-linpro.com/

Re: [HACKERS] path toward faster partition pruning

2018-03-30 Thread David Rowley
On 30 March 2018 at 18:38, Amit Langote wrote: > Please find attached the updated patches. Thanks. I've noticed that there are no outfuncs or readfuncs for all the new Step types you've added. Also, the copy func does not properly copy the step_id in the base

Re: Commit 4dba331cb3 broke ATTACH PARTITION behaviour.

2018-03-30 Thread Amit Langote
On 2018/03/30 17:31, Kyotaro HORIGUCHI wrote: > At Thu, 29 Mar 2018 13:04:06 -0300, Alvaro Herrera wrote: >> Rushabh Lathia wrote: >>> On Thu, Mar 29, 2018 at 7:46 PM, Alvaro Herrera >>> wrote: >> Hmm, offhand I don't quite see why this error fails to be thrown. >>>

Re: [HACKERS] MERGE SQL Statement for PG11

2018-03-30 Thread Simon Riggs
On 29 March 2018 at 10:50, Simon Riggs wrote: > On 28 March 2018 at 12:00, Pavan Deolasee wrote: > >> v27 attached, though review changes are in >> the add-on 0005 patch. > > This all looks good now, thanks for making all of those changes. > > I

Re: [HACKERS] GSoC 2017: weekly progress reports (week 6)

2018-03-30 Thread Teodor Sigaev
Thanks for everyone, pushed Oh, right, that makes sense. I'm not sure that the comments explain this sufficiently -- I think it'd be good to expand that. I improved comments Given this patch, it seems clear that serializable mode is much worse with fastupdate than without it! That's true.

Re: Feature Request - DDL deployment with logical replication

2018-03-30 Thread Konstantin Knizhnik
On 29.03.2018 20:21, Jeremy Finzel wrote: Hello! I have not seen much discussion about what the plans are for being able to manage schema changes when using logical replication.  In our own infrastructure, mechanisms that have been provided to manage DDL statements at the same

pg_ugprade test failure on data set with column with default value with type bit/varbit

2018-03-30 Thread Paul Guo
Hello, While testing pg_upgrade we seemed to find an issue related to default value of a column with type bit/varbit. Below are the steps to reproduce. In this case we added two 'create table' DDLs in the regression database. Obviously we saw diff after pg_upgrade testing. The pg binaries are

Re: Additional Statistics Hooks

2018-03-30 Thread Ashutosh Bapat
On Thu, Mar 15, 2018 at 7:59 PM, Tomas Vondra wrote: > > > On 03/15/2018 06:00 AM, Ashutosh Bapat wrote: >> On Tue, Mar 13, 2018 at 8:55 PM, Mat Arye wrote: Like cost associated with a function, we may associate mapping cardinality

Re: Cast jsonb to numeric, int, float, bool

2018-03-30 Thread Aleksander Alekseev
Hello Robert, > I would like to complain about this patch. First, I think that it > would've been a better idea to use functions for this rather than > operators, because now ::text does something totally unlike what ::int > does, and that's confusing. This is not entirely accurate. ::text

Re: pgbench doc typos

2018-03-30 Thread Edmund Horner
On 30 March 2018 at 19:26, Fabien COELHO wrote: > Thanks for the check. You might consider turning the patch as ready in the > cf app. Ok, I have done so, since the patch is small and simple. >> Fixing the abs/hash bracketing seems clear. The wasn't sure about >> rewriting

Re: [HACKERS] Moving relation extension locks out of heavyweight lock manager

2018-03-30 Thread Michael Paquier
On Thu, Mar 01, 2018 at 04:01:28PM -0500, Robert Haas wrote: > If you have a clever idea how to make this work with as few atomic > operations as the current patch uses while at the same time reducing > the possibility of contention, I'm all ears. But I don't see how to > do that. This thread

Re: [PATCH] Verify Checksums during Basebackups

2018-03-30 Thread Magnus Hagander
On Fri, Mar 30, 2018 at 5:35 AM, David Steele wrote: > On 3/24/18 10:32 AM, Michael Banck wrote: > > Am Freitag, den 23.03.2018, 17:43 +0100 schrieb Michael Banck: > >> Am Freitag, den 23.03.2018, 10:54 -0400 schrieb David Steele: > >>> In my experience actual block errors

Re: [PATCH] Verify Checksums during Basebackups

2018-03-30 Thread Stephen Frost
Greetings, * Magnus Hagander (mag...@hagander.net) wrote: > On Fri, Mar 30, 2018 at 5:35 AM, David Steele wrote: > > > On 3/24/18 10:32 AM, Michael Banck wrote: > > > Am Freitag, den 23.03.2018, 17:43 +0100 schrieb Michael Banck: > > >> Am Freitag, den 23.03.2018, 10:54

Re: faster testing with symlink installs

2018-03-30 Thread Michael Paquier
On Thu, Mar 22, 2018 at 11:07:48AM -0400, Robert Haas wrote: > I suppose we could provide a build-time option to change this behavior. it seems to me that it is going to be hard to reach a consensus by the end of the commit fest, so I am marking this patch as returned with feedback. Not sure if

Re: Cast jsonb to numeric, int, float, bool

2018-03-30 Thread Teodor Sigaev
I would like to complain about this patch. First, I think that it would've been a better idea to use functions for this rather than operators, because now ::text does something totally unlike what ::int does, and that's confusing. If we had json_to_WHATEVER for various values of WHATEVER then

Re: Cast jsonb to numeric, int, float, bool

2018-03-30 Thread Aleksander Alekseev
Hello Teodor, > > Agree, something like "could not convert jsonb value to boolean type. jsonb > > value must be scalar boolean type"? > > I checked what error messages are used currently: > > ``` > # select 123::int4::jsonb; > ERROR: cannot cast type integer to jsonb > LINE 1: select

Re: JIT compiling with LLVM v12.2

2018-03-30 Thread Andres Freund
On 2018-03-30 15:12:05 +0300, Konstantin Knizhnik wrote: > I have repeated performance tests at my computer and find out some > regression comparing with previous JIT version. > Previously JIT provides about 2 times improvement at TPC-H Q1. Now the > difference is reduced to 1.4 without parallel

Re: [HACKERS] path toward faster partition pruning

2018-03-30 Thread David Rowley
On 31 March 2018 at 01:18, David Rowley wrote: > I've noticed that there are no outfuncs or readfuncs for all the new > Step types you've added. > > Also, the copy func does not properly copy the step_id in the base > node type. This will remain at 0 after a

Re: [HACKERS] Add support for tuple routing to foreign partitions

2018-03-30 Thread Alvaro Herrera
Etsuro Fujita wrote: > Now we have ON CONFLICT for partitioned tables, which requires the > conversion map to be computed in ExecInitPartitionInfo, so I updated the > patch so that we keep the former step in ExecInitPartitionInfo and > ExecSetupPartitionTupleRouting and so that we just init the

Re: [HACKERS] Add support for tuple routing to foreign partitions

2018-03-30 Thread Etsuro Fujita
(2018/03/23 20:55), Etsuro Fujita wrote: (2018/03/23 4:09), Robert Haas wrote: 1. It still doesn't work for COPY, because COPY isn't going to have a ModifyTableState. I really think it ought to be possible to come up with an API that can handle both INSERT and COPY; I don't think it should be

Re: [HACKERS] Add support for tuple routing to foreign partitions

2018-03-30 Thread Etsuro Fujita
(2018/03/20 21:31), Alvaro Herrera wrote: Amit Langote wrote: 2. If I understand the description you provided in [1] correctly, the point of having ri_PartitionIsValid and ExecInitExtraPartitionInfo() is to avoid possibly-redundantly performing following two steps in

Re: [HACKERS] Add support for tuple routing to foreign partitions

2018-03-30 Thread Etsuro Fujita
(2018/03/19 20:25), Amit Langote wrote: On 2018/02/27 21:01, Etsuro Fujita wrote: Attached is a new version of the patch set. * Comments postgres-fdw-refactoring-1.patch: 1. Just a minor nitpick: wouldn't it be better to call it create_foreign_modify_state just like its "finish" counterpart

Re: [HACKERS] path toward faster partition pruning

2018-03-30 Thread Alvaro Herrera
David Rowley wrote: > Also, the copy func does not properly copy the step_id in the base > node type. This will remain at 0 after a copyObject() As I recall, you can find these mistakes by compiling with -DCOPY_PARSE_PLAN_TREES. -- Álvaro Herrerahttps://www.2ndQuadrant.com/

Re: [HACKERS] GSoC 2017: weekly progress reports (week 6)

2018-03-30 Thread Tom Lane
I wrote: > prion doesn't like this patch, which probably means that something is > trying to use the content of a relcache entry after having closed it. Oh, sorry, scratch that --- looking closer, it was failing before this. regards, tom lane

[HACKERS][PATCH] adding simple sock check for windows

2018-03-30 Thread CharSyam
Hi, I found some missing check for windows int init_slot function in vacuumdb.c in windows SOCKET is unsigned type. so slot->sock < 0 never can be under 0. so this patch just check using slot->sock == PGINVALID_SOCKET Thanks. simple_check.patch Description: Binary data

libpq compression

2018-03-30 Thread Konstantin Knizhnik
Hi hackers, One of our customers was managed to improve speed about 10 times by using SSL compression for the system where client and servers are located in different geographical regions and query results are very large because of JSON columns. Them actually do not need encryption, just

Re: [HACKERS] GSoC 2017: weekly progress reports (week 6)

2018-03-30 Thread Tom Lane
Teodor Sigaev writes: > Thanks for everyone, pushed prion doesn't like this patch, which probably means that something is trying to use the content of a relcache entry after having closed it. regards, tom lane

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

2018-03-30 Thread Ashutosh Bapat
Thanks for your review comments. They are helpful. On Thu, Mar 29, 2018 at 2:53 AM, Dmitry Dolgov <9erthali...@gmail.com> wrote: > But actually you also mentioned > another topic that bothers me about this patch. Different parts of the > algorithm implementation (at least for functions that

Re: Cast jsonb to numeric, int, float, bool

2018-03-30 Thread Aleksander Alekseev
Hello Teodor, > For completeness it's possible to add direct cast from numeric/boolean types > to jsonb. Then such casts will be mutual. +1. I see no reason why we can't have int4 -> jsonb or bool -> jsonb casts. > Agree, something like "could not convert jsonb value to boolean type. jsonb >

Re: Flexible configuration for full-text search

2018-03-30 Thread Aleksander Alekseev
The following review has been posted through the commitfest application: make installcheck-world: tested, passed Implements feature: tested, passed Spec compliant: tested, passed Documentation:tested, passed LGTM. The new status of this patch is: Ready for Committer

Re: Typo in xlog.c

2018-03-30 Thread Michael Paquier
On Fri, Mar 30, 2018 at 12:35:45PM +0200, Magnus Hagander wrote: > Thanks, applied. Thanks, Magnus. -- Michael signature.asc Description: PGP signature

Re: [HACKERS] path toward faster partition pruning

2018-03-30 Thread David Rowley
On 31 March 2018 at 02:00, David Rowley wrote: > On 31 March 2018 at 01:18, David Rowley wrote: >> I've noticed that there are no outfuncs or readfuncs for all the new >> Step types you've added. >> >> Also, the copy func does not

Re: [HACKERS] [PATCH] Lockable views

2018-03-30 Thread Tom Lane
Tatsuo Ishii writes: > I have just pushed the v10 patch. The buildfarm is fairly unhappy, and I think it's because of this patch. regards, tom lane

Re: Feature Request - DDL deployment with logical replication

2018-03-30 Thread David Fetter
On Fri, Mar 30, 2018 at 09:38:44AM +0200, Chris Travers wrote: > On Fri, Mar 30, 2018 at 9:26 AM, Konstantin Knizhnik < > k.knizh...@postgrespro.ru> wrote: > > > Our team in PostgresPro is also very interested in this discussion, > > because we are using logical decoding in multimaster. > > Right

Re: Feature Request - DDL deployment with logical replication

2018-03-30 Thread Peter Eisentraut
On 3/29/18 13:21, Jeremy Finzel wrote: > Although we are thrilled with some of the features already in logical > replication, this missing feature is the #1 reason that we don't plan to > take a serious look at built-in logical replication even for pg11, > because we have been able to use

Re: pgsql: Rewrite the code that applies scan/join targets to paths.

2018-03-30 Thread Robert Haas
On Fri, Mar 30, 2018 at 1:03 AM, Andres Freund wrote: > Not 100% sure it's this patch, but if not, it's also one of the ones you > committed ;) Looks like it. > There's a valgrind complaint: >

Re: JIT compiling with LLVM v12.2

2018-03-30 Thread Andres Freund
On March 30, 2018 10:04:25 AM PDT, Konstantin Knizhnik wrote: > > >On 30.03.2018 18:54, Andres Freund wrote: >> On 2018-03-30 15:12:05 +0300, Konstantin Knizhnik wrote: >>> I have repeated performance tests at my computer and find out some >>> regression comparing

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

2018-03-30 Thread Andres Freund
On March 30, 2018 10:27:18 AM PDT, Petr Jelinek wrote: >. Locking >around plugin callbacks can hold he lock for longer periods of time >since plugins usually end up writing to network. I think for most >use-cases of 2PC decoding the latter is more useful as plugin

Re: [HACKERS] AdvanceXLInsertBuffer vs. WAL segment compressibility

2018-03-30 Thread Tom Lane
Chapman Flack writes: > On 03/27/18 22:10, Michael Paquier wrote: >> Here you go for one example: >> https://sourceforge.net/projects/pglesslog/ > In any case, from my study of the commit, it is hard for me to see an issue. > The code comment says: "mark the header to

Re: Online enabling of checksums

2018-03-30 Thread Tomas Vondra
Hi, I've just noticed the patch does not update src/backend/storage/page/README which is in fact about checksums. Most of it remains valid, but it also mentions that currently it's an initdb-time choice. regards -- Tomas Vondra http://www.2ndQuadrant.com PostgreSQL

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

2018-03-30 Thread Andres Freund
Hi, On 2018-03-30 23:49:43 +0530, Nikhil Sontakke wrote: > > Quick thought: Should be simple to release lock when interacting with > > network. > > I don’t think this will be that simple. The network calls will > typically happen from inside the plugins and we don’t want to make > plugin

Re: [HACKERS] Planning counters in pg_stat_statements

2018-03-30 Thread Lukas Fittl
On Tue, Jan 23, 2018 at 3:31 PM, Tom Lane wrote: > > > Unfortunately I'm not going to have bandwidth to figure this out > > during this commitfest due to other priorities so I'm going to call > > this "returned with feedback". > > OK. There's still time to get it done in the

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

2018-03-30 Thread Petr Jelinek
On 30/03/18 20:50, Andres Freund wrote: > Hi, > > On 2018-03-30 23:49:43 +0530, Nikhil Sontakke wrote: >>> Quick thought: Should be simple to release lock when interacting with >>> network. >> >> I don’t think this will be that simple. The network calls will >> typically happen from inside the

Re: Feature Request - DDL deployment with logical replication

2018-03-30 Thread Jeremy Finzel
On Fri, Mar 30, 2018 at 10:16 AM, Peter Eisentraut < peter.eisentr...@2ndquadrant.com> wrote: > On 3/29/18 13:21, Jeremy Finzel wrote: > > Although we are thrilled with some of the features already in logical > > replication, this missing feature is the #1 reason that we don't plan to > > take a

BRIN FSM vacuuming questions

2018-03-30 Thread Tom Lane
I noticed that several places in brin_pageops.c do this sort of thing: if (extended) { Assert(BlockNumberIsValid(newblk)); RecordPageWithFreeSpace(idxrel, newblk, freespace); FreeSpaceMapVacuum(idxrel); } ie they put *one* page into the

Re: JIT compiling with LLVM v12.2

2018-03-30 Thread Konstantin Knizhnik
On 30.03.2018 18:54, Andres Freund wrote: On 2018-03-30 15:12:05 +0300, Konstantin Knizhnik wrote: I have repeated performance tests at my computer and find out some regression comparing with previous JIT version. Previously JIT provides about 2 times improvement at TPC-H Q1. Now the

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

2018-03-30 Thread Petr Jelinek
On 30/03/18 09:56, Nikhil Sontakke wrote: > >> I as wondering how to hide this. Best idea I had so far would be to put >> it in heap_beginscan (and index_beginscan given that catalog scans use >> is as well) behind some condition. That would also improve performance >> because locking would not

Re: Speedup of relation deletes during recovery

2018-03-30 Thread Jerry Sievers
Fujii Masao writes: > Hi, > > When multiple relations are deleted at the same transaction, > the files of those relations are deleted by one call to smgrdounlinkall(), > which leads to scan whole shared_buffers only one time. OTOH, > during recovery, smgrdounlink() (not

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

2018-03-30 Thread Petr Jelinek
On 30/03/18 19:36, Andres Freund wrote: > > > On March 30, 2018 10:27:18 AM PDT, Petr Jelinek > wrote: >> . Locking >> around plugin callbacks can hold he lock for longer periods of time >> since plugins usually end up writing to network. I think for most >>

Re: [HACKERS] path toward faster partition pruning

2018-03-30 Thread David Rowley
On 30 March 2018 at 18:38, Amit Langote wrote: > Please find attached the updated patches. There's a bit of a strange case with v45 around prepared statements. I've not debugged this yet, but in case you get there first, here's the case: create table listp (a int,

lo_import() of an empty file

2018-03-30 Thread Bruce Momjian
I have just discovered if you try to lo_import() an empty file, and oid is returned, but nothing is added to pg_largeobject: $ > /rtmp/a $ psql test SELECT lo_import('/rtmp/a'); lo_import --- 16385 SELECT * from

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

2018-03-30 Thread Andres Freund
Hi, On 2018-03-30 21:05:29 +0200, Petr Jelinek wrote: > You mean, if we detect abort in the write callback, set something in the > context which will make all the future writes noop until it's reset > again after we yield back to the logical decoding? Something like that, yea. I *think* doing it

Re: Feature Request - DDL deployment with logical replication

2018-03-30 Thread Jeremy Finzel
On Fri, Mar 30, 2018 at 2:26 AM, Konstantin Knizhnik < k.knizh...@postgrespro.ru> wrote: > > Our team in PostgresPro is also very interested in this discussion, > because we are using logical decoding in multimaster. > Right now in multimaster DDLs are replicated in this same way as in >

Re: [HACKERS] AdvanceXLInsertBuffer vs. WAL segment compressibility

2018-03-30 Thread Stephen Frost
Greetings, * Tom Lane (t...@sss.pgh.pa.us) wrote: > Chapman Flack writes: > > On 03/27/18 22:10, Michael Paquier wrote: > >> Here you go for one example: > >> https://sourceforge.net/projects/pglesslog/ > > > In any case, from my study of the commit, it is hard for me to

Re: Speedup of relation deletes during recovery

2018-03-30 Thread Jerry Sievers
Fujii Masao writes: > Hi, > > When multiple relations are deleted at the same transaction, > the files of those relations are deleted by one call to smgrdounlinkall(), > which leads to scan whole shared_buffers only one time. OTOH, > during recovery, smgrdounlink() (not

Re: [HACKERS] pg_serial early wraparound

2018-03-30 Thread Tom Lane
Thomas Munro writes: > On Tue, Mar 27, 2018 at 5:50 AM, Tom Lane wrote: >> I'm a little worried because Anastasia couldn't repeat the test; >> why is that? > Hmm. I'm not sure. It works for me on a couple of machines and what I see > is:

Re: Passing current_database to BackgroundWorkerInitializeConnection

2018-03-30 Thread Andres Freund
On 2018-03-30 16:36:59 -0500, Jeremy Finzel wrote: > I am having trouble figuring out the right way to do this, clearly missing > something obvious. I am simply trying to pass the current database > to BackgroundWorkerInitializeConnection, but MyDatabaseId is showing as 0, > and I am getting this

Re: [HACKERS] AdvanceXLInsertBuffer vs. WAL segment compressibility

2018-03-30 Thread Chapman Flack
On 03/30/18 16:21, Tom Lane wrote: > Yup. Pushed with some rewriting of the comments. Thanks! > I did not like the proposed test case too much, particularly not its > undocumented API change for check_pg_config, Other than that API change, was there something the test case could have done

Re: Online enabling of checksums

2018-03-30 Thread Tomas Vondra
Hi, I've been looking at the patch a bit more, and I think there are a couple of fairly serious issues in the error handling. Firstly ChecksumHelperLauncherMain spends quite a bit of effort on skipping dropped databases, but ChecksumHelperWorkerMain does not do the same thing with tables. I'm

Re: Change RangeVarGetRelidExtended() to take flags argument?

2018-03-30 Thread Andres Freund
On 2018-03-30 11:37:19 +0900, Michael Paquier wrote: > On Thu, Mar 29, 2018 at 05:15:14PM -0700, Andres Freund wrote: > > On 2018-03-22 15:45:23 +, Bossart, Nathan wrote: > >> Here is a set of patches for this approach. > > > > To me this looks like a reasonable approach that'd solve the

Re: Passing current_database to BackgroundWorkerInitializeConnection

2018-03-30 Thread Jeremy Finzel
> What do you mean with "current database"? Before you > BackgroundWorkerInitializeConnection() there is no such thing? My module is based directly off the worker_spi example. The worker is dynamically launched via SQL command. But in the worker_spi example, the database postgres is just

Re: Passing current_database to BackgroundWorkerInitializeConnection

2018-03-30 Thread Andres Freund
On March 30, 2018 3:16:31 PM PDT, Jeremy Finzel wrote: >> What do you mean with "current database"? Before you >> BackgroundWorkerInitializeConnection() there is no such thing? > > >My module is based directly off the worker_spi example. The worker is >dynamically launched

Re: Enhance pg_stat_wal_receiver view to display connected host

2018-03-30 Thread Fujii Masao
On Fri, Mar 30, 2018 at 9:34 AM, Michael Paquier wrote: > On Fri, Mar 30, 2018 at 10:52:02AM +1100, Haribabu Kommi wrote: >> On Fri, Mar 30, 2018 at 7:26 AM, Fujii Masao wrote: >>> @@ -753,4 +753,6 @@ CREATE VIEW pg_stat_wal_receiver AS >>>

Re: Feature Request - DDL deployment with logical replication

2018-03-30 Thread Craig Ringer
On 31 March 2018 at 01:03, Jeremy Finzel wrote: > > > On Fri, Mar 30, 2018 at 10:16 AM, Peter Eisentraut < > peter.eisentr...@2ndquadrant.com> wrote: > >> On 3/29/18 13:21, Jeremy Finzel wrote: >> > Although we are thrilled with some of the features already in logical >> >

Re: [HACKERS] AdvanceXLInsertBuffer vs. WAL segment compressibility

2018-03-30 Thread Michael Paquier
On Fri, Mar 30, 2018 at 07:11:02PM -0400, Tom Lane wrote: > Chapman Flack writes: > > On 03/30/18 16:21, Tom Lane wrote: > >> I did not like the proposed test case too much, particularly not its > >> undocumented API change for check_pg_config, > > > Other than that API

Re: [HACKERS] AdvanceXLInsertBuffer vs. WAL segment compressibility

2018-03-30 Thread Chapman Flack
On 03/30/18 19:57, Michael Paquier wrote: > look for tools using XLP_BKP_REMOVABLE. One is pglesslog that we > already know about. However I have to be honest, I have not been able > to find its source code, I'm glad it wasn't just me. -Chap

Re: BUG #14941: Vacuum crashes

2018-03-30 Thread Andres Freund
Hi, On 2018-03-30 18:39:01 +, Bossart, Nathan wrote: > I've noticed one more problem with ACCESS EXCLUSIVE. If an ACCESS > EXCLUSIVE lock is held on a child relation of a partitioned table, > an ANALYZE on the partitioned table will be blocked at > acquire_inherited_sample_rows(). > >

Re: Remove PARTIAL_LINKING?

2018-03-30 Thread Andres Freund
Hi, On 2018-01-21 12:43:56 -0800, Andres Freund wrote: > We've still some support for building the backend with PARTIAL_LINKING / > SUBSYS.o instead of the current objfiles.txt approach. > http://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=9956ddc19164b02dc1925fb389a1af77472eba5e > >

Re: file cloning in pg_upgrade and CREATE DATABASE

2018-03-30 Thread Peter Eisentraut
On 3/26/18 02:15, Michael Paquier wrote: > f8c183a has introduced the optimization that your patch is removing, > which was discussed on this thread: > https://www.postgresql.org/message-id/flat/4B78906A.7020309%40mark.mielke.cc Note that that thread is from 2010 and talks about creation of a

Re: Parallel safety of binary_upgrade_create_empty_extension

2018-03-30 Thread Tom Lane
I wrote: > Anyway, that looks like 11 functions that there's no question we > need to relabel. I'll go do that. Oh, while I'm looking at this, I notice that cursor_to_xml[schema] is not merely mismarked as to its parallel safety, but its volatility: it's marked stable, which is frickin' insane

Passing current_database to BackgroundWorkerInitializeConnection

2018-03-30 Thread Jeremy Finzel
I am having trouble figuring out the right way to do this, clearly missing something obvious. I am simply trying to pass the current database to BackgroundWorkerInitializeConnection, but MyDatabaseId is showing as 0, and I am getting this error in the running of function get_database_name here at

Re: [HACKERS] AdvanceXLInsertBuffer vs. WAL segment compressibility

2018-03-30 Thread Tom Lane
Chapman Flack writes: > On 03/30/18 16:21, Tom Lane wrote: >> I did not like the proposed test case too much, particularly not its >> undocumented API change for check_pg_config, > Other than that API change, was there something the test case could have > done differently

Re: [HACKERS] [PATCH] Lockable views

2018-03-30 Thread Tatsuo Ishii
>> I have just pushed the v10 patch. > > The buildfarm is fairly unhappy, and I think it's because of this patch. Thanks for the info. Yes, at least prion is unhappy because of the patch. I will look into this. Best regards, -- Tatsuo Ishii SRA OSS, Inc. Japan English:

Re: [HACKERS] A design for amcheck heapam verification

2018-03-30 Thread Peter Geoghegan
On Thu, Mar 29, 2018 at 7:42 PM, Peter Geoghegan wrote: >> We should be able to get this into v11... > > That's a relief. Thanks. I have a new revision lined up. I won't send anything to the list until you clear up what you meant in those few cases where it seemed unclear. I also

Re: [HACKERS] AdvanceXLInsertBuffer vs. WAL segment compressibility

2018-03-30 Thread Tom Lane
Stephen Frost writes: > * Tom Lane (t...@sss.pgh.pa.us) wrote: >> A potentially stronger complaint is that WAL-reading tools might fail >> outright on a page with an invalid header, but I'd say that's a robustness >> issue that they'd need to address anyway. There's never

Re: Parallel safety of binary_upgrade_create_empty_extension

2018-03-30 Thread Tom Lane
I wrote: > Thomas Munro writes: >> Presumably also cursor_to_xmlschema. I also found some more >> suspicious brin and gin modifying functions. So I think the list of >> functions that needs to be marked 'u' so far is: >> * binary_upgrade_create_empty_extension >>

Re: [PATCH] btree_gin, add support for uuid, bool, name, bpchar and anyrange types

2018-03-30 Thread Matheus de Oliveira
Hi all. On Wed, Mar 21, 2018 at 1:47 PM, Tomas Vondra wrote: > > Do you plan to post an updated version of the patch, of what is your > response to the points raised last week? > > Very sorry about the long delay. I've been in a long trip, no time to look that

Re: Change RangeVarGetRelidExtended() to take flags argument?

2018-03-30 Thread Andres Freund
Hi, On 2018-03-30 17:08:26 +, Bossart, Nathan wrote: > +typedef enum RelidOption > +{ > + RELID_MISSING_OK = 1 << 0, /* don't error if relation doesn't > exist */ > + RELID_NOWAIT = 1 << 1 /* error if relation cannot be locked */ > +} RelidOption; I don't like the

Re: PATCH: Configurable file mode mask

2018-03-30 Thread David Steele
On 3/29/18 11:04 PM, Michael Paquier wrote: > On Thu, Mar 29, 2018 at 10:59:59AM -0400, David Steele wrote: >> On 3/28/18 1:59 AM, Michael Paquier wrote: >> >>> In pg_backup_tar.c, we still have a 0600 hardcoded. You should use >>> PG_FILE_MODE_DEFAULT there as well. >> >> I'm starting to wonder

Re: lo_import() of an empty file

2018-03-30 Thread Bruce Momjian
On Fri, Mar 30, 2018 at 02:22:49PM -0400, Tom Lane wrote: > Bruce Momjian writes: > > I have just discovered if you try to lo_import() an empty file, and oid > > is returned, but nothing is added to pg_largeobject: > > Why would you expect there to be? There's no data to

Re: BUG #14941: Vacuum crashes

2018-03-30 Thread Bossart, Nathan
On 3/7/18, 9:34 AM, "Bossart, Nathan" wrote: > On 3/6/18, 11:04 PM, "Michael Paquier" wrote: >> + if (!(options & VACOPT_SKIP_LOCKED)) >> + relid = RangeVarGetRelid(vrel->relation, AccessShareLock, >> false); >> + else >> + {

Re: [HACKERS] Planning counters in pg_stat_statements

2018-03-30 Thread Thomas Munro
On Sat, Mar 31, 2018 at 8:04 AM, Lukas Fittl wrote: > On Tue, Jan 23, 2018 at 3:31 PM, Tom Lane wrote: >> >> > Unfortunately I'm not going to have bandwidth to figure this out >> > during this commitfest due to other priorities so I'm going to call >> > this

Re: [HACKERS] A design for amcheck heapam verification

2018-03-30 Thread Andres Freund
On 2018-03-29 19:42:42 -0700, Peter Geoghegan wrote: > >> + /* > >> + * Aim for two bytes per element; this is sufficient to get a false > >> + * positive rate below 1%, independent of the size of the bitset or > >> total > >> + * number of elements. Also, if rounding down the

Re: [HACKERS] A design for amcheck heapam verification

2018-03-30 Thread Andres Freund
On March 30, 2018 6:55:50 PM PDT, Peter Geoghegan wrote: >On Fri, Mar 30, 2018 at 6:20 PM, Andres Freund >wrote: >>> What would the upcasting you have in mind look like? >> >> Just use UINT64CONST()? Let's try not to introduce further code >that'll >> need to

Re: WIP: Covering + unique indexes.

2018-03-30 Thread Peter Geoghegan
On Fri, Mar 30, 2018 at 4:08 PM, Alexander Korotkov wrote: >> I'll try it. But I'm afraid that it's not as easy as you expect. > > > So, I have some implementation of storage of number of attributes inside > index tuple itself. I made it as additional patch on top of

Re: [HACKERS][PATCH] adding simple sock check for windows

2018-03-30 Thread Amit Kapila
On Fri, Mar 30, 2018 at 8:10 PM, CharSyam wrote: > Hi, I found some missing check for windows int init_slot function in > vacuumdb.c > > in windows > SOCKET is unsigned type. so > > slot->sock < 0 never can be under 0. > > so this patch just check using slot->sock ==

Re: WIP: Covering + unique indexes.

2018-03-30 Thread Peter Geoghegan
On Fri, Mar 30, 2018 at 10:39 PM, Peter Geoghegan wrote: > It's safe, although I admit that that's a bit hard to see. > Specifically, look at this code in _bt_insert_parent(): > > /* > * Find the parent buffer and get the parent page. > * > * Oops

Re: [HACKERS] A design for amcheck heapam verification

2018-03-30 Thread Peter Geoghegan
On Fri, Mar 30, 2018 at 6:55 PM, Peter Geoghegan wrote: > On Fri, Mar 30, 2018 at 6:20 PM, Andres Freund wrote: >>> What would the upcasting you have in mind look like? >> >> Just use UINT64CONST()? Let's try not to introduce further code that'll >> need to get

Re: [HACKERS] A design for amcheck heapam verification

2018-03-30 Thread Peter Geoghegan
On Fri, Mar 30, 2018 at 6:20 PM, Andres Freund wrote: >> What would the upcasting you have in mind look like? > > Just use UINT64CONST()? Let's try not to introduce further code that'll > need to get painfully fixed. What I have right now is based on imitating the style that