Re: [HACKERS] Order-preserving function transforms and EquivalenceClass

2017-03-24 Thread Tom Lane
Mat Arye writes: > We are trying to extend/hook into the planner so that it understands that > date_trunc('minute', time) has the same ordering as time (or rather that a > sort ordering on the latter is always a valid sort ordering on the former). > But this question really

Re: [HACKERS] comments in hash_alloc_buckets

2017-03-24 Thread Amit Kapila
On Tue, Mar 21, 2017 at 10:11 AM, Ashutosh Sharma wrote: > Hi, > > While working on - [1], I realised that the following comments in > _hash_alloc_buckets() needs to be corrected. > > /* > * Initialize the freed overflow page. Just zeroing the page won't work, >

Re: [HACKERS] Add pgstathashindex() to get hash index table statistics.

2017-03-24 Thread Amit Kapila
On Thu, Mar 23, 2017 at 11:24 PM, Ashutosh Sharma wrote: > Hi, > > On Tue, Feb 7, 2017 at 9:23 AM, Robert Haas wrote: >> On Mon, Feb 6, 2017 at 10:40 PM, Amit Kapila wrote: Maybe we should call them "unused pages". >>>

Re: [HACKERS] Declarative partitioning optimization for large amount of partitions

2017-03-24 Thread Amit Langote
On Fri, Mar 24, 2017 at 11:06 PM, Simon Riggs wrote: > On 1 March 2017 at 01:36, Amit Langote wrote: > >> I don't know which way you're thinking of fixing this, but a planner patch >> to implement faster partition-pruning will have taken care

Re: [HACKERS] scram and \password

2017-03-24 Thread Michael Paquier
On Fri, Mar 24, 2017 at 10:12 PM, Heikki Linnakangas wrote: > On 03/24/2017 03:02 PM, Michael Paquier wrote: >> >> In order to close this thread, I propose to reuse the patches I sent >> here to make scram_build_verifier() available to frontends: >> >>

Re: [HACKERS] Problem in Parallel Bitmap Heap Scan?

2017-03-24 Thread Amit Kapila
On Tue, Mar 21, 2017 at 5:51 PM, Dilip Kumar wrote: > On Tue, Mar 21, 2017 at 4:47 PM, Thomas Munro > wrote: >> I noticed a failure in the inet.sql test while running the regression >> tests with parallelism cranked up, and can reproduce it

Re: [HACKERS] crashes due to setting max_parallel_workers=0

2017-03-24 Thread Amit Kapila
On Sat, Mar 25, 2017 at 7:40 AM, Tomas Vondra wrote: > Hi, > > while working on a patch I ran into some crashes that seem to be caused by > inconsistent handling of max_parallel_workers - queries still seem to be > planned with parallel plans enabled, but then crash

Re: [HACKERS] Logical replication existing data copy

2017-03-24 Thread Peter Eisentraut
On 3/25/17 00:45, Mark Kirkwood wrote: > Minor niggle: > > bench=# DROP PUBLICATION pgbench; > DROP STATISTICS <=== > > I'm guessing that notification is wrong. Fixed. -- Peter Eisentraut http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7

Re: [HACKERS] Logical replication existing data copy

2017-03-24 Thread Mark Kirkwood
On 25/03/17 07:52, Peter Eisentraut wrote: On 3/24/17 10:09, Petr Jelinek wrote: On 24/03/17 15:05, Peter Eisentraut wrote: On 3/23/17 19:32, Petr Jelinek wrote: Yes, I also forgot to check if the table actually exists on subscriber when fetching them in CREATE SUBSCRIPTION (we have check

Re: [HACKERS] [POC] A better way to expand hash indexes.

2017-03-24 Thread Mithun Cy
On Tue, Mar 21, 2017 at 8:16 AM, Amit Kapila wrote: > Sure, I was telling you based on that. If you are implicitly treating > it as 2-dimensional array, it might be easier to compute the array >offsets. I think calculating spares offset will not become anyway much

Re: [HACKERS] [PATCH] Transaction traceability - txid_status(bigint)

2017-03-24 Thread Peter Eisentraut
> I'm wondering if this is a perl version/platform issue around > > $tx->pump until $stdout =~ /[[:digit:]]+[\r\n]$/; > > where we're not recognising the required output from psql when we get it. > > What's in src/test/recovery/tmp_check/log/regress_log_011* ? > > I couldn't use

Re: [HACKERS] WIP: Faster Expression Processing v4

2017-03-24 Thread Tom Lane
btw ... I just got around to looking at a code coverage report for this patched version, and that reminded me of something I'd already suspected: EEOP_INNER_SYSVAR and EEOP_OUTER_SYSVAR seem to be dead code. That's unsurprising, because we never try to access a tuple's system columns above the

Re: [HACKERS] dsm.c API tweak

2017-03-24 Thread Thomas Munro
On Sat, Mar 25, 2017 at 1:59 PM, Thomas Munro wrote: > On Sat, Mar 25, 2017 at 12:35 PM, Alvaro Herrera > wrote: >> Alvaro Herrera wrote: >>> Per >>> https://postgr.es/m/CAEepm=11ma_Z1HoPxPcSCANnh5ykHORa=hca1u1v1+5s_jw...@mail.gmail.com

[HACKERS] crashes due to setting max_parallel_workers=0

2017-03-24 Thread Tomas Vondra
Hi, while working on a patch I ran into some crashes that seem to be caused by inconsistent handling of max_parallel_workers - queries still seem to be planned with parallel plans enabled, but then crash at execution. The attached script reproduces the issue on a simple query, causing

[HACKERS] pg_get_statisticsextdef() is not quite the full shilling

2017-03-24 Thread David Rowley
Hi, Seems pg_get_statisticsextdef() has a couple of things wrong: 1. HeapTupleIsValid() called on the wrong tuple. 2. Did not schema qualify names. Both of which were my mistakes. The attached fixes. I've also added some tests to give the function a bit of coverage. I've purposefully left

Re: [HACKERS] dsm.c API tweak

2017-03-24 Thread Thomas Munro
On Sat, Mar 25, 2017 at 12:35 PM, Alvaro Herrera wrote: > Alvaro Herrera wrote: >> Per >> https://postgr.es/m/CAEepm=11ma_Z1HoPxPcSCANnh5ykHORa=hca1u1v1+5s_jw...@mail.gmail.com >> it seems that the dsm.c API is a bit inconvenient right now. I proposed >> in the first

Re: [HACKERS] ICU integration

2017-03-24 Thread Peter Geoghegan
On Thu, Mar 23, 2017 at 6:31 PM, Craig Ringer wrote: > Congratulations on getting this done. It's great work, and it'll make > a whole class of potential bugs and platform portability warts go away > if widely adopted. +1 I would like to see us rigorously define a

Re: [HACKERS] Fetch JSONB Value for UNIQUE Constraint

2017-03-24 Thread David E. Wheeler
On Mar 24, 2017, at 5:00 PM, Peter Geoghegan wrote: >> So it’s a fine workaround, but maybe there’s something missing from the >> parsing of the CREATE TABLE statement? This is on 9.6.1. > > Unique constraints don't support expressions, or a predicate (partial-ness). Oh. Okay. I

Re: [HACKERS] [PATCH] Transaction traceability - txid_status(bigint)

2017-03-24 Thread Craig Ringer
On 25 March 2017 at 07:31, Peter Eisentraut wrote: > On 3/24/17 02:27, Craig Ringer wrote: >> On 24 March 2017 at 02:29, Robert Haas wrote: >>> On Tue, Mar 21, 2017 at 11:35 PM, Craig Ringer >>> wrote: Changes

Re: [HACKERS] Fetch JSONB Value for UNIQUE Constraint

2017-03-24 Thread Peter Geoghegan
On Fri, Mar 24, 2017 at 4:57 PM, David E. Wheeler wrote: > So it’s a fine workaround, but maybe there’s something missing from the > parsing of the CREATE TABLE statement? This is on 9.6.1. Unique constraints don't support expressions, or a predicate (partial-ness). --

[HACKERS] Fetch JSONB Value for UNIQUE Constraint

2017-03-24 Thread David E. Wheeler
Dear Hackers, Should this work? CREATE TABLE things ( user_id INTEGER NOT NULL, document JSONB NOT NULL, UNIQUE (user_id, document->>'name') ); ERROR: syntax error at or near "->>" LINE 4: UNIQUE (user_id, document->>’name') I tried adding parens,

Re: [HACKERS] dsm.c API tweak

2017-03-24 Thread Alvaro Herrera
Alvaro Herrera wrote: > Per > https://postgr.es/m/CAEepm=11ma_Z1HoPxPcSCANnh5ykHORa=hca1u1v1+5s_jw...@mail.gmail.com > it seems that the dsm.c API is a bit inconvenient right now. I proposed > in the first patch in that thread to change the API so that a segment is > marked as "pinned" if

Re: [HACKERS] [PATCH] Transaction traceability - txid_status(bigint)

2017-03-24 Thread Peter Eisentraut
On 3/24/17 02:27, Craig Ringer wrote: > On 24 March 2017 at 02:29, Robert Haas wrote: >> On Tue, Mar 21, 2017 at 11:35 PM, Craig Ringer wrote: >>> Changes made per discussion. >> >> Committed 0001. > > Much appreciated. > > Here's the 2nd patch

[HACKERS] dsm.c API tweak

2017-03-24 Thread Alvaro Herrera
Per https://postgr.es/m/CAEepm=11ma_Z1HoPxPcSCANnh5ykHORa=hca1u1v1+5s_jw...@mail.gmail.com it seems that the dsm.c API is a bit inconvenient right now. I proposed in the first patch in that thread to change the API so that a segment is marked as "pinned" if created with no ResourceOwner set as

Re: [HACKERS] Potential data loss of 2PC files

2017-03-24 Thread Michael Paquier
On Fri, Mar 24, 2017 at 11:36 PM, Teodor Sigaev wrote: >> And the renaming of pg_clog to pg_xact is also my fault. Attached is >> an updated patch. > > > Thank you. One more question: what about symlinks? If DBA moves, for > example, pg_xact to another dist and leaves the

Re: [HACKERS] increasing the default WAL segment size

2017-03-24 Thread David Steele
Hi Robert, On 3/24/17 3:00 PM, Robert Haas wrote: On Wed, Mar 22, 2017 at 6:05 PM, David Steele wrote: Wait, really? I thought you abandoned this approach because there's then no principled way to handle WAL segments of less than the default size. I did say that, but I

Re: [HACKERS] \if, \elseif, \else, \endif (was Re: PSQL commands: \quit_if, \quit_unless)

2017-03-24 Thread Corey Huinker
v25 - PQExpBuffer on gather_boolean_expression() - convenience/clarity functions: ignore_slash_option(), ignore_2_slash_options(), ignore_slash_line() - remove inaccurate test of variable expansion in a false block - added kitchen-sink test of parsing slash commands in a false block - removed

Re: [HACKERS] delta relations in AFTER triggers

2017-03-24 Thread Thomas Munro
On Fri, Mar 24, 2017 at 5:36 PM, Thomas Munro wrote: > On Fri, Mar 24, 2017 at 1:14 PM, Thomas Munro > wrote: >> If that's fixed and the permissions question can be waved away by >> saying it's the same as the per-row situation, my

Re: [HACKERS] comment/security label for publication/subscription

2017-03-24 Thread Stephen Frost
* Robert Haas (robertmh...@gmail.com) wrote: > On Fri, Mar 24, 2017 at 12:18 AM, Peter Eisentraut > wrote: > > Here is a patch to add COMMENT support for publications and subscriptions. > > > > On a similar issue, do we need SECURITY LABEL support for those?

Re: [HACKERS] Guidelines for GSoC student proposals / Eliminate O(N^2) scaling from rw-conflict tracking in serializable transactions

2017-03-24 Thread Kevin Grittner
On Wed, Mar 22, 2017 at 2:24 AM, Mengxing Liu wrote: > I've finished a draft proposal for "Eliminate O(N^2) scaling from > rw-conflict tracking in serializable transactions". I've attached some comments to the document; let me know if they don't show up for you

Re: [HACKERS] comment/security label for publication/subscription

2017-03-24 Thread Robert Haas
On Fri, Mar 24, 2017 at 12:18 AM, Peter Eisentraut wrote: > Here is a patch to add COMMENT support for publications and subscriptions. > > On a similar issue, do we need SECURITY LABEL support for those? Does > that make sense? IMHO, it's good to have COMMENT

Re: [HACKERS] Logical replication existing data copy

2017-03-24 Thread Michael Banck
Am Freitag, den 24.03.2017, 14:57 -0400 schrieb Peter Eisentraut: > On 3/24/17 05:22, Michael Banck wrote: > > However, replication also seems to not work, I'm using the following > > script right now: > > The problem is that your publication does not include any tables. Oops, of course. That

Re: [HACKERS] \if, \elseif, \else, \endif (was Re: PSQL commands: \quit_if, \quit_unless)

2017-03-24 Thread Corey Huinker
On Fri, Mar 24, 2017 at 4:10 PM, Fabien COELHO wrote: > > Hello Corey, > > I wished for the same thing, happy to use one if it is made known to me. >> I pulled that pattern from somewhere else in the code, and given that the >> max number of args for a command is around 4,

Re: [HACKERS] Page Scan Mode in Hash Index

2017-03-24 Thread Robert Haas
On Thu, Mar 23, 2017 at 2:35 PM, Ashutosh Sharma wrote: > I take your suggestion. Please find the attachments. I think you should consider refactoring this so that it doesn't need to use goto. Maybe move the while (offnum <= maxoff) logic into a helper function and have

Re: [HACKERS] \if, \elseif, \else, \endif (was Re: PSQL commands: \quit_if, \quit_unless)

2017-03-24 Thread Fabien COELHO
Hello Corey, I wished for the same thing, happy to use one if it is made known to me. I pulled that pattern from somewhere else in the code, and given that the max number of args for a command is around 4, I'm not too worried about scaling. If there are expressions one day like pgbench, the

Re: [HACKERS] UPDATE of partition key

2017-03-24 Thread Amit Khandekar
Thanks Amit for your review comments. I am yet to handle all of your comments, but meanwhile , attached is an updated patch, that handles RETURNING. Earlier it was not working because ExecInsert() did not return any RETURNING clause. This is because the setup needed to create RETURNIG projection

Re: [HACKERS] pageinspect and hash indexes

2017-03-24 Thread Ashutosh Sharma
Thanks for reviewing my patch. I have removed the extra white space. Attached are both the patches. >>> >>> Sorry, I have mistakenly attached wrong patch. Here are the correct >>> set of patches. >> >> The latest version of patches looks fine to me. > > I don't really like 0002. What

Re: [HACKERS] Re: [COMMITTERS] pgsql: Implement multivariate n-distinct coefficients

2017-03-24 Thread Tom Lane
Alvaro Herrera writes: > Tom Lane wrote: >> Why not use COSTS OFF? Or I'll put that even more strongly: all the >> existing regression tests use COSTS OFF, exactly to avoid this sort of >> machine-dependent output. There had better be a really damn good >> reason not

Re: [HACKERS] pg_stat_wal_write statistics view

2017-03-24 Thread Fujii Masao
On Wed, Feb 15, 2017 at 12:53 PM, Haribabu Kommi wrote: > > > On Wed, Feb 8, 2017 at 9:36 PM, Amit Kapila wrote: >> >> On Tue, Feb 7, 2017 at 11:47 AM, Haribabu Kommi >> wrote: >> > Hi Hackers, >> > >> > I just want to

Re: [HACKERS] ANALYZE command progress checker

2017-03-24 Thread Robert Haas
On Fri, Mar 24, 2017 at 3:41 AM, vinayak wrote: > I have updated the patch. You can't change the definition of AcquireSampleRowsFunc without updating the documentation in fdwhandler.sgml, but I think I don't immediately understand why that's a thing we want to do

Re: [HACKERS] Re: [COMMITTERS] pgsql: Implement multivariate n-distinct coefficients

2017-03-24 Thread Alvaro Herrera
Tom Lane wrote: > Why not use COSTS OFF? Or I'll put that even more strongly: all the > existing regression tests use COSTS OFF, exactly to avoid this sort of > machine-dependent output. There had better be a really damn good > reason not to use it here. If we use COSTS OFF, the test is

Re: [HACKERS] \if, \elseif, \else, \endif (was Re: PSQL commands: \quit_if, \quit_unless)

2017-03-24 Thread Corey Huinker
> > > A few comments about the patch. > > Patch applies. "make check" ok. > > As already pointed out, there is one useless file in the patch. > > Although currently there is only one expected argument for boolean > expressions, the n² concatenation algorithm in gather_boolean_expression is > not

Re: [HACKERS] pageinspect and hash indexes

2017-03-24 Thread Robert Haas
On Fri, Mar 24, 2017 at 3:54 AM, Amit Kapila wrote: > On Fri, Mar 24, 2017 at 9:50 AM, Ashutosh Sharma > wrote: >> On Fri, Mar 24, 2017 at 9:46 AM, Ashutosh Sharma >> wrote: >>> >>> Thanks for reviewing my patch. I have

Re: [HACKERS] Re: [COMMITTERS] pgsql: Implement multivariate n-distinct coefficients

2017-03-24 Thread Tom Lane
Alvaro Herrera writes: > Robert Haas wrote: >> dromedary and arapaima have failures like this, which seems likely >> related to this commit: >> >> EXPLAIN >> SELECT COUNT(*) FROM ndistinct GROUP BY a, d; >> QUERY PLAN >>

Re: [HACKERS] WIP: Faster Expression Processing v4

2017-03-24 Thread Tom Lane
Andres Freund writes: > On 2017-03-24 11:26:27 -0400, Tom Lane wrote: >> Another modest proposal: >> >> I'm not really sold on the approach of using EEOP_FETCHSOME opcodes to >> trigger initial tupleslot de-forming. Certainly we want to have a single >> slot_getsomeattrs

[HACKERS] Re: [COMMITTERS] pgsql: Implement multivariate n-distinct coefficients

2017-03-24 Thread Alvaro Herrera
Robert Haas wrote: > On Fri, Mar 24, 2017 at 1:16 PM, Alvaro Herrera > wrote: > > Implement multivariate n-distinct coefficients > > dromedary and arapaima have failures like this, which seems likely > related to this commit: > > EXPLAIN >SELECT COUNT(*) FROM

Re: [HACKERS] increasing the default WAL segment size

2017-03-24 Thread Robert Haas
On Wed, Mar 22, 2017 at 6:05 PM, David Steele wrote: >> Wait, really? I thought you abandoned this approach because there's >> then no principled way to handle WAL segments of less than the default >> size. > > I did say that, but I thought I had hit on a compromise. > >

Re: [HACKERS] Logical replication existing data copy

2017-03-24 Thread Peter Eisentraut
On 3/24/17 05:22, Michael Banck wrote: > However, replication also seems to not work, I'm using the following > script right now: The problem is that your publication does not include any tables. -- Peter Eisentraut http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support,

Re: [HACKERS] Logical replication existing data copy

2017-03-24 Thread Peter Eisentraut
On 3/24/17 10:09, Petr Jelinek wrote: > On 24/03/17 15:05, Peter Eisentraut wrote: >> On 3/23/17 19:32, Petr Jelinek wrote: >>> Yes, I also forgot to check if the table actually exists on subscriber >>> when fetching them in CREATE SUBSCRIPTION (we have check during >>> replication but not there).

Re: [HACKERS] Enabling parallelism for queries coming from SQL or other PL functions

2017-03-24 Thread Robert Haas
On Fri, Mar 24, 2017 at 5:57 AM, Rafia Sabih wrote: >> I suspect that code fails to achieve its goals anyway. At the top of >> exec_eval_expr(), you call exec_prepare_plan() and unconditionally >> pass CURSOR_OPT_PARALLEL_OK, so when that function returns,

Re: [HACKERS] [COMMITTERS] pgsql: Implement multivariate n-distinct coefficients

2017-03-24 Thread Robert Haas
On Fri, Mar 24, 2017 at 1:16 PM, Alvaro Herrera wrote: > Implement multivariate n-distinct coefficients dromedary and arapaima have failures like this, which seems likely related to this commit: EXPLAIN SELECT COUNT(*) FROM ndistinct GROUP BY a, d;

Re: [HACKERS] multivariate statistics (v25)

2017-03-24 Thread Alvaro Herrera
Alvaro Herrera wrote: > Here's a rebased series on top of today's a3eac988c267. I call this > v28. > > I put David's pg_dump and COMMENT patches as second in line, just after > the initial infrastructure patch. I suppose those three have to be > committed together, while the others (which add

Re: [HACKERS] Create replication slot in pg_basebackup if requested and not yet present

2017-03-24 Thread Michael Banck
Hi, On Thu, Mar 23, 2017 at 12:41:54PM +0100, Magnus Hagander wrote: > On Tue, Mar 21, 2017 at 8:34 PM, Robert Haas wrote: > > So I tend to think that there should always be some explicit user > > action to cause the creation of a slot, like --create-slot-if-needed > > or

Re: [HACKERS] WIP: Faster Expression Processing v4

2017-03-24 Thread Andres Freund
Hi, On 2017-03-24 11:26:27 -0400, Tom Lane wrote: > Another modest proposal: > > I'm not really sold on the approach of using EEOP_FETCHSOME opcodes to > trigger initial tupleslot de-forming. Certainly we want to have a single > slot_getsomeattrs call per source slot, but as-is, we need a

Re: [HACKERS] pg_serial early wraparound

2017-03-24 Thread Thomas Munro
On Sat, Mar 25, 2017 at 3:11 AM, Anastasia Lubennikova wrote: > Hi, I've tried to review this patch, but it seems that I miss something > essential. Hi Anastasia, Thanks for looking at this. > You claim that SLRUs now support five digit segment name, while in slru.h >

Re: [HACKERS] extended statistics: n-distinct

2017-03-24 Thread Alvaro Herrera
Pushed this after some more tweaking. -- Álvaro Herrerahttps://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription:

Re: [HACKERS] Patch: Write Amplification Reduction Method (WARM)

2017-03-24 Thread Pavan Deolasee
On Fri, Mar 24, 2017 at 6:46 PM, Amit Kapila wrote: > > > I was worried for the case if the index is created non-default > collation, will the datumIsEqual() suffice the need. Now again > thinking about it, I think it will because in the index tuple we are > storing the

Re: [HACKERS] [COMMITTERS] pgsql: Avoid SnapshotResetXmin() during AtEOXact_Snapshot()

2017-03-24 Thread Andres Freund
On 2017-03-24 13:50:54 -0400, Robert Haas wrote: > On Fri, Mar 24, 2017 at 12:27 PM, Robert Haas wrote: > > On Fri, Mar 24, 2017 at 12:14 PM, Robert Haas wrote: > >> On Fri, Mar 24, 2017 at 10:23 AM, Simon Riggs > >> wrote: >

Re: [HACKERS] [COMMITTERS] pgsql: Avoid SnapshotResetXmin() during AtEOXact_Snapshot()

2017-03-24 Thread Simon Riggs
On 24 March 2017 at 16:14, Robert Haas wrote: > I suspect that is the fault of this patch. Please fix or revert. Will revert then fix. -- Simon Riggshttp://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services --

Re: [HACKERS] [COMMITTERS] pgsql: Avoid SnapshotResetXmin() during AtEOXact_Snapshot()

2017-03-24 Thread Robert Haas
On Fri, Mar 24, 2017 at 12:27 PM, Robert Haas wrote: > On Fri, Mar 24, 2017 at 12:14 PM, Robert Haas wrote: >> On Fri, Mar 24, 2017 at 10:23 AM, Simon Riggs wrote: >>> Avoid SnapshotResetXmin() during AtEOXact_Snapshot() >>>

Re: [HACKERS] Report the number of skipped frozen pages by manual VACUUM

2017-03-24 Thread Fujii Masao
On Thu, Mar 23, 2017 at 4:28 AM, Fujii Masao wrote: > On Wed, Mar 15, 2017 at 7:51 PM, Masahiko Sawada > wrote: >> On Wed, Mar 15, 2017 at 1:09 PM, Yugo Nagata wrote: >>> On Fri, 10 Mar 2017 20:08:42 +0900 >>> Masahiko Sawada

Re: [HACKERS] increasing the default WAL segment size

2017-03-24 Thread Beena Emerson
Hello, On Wed, Mar 22, 2017 at 9:41 PM, Kuntal Ghosh wrote: > On Wed, Mar 22, 2017 at 3:14 PM, Beena Emerson > wrote: > > PFA an updated patch which fixes a minor bug I found. It only increases > the > > string size in pretty_wal_size

Re: [HACKERS] Monitoring roles patch

2017-03-24 Thread Robert Haas
On Fri, Mar 24, 2017 at 12:46 PM, Dave Page wrote: > On Fri, Mar 24, 2017 at 4:24 PM, Robert Haas wrote: >>> If we make the users run all the statements individually then they'll >>> also have to get an updated script for the next version of PG too >>>

Re: [HACKERS] Supporting huge pages on Windows

2017-03-24 Thread Ashutosh Sharma
Hi, On Fri, Mar 24, 2017 at 9:00 PM, David Steele wrote: > Hi Ashutosh, > > On 3/22/17 8:52 AM, Amit Kapila wrote: >> >> On Wed, Mar 22, 2017 at 12:07 AM, David Steele >> wrote: >>> >>> >>> Amit, Magnus, you are signed up as reviewers for this patch.

Re: [HACKERS] BUG: pg_dump generates corrupted gzip file in Windows

2017-03-24 Thread Robert Haas
On Fri, Mar 24, 2017 at 6:44 AM, Kuntal Ghosh wrote: >> ASAICU, if we use binary mode, output is stored bit by bit. In ASCII >> mode, cmd pokes its nose and does CR / LF conversions on its own. So, >> whenever we want compression on a plain-text dump file, we can set

Re: [HACKERS] Monitoring roles patch

2017-03-24 Thread Dave Page
On Fri, Mar 24, 2017 at 4:24 PM, Robert Haas wrote: > >> If we make the users run all the statements individually then they'll >> also have to get an updated script for the next version of PG too >> because we will have added things that the tools will want access to. > >

Re: [HACKERS] \if, \elseif, \else, \endif (was Re: PSQL commands: \quit_if, \quit_unless)

2017-03-24 Thread Fabien COELHO
Hello Corey, v24 highlights: - finally using git format-patch - all conditional slash commands broken out into their own functions (exec_command_$NAME) , each one tests if it's in an active branch, and if it's not it consumes the same number of parameters, but discards them. comments for each

Re: [HACKERS] parallel "return query" is no good

2017-03-24 Thread Robert Haas
On Thu, Mar 23, 2017 at 1:53 PM, Alvaro Herrera wrote: > Robert Haas wrote: >> I guess the downside of back-patching this is that it could cause a >> plan change for somebody which ends up being worse. On the whole, >> serial execution of queries intended to be run in

Re: [HACKERS] [PATCH] Transaction traceability - txid_status(bigint)

2017-03-24 Thread Robert Haas
On Fri, Mar 24, 2017 at 2:27 AM, Craig Ringer wrote: > On 24 March 2017 at 02:29, Robert Haas wrote: >> On Tue, Mar 21, 2017 at 11:35 PM, Craig Ringer wrote: >>> Changes made per discussion. >> >> Committed 0001. > > Much

Re: [HACKERS] [COMMITTERS] pgsql: Avoid SnapshotResetXmin() during AtEOXact_Snapshot()

2017-03-24 Thread Robert Haas
On Fri, Mar 24, 2017 at 12:14 PM, Robert Haas wrote: > On Fri, Mar 24, 2017 at 10:23 AM, Simon Riggs wrote: >> Avoid SnapshotResetXmin() during AtEOXact_Snapshot() >> >> For normal commits and aborts we already reset PgXact->xmin >> Avoiding touching

Re: [HACKERS] Monitoring roles patch

2017-03-24 Thread Robert Haas
On Fri, Mar 24, 2017 at 8:30 AM, Stephen Frost wrote: >> But why not do it with GRANTs in the first place then? > > This is akin to asking why do we need GRANT ALL and ALTER DEFAULT PRIVs. Not really. ALTER DEFAULT PRIVILEGES affects what happens for future objects, which

Re: [HACKERS] Re: [BUGS] Problem in using pgbench's --connect(-C) and --rate=rate(-R rate) options together.

2017-03-24 Thread Teodor Sigaev
No, it is really needed so that the lag measure is correct. Thank you, pushed -- Teodor Sigaev E-mail: teo...@sigaev.ru WWW: http://www.sigaev.ru/ -- Sent via pgsql-hackers mailing list

Re: [HACKERS] Re: Declarative partitioning optimization for large amount of partitions

2017-03-24 Thread Aleksander Alekseev
Hi Teodor, Thanks a lot for a review! > > step1 In pgstat_report_stat() you remove one by one entries from hash and > > remove them all. Isn't it better to hash_destroy/hash_create or even let > > hash > > lives in separate memory context and just resets it? Agree, fixed. > > step1 Again,

Re: [HACKERS] [COMMITTERS] pgsql: Avoid SnapshotResetXmin() during AtEOXact_Snapshot()

2017-03-24 Thread Robert Haas
On Fri, Mar 24, 2017 at 10:23 AM, Simon Riggs wrote: > Avoid SnapshotResetXmin() during AtEOXact_Snapshot() > > For normal commits and aborts we already reset PgXact->xmin > Avoiding touching highly contented shmem improves concurrent > performance. > > Simon Riggs I'm

Re: [HACKERS] Parallel Append implementation

2017-03-24 Thread Amit Khandekar
On 24 March 2017 at 00:38, Amit Khandekar wrote: > On 23 March 2017 at 16:26, Amit Khandekar wrote: >> On 23 March 2017 at 05:55, Robert Haas wrote: >>> >>> So in your example we do this: >>> >>> C[0] += 20; >>> C[1] += 16;

Re: [HACKERS] exposing wait events for non-backends (was: Tracking wait event for latches)

2017-03-24 Thread Robert Haas
On Thu, Mar 23, 2017 at 7:29 AM, Michael Paquier wrote: > On Thu, Mar 23, 2017 at 8:19 PM, Kuntal Ghosh > wrote: >> Hence, to be consistent with others, bgworker processes can be >> initialized from

Re: [HACKERS] Re: Declarative partitioning optimization for large amount of partitions

2017-03-24 Thread Teodor Sigaev
Sorry, 1) and 4) is my fault, comment in hsearch.h: * ... The hash key * is expected to be at the start of the caller's hash entry data structure. Ops, forgot that. Teodor Sigaev wrote: things in order I'm attaching the previous patch as well. Patches look good, but I have some notices: 1

Re: [HACKERS] [PATCH] Generic type subscripting

2017-03-24 Thread Arthur Zakirov
On 24.03.2017 18:29, Tom Lane wrote: David Steele writes: Do you have an idea when you will have a patch ready? We are now into the last week of the commitfest. I see one question for Tom, but it's not clear that this would prevent you from producing a new patch. FWIW,

Re: [HACKERS] Should we cacheline align PGXACT?

2017-03-24 Thread Robert Haas
On Fri, Mar 24, 2017 at 10:12 AM, Simon Riggs wrote: > On 10 March 2017 at 13:08, Alexander Korotkov > wrote: >> Results look good for me. Idea of committing both of patches looks >> attractive. > > I'll commit mine since I understand what it

Re: [HACKERS] Supporting huge pages on Windows

2017-03-24 Thread David Steele
Hi Ashutosh, On 3/22/17 8:52 AM, Amit Kapila wrote: On Wed, Mar 22, 2017 at 12:07 AM, David Steele wrote: Amit, Magnus, you are signed up as reviewers for this patch. Do you know when you'll have a chance to take a look? I have provided my feedback and I could not

Re: [HACKERS] pgbench - allow to store select results into variables

2017-03-24 Thread Fabien COELHO
Hello Rafia, if (my_command->argc > 2) + syntax_error(source, lineno, my_command->line, my_command->argv[0], + "at most on argument expected", NULL, -1); I suppose you mean 'one' argument here. Indeed. Apart from that indentation is not correct as per pgindent, please check. I guess

Re: [HACKERS] Re: Declarative partitioning optimization for large amount of partitions

2017-03-24 Thread Teodor Sigaev
things in order I'm attaching the previous patch as well. Patches look good, but I have some notices: 1 step1 Why do you need TabStatHashEntry at all? TabStatHashEntry.t_id is never used for read, so entry for hash could be just a pointer to PgStat_TableStatus. 2 step1 In

Re: [HACKERS] [PATCH] Generic type subscripting

2017-03-24 Thread Tom Lane
David Steele writes: > Do you have an idea when you will have a patch ready? We are now into > the last week of the commitfest. I see one question for Tom, but it's > not clear that this would prevent you from producing a new patch. FWIW, I'm up to my eyeballs in Andres'

Re: [HACKERS] WIP: Faster Expression Processing v4

2017-03-24 Thread Tom Lane
Another modest proposal: I'm not really sold on the approach of using EEOP_FETCHSOME opcodes to trigger initial tupleslot de-forming. Certainly we want to have a single slot_getsomeattrs call per source slot, but as-is, we need a separate traversal over the expression tree just to precompute the

Re: [HACKERS] cast result of copyNode()

2017-03-24 Thread David Steele
On 3/21/17 6:52 PM, Mark Dilger wrote: On Mar 21, 2017, at 2:13 PM, David Steele wrote: Hi Mark, On 3/9/17 3:34 PM, Peter Eisentraut wrote: On 3/7/17 18:27, Mark Dilger wrote: You appear to be using a #define macro to wrap a function of the same name with the code:

Re: [HACKERS] [PATCH] Generic type subscripting

2017-03-24 Thread Dmitry Dolgov
On 24 March 2017 at 15:39, David Steele wrote: > > Do you have an idea when you will have a patch ready? Yes, I'll prepare a new version with most important changes in two days.

Re: [HACKERS] Declarative partitioning optimization for large amount of partitions

2017-03-24 Thread Aleksander Alekseev
Hi Simon, > > I don't know which way you're thinking of fixing this, but a planner patch > > to implement faster partition-pruning will have taken care of this, I > > think. As you may know, even declarative partitioned tables currently > > depend on constraint exclusion for partition-pruning

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

2017-03-24 Thread David Steele
Hi Vaishnavi, On 3/19/17 9:32 PM, Vaishnavi Prabakaran wrote: On Fri, Mar 17, 2017 at 12:37 AM, Daniel Verite I would also like to hear Craig's

Re: [HACKERS] LWLock optimization for multicore Power machines

2017-03-24 Thread David Steele
Hi Alexander, On 3/16/17 1:35 PM, David Steele wrote: On 2/21/17 9:54 AM, Bernd Helmle wrote: Am Dienstag, den 14.02.2017, 15:53 +0300 schrieb Alexander Korotkov: +1 And you could try to use pg_wait_sampling to sampling of wait events. I've

Re: [HACKERS] Re: [BUGS] Problem in using pgbench's --connect(-C) and --rate=rate(-R rate) options together.

2017-03-24 Thread Fabien COELHO
Hello Teodor, Hi, the patch looks good except why do you remove initialization of is_throttled? Suppose, just a typo? No, it is really needed so that the lag measure is correct. Without the is_throttled change: sh> ./pgbench -T 3 -R 10 -C -S -P 1 starting vacuum...end. progress: 1.0 s,

Re: [HACKERS] pg_stat_wal_write statistics view

2017-03-24 Thread David Steele
On 3/16/17 1:54 AM, vinayak wrote: On 2017/03/16 14:46, Haribabu Kommi wrote: As the view name already contains WAL, I am not sure whether is it required to include WAL in every column? I am fine to change if others have the same opinion of adding WAL to column names. Ok. So what is the

[HACKERS] Logical replication SnapBuildInitalSnapshot spelling

2017-03-24 Thread Marko Tiikkaja
Hi, Commit 7c4f52409a8c7d85ed169bbbc1f6092274d03920 seems to have introduced an alternative spelling of "initial". Fixed in the attached. .m logical_inital.patch Description: Binary data -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your

Re: [HACKERS] Index usage for elem-contained-by-const-range clauses

2017-03-24 Thread David Steele
Hi Pritam, On 3/17/17 5:41 PM, Pritam Baral wrote: So sorry. I'm attaching the correct version of the original with this, in case you want to test the limited implementation, because I still have to go through Tom's list of suggestions. BTW, the patch is for applying on top of REL9_6_2, and

Re: [HACKERS] logical replication apply to run with sync commit off by default

2017-03-24 Thread Petr Jelinek
On 21/03/17 22:37, Petr Jelinek wrote: > On 21/03/17 18:54, Robert Haas wrote: >> On Mon, Mar 20, 2017 at 7:56 PM, Petr Jelinek >> wrote: >>> On 18/03/17 13:31, Petr Jelinek wrote: On 07/03/17 06:23, Petr Jelinek wrote: > there has been discussion at the

Re: [HACKERS] Logical replication origin tracking fix

2017-03-24 Thread Petr Jelinek
On 10/03/17 05:59, Petr Jelinek wrote: > Hi, > > while discussing with Craig issues around restarting logical replication > stream related to the patch he posted [1], I realized that we track > wrong origin LSN in the logical replication apply. > > We currently track commit_lsn which is *start*

[HACKERS] Fix slot name change handling for subscriptions

2017-03-24 Thread Petr Jelinek
Hi, ALTER SUBSCRIPTION ... WITH (SLOT NAME = foo) will make the worker dies on error about unexpected subscription changed. It's my oversight in the original logical replication patch-set. Attached patch fixes it to behave same way as other changes to subscription options. -- Petr Jelinek

Re: [HACKERS] [PATCH] Generic type subscripting

2017-03-24 Thread David Steele
Hi Dmitry, On 3/21/17 4:42 PM, Dmitry Dolgov wrote: On 21 March 2017 at 18:16, David Steele > wrote: This thread has been idle for over a week. Yes, sorry for the late reply. I'm still trying to find a better solution for some of the

Re: [HACKERS] Potential data loss of 2PC files

2017-03-24 Thread Teodor Sigaev
And the renaming of pg_clog to pg_xact is also my fault. Attached is an updated patch. Thank you. One more question: what about symlinks? If DBA moves, for example, pg_xact to another dist and leaves the symlink in data directoty. Suppose, fsync on symlink will do nothing actually. --

Re: [HACKERS] PassDownLimitBound for ForeignScan/CustomScan [take-2]

2017-03-24 Thread David Steele
Hi Kaigai, On 3/21/17 1:11 PM, David Steele wrote: On 3/13/17 3:25 AM, Jeevan Chalke wrote: I have reviewed this patch further and here are my comments: This thread has been idle for over a week. Please respond and/or post a new patch by 2017-03-24 00:00 AoE (UTC-12) or this submission

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

2017-03-24 Thread David Steele
Hi Ivan, On 3/21/17 1:06 PM, David Steele wrote: Hi Ivan, On 3/12/17 10:20 PM, Thomas Munro wrote: On Fri, Mar 10, 2017 at 1:49 AM, Ivan Kartyshov wrote: Here I attached rebased patch waitlsn_10dev_v3 (core feature) I will leave the choice of implementation

  1   2   >