Re: [HACKERS] inherit support for foreign tables

2014-10-24 Thread Etsuro Fujita
(2014/10/21 17:40), Etsuro Fujita wrote: (2014/10/14 20:00), Etsuro Fujita wrote: Here are separated patches. fdw-chk.patch - CHECK constraints on foreign tables fdw-inh.patch - table inheritance with foreign tables The latter has been created on top of [1]. [1]

Re: [HACKERS] Getting rid of accept incoming network connections prompts on OS X

2014-10-24 Thread Dave Page
On Fri, Oct 24, 2014 at 7:18 AM, Peter Eisentraut pete...@gmx.net wrote: On 10/21/14 1:16 PM, Tom Lane wrote: If you do any Postgres development on OS X, you've probably gotten seriously annoyed by the way that, every single time you reinstall the postmaster executable, you get a dialog box

Re: [HACKERS] Getting rid of accept incoming network connections prompts on OS X

2014-10-24 Thread Michael Paquier
On Fri, Oct 24, 2014 at 8:26 AM, Dave Page dp...@pgadmin.org wrote: On Fri, Oct 24, 2014 at 7:18 AM, Peter Eisentraut pete...@gmx.net wrote: On 10/21/14 1:16 PM, Tom Lane wrote: If you do any Postgres development on OS X, you've probably gotten seriously annoyed by the way that, every

Re: [HACKERS] Wait free LW_SHARED acquisition - v0.2

2014-10-24 Thread Amit Kapila
On Wed, Oct 22, 2014 at 7:12 PM, Andres Freund and...@2ndquadrant.com wrote: On 2014-10-22 13:32:07 +0530, Amit Kapila wrote: On Tue, Oct 21, 2014 at 7:56 PM, Amit Kapila amit.kapil...@gmail.com wrote: On Wed, Oct 8, 2014 at 6:17 PM, Andres Freund and...@2ndquadrant.com wrote:

[HACKERS] Re: Getting rid of accept incoming network connections prompts on OS X

2014-10-24 Thread edward745
One of the queries in ri_triggers.c has be a little baffled. For (relatively) obvious reasons, a FK insert triggers a SELECT 1 FROM pk_rel ... FOR KEY SHARE. For not-so-obvious reasons, a PK delete triggers a SELECT 1 FROM fk_rel ... FOR KEY SHARE. I can't see what the lock on fk_rel achieves.

Re: [HACKERS] Function array_agg(array)

2014-10-24 Thread Ali Akbar
Updated patch attached. 2014-10-22 20:51 GMT+07:00 Pavel Stehule pavel.steh...@gmail.com: I agree with your proposal. I have a few comments to design: 1. patch doesn't hold documentation and regress tests, please append it. i've added some regression tests in arrays.sql and aggregate.sql.

Re: [HACKERS] alter user/role CURRENT_USER

2014-10-24 Thread Kyotaro HORIGUCHI
Hi, here is the revised patch. Attached files are the followings - 0001-ALTER-ROLE-CURRENT_USER_v2.patch - the patch. - testset.tar.bz2 - test set. Run by typing 'make check' as a superuser of the running postgreSQL server. It creates testdb and some roles. Documents are not edited

Re: [HACKERS] make pg_controldata accept -D dirname

2014-10-24 Thread Michael Paquier
On Thu, Sep 25, 2014 at 12:38 PM, Heikki Linnakangas hlinnakan...@vmware.com wrote: On 09/24/2014 05:48 PM, Abhijit Menon-Sen wrote: Updated patches attached. Thanks, applied some version of these. This set of patches has been applied as b0d81ad but patch 0001 did not make it in, so

Re: [HACKERS] Function array_agg(array)

2014-10-24 Thread Pavel Stehule
Hi it looks well doc: http://www.postgresql.org/docs/9.4/static/sql-expressions.html#SQL-SYNTAX-ARRAY-CONSTRUCTORS it should be fixed too Regards Pavel 2014-10-24 10:24 GMT+02:00 Ali Akbar the.ap...@gmail.com: Updated patch attached. 2014-10-22 20:51 GMT+07:00 Pavel Stehule

Re: [HACKERS] Function array_agg(array)

2014-10-24 Thread Ali Akbar
2014-10-24 15:48 GMT+07:00 Pavel Stehule pavel.steh...@gmail.com: Hi it looks well doc: http://www.postgresql.org/docs/9.4/static/sql-expressions.html#SQL-SYNTAX-ARRAY-CONSTRUCTORS it should be fixed too Regards Pavel doc updated with additional example for array(subselect). patch

Re: [HACKERS] Function array_agg(array)

2014-10-24 Thread Pavel Stehule
Hi some in last patch is wrong, I cannot to compile it: arrayfuncs.c: In function ‘accumArrayResult’: arrayfuncs.c:4603:9: error: ‘ArrayBuildState’ has no member named ‘alen’ astate-alen = 64; /* arbitrary starting array size */ ^ arrayfuncs.c:4604:9: error: ‘ArrayBuildState’ has no

Re: [HACKERS] Function array_agg(array)

2014-10-24 Thread Ali Akbar
2014-10-24 16:26 GMT+07:00 Pavel Stehule pavel.steh...@gmail.com: Hi some in last patch is wrong, I cannot to compile it: arrayfuncs.c: In function ‘accumArrayResult’: arrayfuncs.c:4603:9: error: ‘ArrayBuildState’ has no member named ‘alen’ astate-alen = 64; /* arbitrary starting array

[HACKERS] ARMv5

2014-10-24 Thread Александр Глухов
Hello, I have a problem with PostgreSQL. I need to install PostgreSQL on ARMv5 with tcp/ip access, but I have no experience in it. I trying to do it in LTIB and now I need to create a postgresql.spec file. Could you help me in it? With best regards, Alexandr Glukhov    

[HACKERS] TODO: Helpful hint from psql on createdb

2014-10-24 Thread Craig Ringer
Hi all Following on from my recent patch about adding a hint to psql when you try to use it to apply a custom-format dump: http://www.postgresql.org/message-id/544096e0.5020...@2ndquadrant.com I think we should do the same for the command line tools, like createdb, createuser, etc. I've seen

Re: [HACKERS] detect custom-format dumps in psql and emit a useful error

2014-10-24 Thread Alvaro Herrera
Jeevan Chalke wrote: Regarding Directory Error: === I strongly against the proposal. This patch changing error message to something like this: psql:blah:0: Input path is a directory. Use pg_restore to restore directory-format database dumps. So even though I accidentally provide a

Re: [HACKERS] detect custom-format dumps in psql and emit a useful error

2014-10-24 Thread Andres Freund
On 2014-10-24 07:18:55 -0300, Alvaro Herrera wrote: Jeevan Chalke wrote: Regarding Directory Error: === I strongly against the proposal. This patch changing error message to something like this: psql:blah:0: Input path is a directory. Use pg_restore to restore directory-format

Re: [HACKERS] pg_receivexlog --status-interval add fsync feedback

2014-10-24 Thread furuyao
Sorry, I'm going around in the circle. But I'd like to say again, I don't think this is good idea. It prevents asynchronous pg_receivexlog from fsyncing WAL data and sending feedbacks more frequently at all. They are useful, for example, when we want to monitor the write location of

Re: [HACKERS] Wait free LW_SHARED acquisition - v0.2

2014-10-24 Thread Amit Kapila
On Wed, Oct 22, 2014 at 8:04 PM, Andres Freund and...@2ndquadrant.com wrote: On 2014-10-21 19:56:05 +0530, Amit Kapila wrote: On Wed, Oct 8, 2014 at 6:17 PM, Andres Freund and...@2ndquadrant.com wrote: spin_delay_count gives how much delay has happened to acquire spinlock which when

Re: [HACKERS] Wait free LW_SHARED acquisition - v0.2

2014-10-24 Thread Andres Freund
On 2014-10-24 15:59:30 +0530, Amit Kapila wrote: and w.r.t performance it can lead extra function call, few checks and I think in some cases even can acquire/release spinlock. I fail to see how that could be the case. Won't it happen incase first backend sets releaseOK to true and

Re: [HACKERS] Function array_agg(array)

2014-10-24 Thread Michael Paquier
On Fri, Oct 24, 2014 at 11:43 AM, Ali Akbar the.ap...@gmail.com wrote: 2014-10-24 16:26 GMT+07:00 Pavel Stehule pavel.steh...@gmail.com: Hi some in last patch is wrong, I cannot to compile it: arrayfuncs.c: In function 'accumArrayResult': arrayfuncs.c:4603:9: error: 'ArrayBuildState' has

Re: [HACKERS] Question about RI checks

2014-10-24 Thread Florian Pflug
On Oct23, 2014, at 17:45 , Kevin Grittner kgri...@ymail.com wrote: Every way I look at it, inside a REPEATABLE READ or SERIALIZABLE transaction a check for child rows when validating a parent DELETE should consider both rows which exist according to the transaction snapshot and according to a

Re: [HACKERS] Function array_agg(array)

2014-10-24 Thread Pavel Stehule
2014-10-24 11:43 GMT+02:00 Ali Akbar the.ap...@gmail.com: 2014-10-24 16:26 GMT+07:00 Pavel Stehule pavel.steh...@gmail.com: Hi some in last patch is wrong, I cannot to compile it: arrayfuncs.c: In function ‘accumArrayResult’: arrayfuncs.c:4603:9: error: ‘ArrayBuildState’ has no member

Re: [HACKERS] Function array_agg(array)

2014-10-24 Thread Pavel Stehule
Hi I did some performance tests and it is interesting: it is about 15% faster than original implementation. Regards Pavel 2014-10-24 13:58 GMT+02:00 Pavel Stehule pavel.steh...@gmail.com: 2014-10-24 11:43 GMT+02:00 Ali Akbar the.ap...@gmail.com: 2014-10-24 16:26 GMT+07:00 Pavel

Re: [HACKERS] Function array_agg(array)

2014-10-24 Thread Alvaro Herrera
Michael Paquier wrote: That's not surprising, sometimes filterdiff misses the shot. Really? Wow, that's bad news. I've been using it to submit patches from time to time ... -- Álvaro Herrerahttp://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training Services

Re: [HACKERS] BUG: *FF WALs under 9.2 (WAS: .ready files appearing on slaves)

2014-10-24 Thread Heikki Linnakangas
On 10/23/2014 11:09 AM, Heikki Linnakangas wrote: At least for master, we should consider changing the way the archiving works so that we only archive WAL that was generated in the same server. I.e. we should never try to archive WAL files belonging to another timeline. I just remembered that

Re: [HACKERS] Function array_agg(array)

2014-10-24 Thread Pavel Stehule
2014-10-24 13:58 GMT+02:00 Pavel Stehule pavel.steh...@gmail.com: 2014-10-24 11:43 GMT+02:00 Ali Akbar the.ap...@gmail.com: 2014-10-24 16:26 GMT+07:00 Pavel Stehule pavel.steh...@gmail.com: Hi some in last patch is wrong, I cannot to compile it: arrayfuncs.c: In function

Re: [HACKERS] btree_gin and ranges

2014-10-24 Thread Heikki Linnakangas
On 10/22/2014 03:01 PM, Teodor Sigaev wrote: Anyway GIN couldn't be used for ORDER BY clause. which would also be nice to fix... - Heikki -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription:

Re: [HACKERS] ARMv5

2014-10-24 Thread Merlin Moncure
On Wed, Oct 22, 2014 at 6:31 AM, Александр Глухов alexandrglu...@mail.ru wrote: Hello, I have a problem with PostgreSQL. I need to install PostgreSQL on ARMv5 with tcp/ip access, but I have no experience in it. I trying to do it in LTIB and now I need to create a postgresql.spec file. Could you

Re: [HACKERS] Deferring some AtStart* allocations?

2014-10-24 Thread Andres Freund
On 2014-10-23 12:04:40 -0400, Robert Haas wrote: On Tue, Oct 21, 2014 at 12:00 PM, Andres Freund and...@2ndquadrant.com wrote: On 2014-10-09 15:01:19 -0400, Robert Haas wrote: /* @@ -960,18 +966,38 @@ AtEOXact_Inval(bool isCommit) ... + /* + * We create

Re: [HACKERS] btree_gin and ranges

2014-10-24 Thread Heikki Linnakangas
On 10/22/2014 03:01 PM, Teodor Sigaev wrote: Anyway GIN couldn't be used for ORDER BY clause. which would also be nice to fix... - Heikki -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription:

Re: [HACKERS] BUG: *FF WALs under 9.2 (WAS: .ready files appearing on slaves)

2014-10-24 Thread Michael Paquier
On Fri, Oct 24, 2014 at 3:05 PM, Heikki Linnakangas hlinnakan...@vmware.com wrote: On 10/23/2014 11:09 AM, Heikki Linnakangas wrote: At least for master, we should consider changing the way the archiving works so that we only archive WAL that was generated in the same server. I.e. we should

Re: [HACKERS] Trailing comma support in SELECT statements

2014-10-24 Thread Alex Goncharov
On Tue, Oct 21, 2014 at 10:16 AM, Tom Lane t...@sss.pgh.pa.us wrote: (Of course, I'm not for the feature w.r.t. SQL either. But breaking data compatibility is just adding an entire new dimension of trouble. Another dimension of the trouble is breaking the operation of the tools that parse

Re: [HACKERS] Getting rid of accept incoming network connections prompts on OS X

2014-10-24 Thread Tom Lane
Michael Paquier michael.paqu...@gmail.com writes: On Fri, Oct 24, 2014 at 8:26 AM, Dave Page dp...@pgadmin.org wrote: On Fri, Oct 24, 2014 at 7:18 AM, Peter Eisentraut pete...@gmx.net wrote: On 10/21/14 1:16 PM, Tom Lane wrote: If you do any Postgres development on OS X, you've probably gotten

Re: [HACKERS] Deferring some AtStart* allocations?

2014-10-24 Thread Robert Haas
On Fri, Oct 24, 2014 at 9:17 AM, Andres Freund and...@2ndquadrant.com wrote: If that subtransaction abouts, AtEOSubXact_Inval() gets called again, sees that it has messages (that it inherited from the innermost subtransaction), and takes the exact same code-path that it would have pre-patch.

Re: [HACKERS] Re: Getting rid of accept incoming network connections prompts on OS X

2014-10-24 Thread Robert Haas
On Wed, Oct 22, 2014 at 2:14 AM, edward745 cedward...@gmail.com wrote: One of the queries in ri_triggers.c has be a little baffled. For (relatively) obvious reasons, a FK insert triggers a SELECT 1 FROM pk_rel ... FOR KEY SHARE. For not-so-obvious reasons, a PK delete triggers a SELECT 1 FROM

Re: [HACKERS] [Windows,PATCH] Use faster, higher precision timer API

2014-10-24 Thread Robert Haas
On Fri, Oct 24, 2014 at 1:42 AM, Craig Ringer cr...@2ndquadrant.com wrote: On 10/23/2014 09:21 PM, Robert Haas wrote: Agreed - I think if you want an error check here it should use elog() or ereport(), not Assert(). That's what I originally did, but it's too early for elog. I'm reluctant to

Re: [HACKERS] Getting rid of accept incoming network connections prompts on OS X

2014-10-24 Thread Michael Paquier
On Fri, Oct 24, 2014 at 3:39 PM, Tom Lane t...@sss.pgh.pa.us wrote: Peter, Dave: maybe you have tweaked things to keep listen_addresses empty and rely only on Unix-socket connections? Should be so. The target of this feature is development on OSX, right? And most of the time development would be

Re: [HACKERS] Deferring some AtStart* allocations?

2014-10-24 Thread Andres Freund
On 2014-10-24 09:45:59 -0400, Robert Haas wrote: On Fri, Oct 24, 2014 at 9:17 AM, Andres Freund and...@2ndquadrant.com wrote: If that subtransaction abouts, AtEOSubXact_Inval() gets called again, sees that it has messages (that it inherited from the innermost subtransaction), and takes

Re: [HACKERS] uninitialized values in revised prepared xact code

2014-10-24 Thread Heikki Linnakangas
On 10/11/2014 10:20 PM, Bruce Momjian wrote: Uh, was this fixed. I see a cleanup commit for this C file, but this report is from June: commit 07a4a93a0e35a778c77ffbbbc18de29e859e18f0 Author: Heikki Linnakangas heikki.linnakan...@iki.fi Date: Fri May 16 09:47:50 2014

Re: [HACKERS] pg_receivexlog --status-interval add fsync feedback

2014-10-24 Thread Heikki Linnakangas
On 10/24/2014 01:24 PM, furu...@pm.nttdata.co.jp wrote: Sorry, I'm going around in the circle. But I'd like to say again, I don't think this is good idea. It prevents asynchronous pg_receivexlog from fsyncing WAL data and sending feedbacks more frequently at all. They are useful, for example,

Re: [HACKERS] Getting rid of accept incoming network connections prompts on OS X

2014-10-24 Thread Tom Lane
Michael Paquier michael.paqu...@gmail.com writes: On Fri, Oct 24, 2014 at 3:39 PM, Tom Lane t...@sss.pgh.pa.us wrote: Peter, Dave: maybe you have tweaked things to keep listen_addresses empty and rely only on Unix-socket connections? Should be so. The target of this feature is development on

Re: [HACKERS] Reducing lock strength of adding foreign keys

2014-10-24 Thread Robert Haas
On Wed, Oct 22, 2014 at 3:06 AM, Andreas Karlsson andr...@proxel.se wrote: I have been thinking about why we need to grab an AccessExclusiveLock on the table with the PK when we add a foreign key. Adding new tables with foreign keys to old ones is common so it would be really nice if the lock

Re: [HACKERS] make pg_controldata accept -D dirname

2014-10-24 Thread Heikki Linnakangas
On 10/24/2014 11:36 AM, Michael Paquier wrote: On Thu, Sep 25, 2014 at 12:38 PM, Heikki Linnakangas hlinnakan...@vmware.com wrote: On 09/24/2014 05:48 PM, Abhijit Menon-Sen wrote: Updated patches attached. Thanks, applied some version of these. This set of patches has been applied as

Re: [HACKERS] Question about RI checks

2014-10-24 Thread Robert Haas
On Thu, Oct 23, 2014 at 2:41 PM, Florian Pflug f...@phlo.org wrote: The only reason we need the crosscheck snapshot to do that is because children may have been added (and the change committed) *after* the transaction which removed the parent has taken its snapshot, but *before* that

Re: [HACKERS] INSERT ... ON CONFLICT {UPDATE | IGNORE}

2014-10-24 Thread Robert Haas
On Thu, Oct 23, 2014 at 9:43 PM, Peter Geoghegan p...@heroku.com wrote: * CONFLICTING() is renamed to EXCLUDED(). I know that some people wanted me to go a different way with this. I think that there are very good practical reasons not to [1], as well as good reasons related to design, but I

Re: [HACKERS] pg_background (and more parallelism infrastructure patches)

2014-10-24 Thread Jim Nasby
On 10/22/14, 7:49 PM, Joshua D. Drake wrote: I lean toward a push into core because: +1 3. I am not sure I buy into the super-user argument. Just because the functionality is there, doesn't mean it has to be used. It's a valid concern, but I think the way to handle it if needed is to

Re: [HACKERS] INSERT ... ON CONFLICT {UPDATE | IGNORE}

2014-10-24 Thread Josh Berkus
On 10/24/2014 10:04 AM, Robert Haas wrote: As far as syntax goes, I thought the INSERT .. ON CONFLICT UPDATE syntax proposed upthread was the best of any mentioned thus far. The MERGE-based syntaxes proposed upthread were crazily verbose for no discernable benefit. For those of us who

Re: [HACKERS] Question about RI checks

2014-10-24 Thread Florian Pflug
On Oct24, 2014, at 18:42 , Robert Haas robertmh...@gmail.com wrote: I don't think you can count on being able to figure out all of the recent lockers by looking at xmax; it can get overwritten. For example, suppose transaction A locks the row and then commits. Then transaction B comes along

Re: [HACKERS] pg_background (and more parallelism infrastructure patches)

2014-10-24 Thread Robert Haas
On Fri, Oct 24, 2014 at 1:13 PM, Jim Nasby jim.na...@bluetreble.com wrote: It's a valid concern, but I think the way to handle it if needed is to limit the number of connections a user can open. Or perhaps another option would be to change the permissions on the related functions (do we check

Re: [HACKERS] INSERT ... ON CONFLICT {UPDATE | IGNORE}

2014-10-24 Thread Robert Haas
On Fri, Oct 24, 2014 at 1:18 PM, Josh Berkus j...@agliodbs.com wrote: On 10/24/2014 10:04 AM, Robert Haas wrote: As far as syntax goes, I thought the INSERT .. ON CONFLICT UPDATE syntax proposed upthread was the best of any mentioned thus far. The MERGE-based syntaxes proposed upthread were

Re: [HACKERS] Question about RI checks

2014-10-24 Thread Robert Haas
On Fri, Oct 24, 2014 at 1:28 PM, Florian Pflug f...@phlo.org wrote: The only other option I see would be so teach the executor to check whether *any* snapshot between the transaction's snapshot and a current snapshot would see a different set of rows. Simply checking whether both the current

Re: [HACKERS] Typo fixes for pg_recvlogical documentation

2014-10-24 Thread Robert Haas
On Thu, Oct 23, 2014 at 10:00 AM, Michael Paquier michael.paqu...@gmail.com wrote: pg_recvlogical is missing some = signs for a couple of option names where double-dash is used, like this one: --username user should be that: --username=user Attached is a patch correcting that. For reasons

Re: [HACKERS] Materialized views don't show up in information_schema

2014-10-24 Thread Robert Haas
On Fri, Oct 17, 2014 at 8:10 PM, Stephen Frost sfr...@snowman.net wrote: * Peter Eisentraut (pete...@gmx.net) wrote: On 10/16/14 9:45 AM, Stephen Frost wrote: Alright, coming back to this, I have to ask- how are matviews different from views from the SQL standard's perspective? I tried

Re: [HACKERS] BUG: *FF WALs under 9.2 (WAS: .ready files appearing on slaves)

2014-10-24 Thread Robert Haas
On Fri, Oct 24, 2014 at 9:05 AM, Heikki Linnakangas hlinnakan...@vmware.com wrote: So, this is what I came up with for master. Does anyone see a problem with it? In the proposed commit message, you mis-spelled significant as signicant. -- Robert Haas EnterpriseDB: http://www.enterprisedb.com

[HACKERS] How ugly would this be? (ALTER DATABASE)

2014-10-24 Thread Joshua D. Drake
Hello, One of the things we run into quite a bit is customers who are using multiple databases when they should be using multiple schemas. I am sure other consultants run into this as well. This gets even more difficult as uptime requirements have become all but 100%. So my question is, what

Re: [HACKERS] Question about RI checks

2014-10-24 Thread Florian Pflug
On Oct24, 2014, at 19:32 , Robert Haas robertmh...@gmail.com wrote: On Fri, Oct 24, 2014 at 1:28 PM, Florian Pflug f...@phlo.org wrote: The only other option I see would be so teach the executor to check whether *any* snapshot between the transaction's snapshot and a current snapshot would see

Re: [HACKERS] How ugly would this be? (ALTER DATABASE)

2014-10-24 Thread Robert Haas
On Fri, Oct 24, 2014 at 2:06 PM, Joshua D. Drake j...@commandprompt.com wrote: One of the things we run into quite a bit is customers who are using multiple databases when they should be using multiple schemas. I am sure other consultants run into this as well. This gets even more difficult as

Re: [HACKERS] Question about RI checks

2014-10-24 Thread Robert Haas
On Fri, Oct 24, 2014 at 2:12 PM, Florian Pflug f...@phlo.org wrote: What about doing one scan using SnapshotAny and then testing each returned row for visibility under both relevant snapshots? See whether there is any tuple for which they disagree. See my other mail - testing whether the

Re: [HACKERS] Function array_agg(array)

2014-10-24 Thread Pavel Stehule
Hi Ali I checked a code. I am thinking so code organization is not good. accumArrayResult is too long now. makeMdArrayResult will not work, when arrays was joined (it is not consistent now). I don't like a usage of state-is_array_accum in array_userfunc.c -- it is signal of wrong wrapping. next

Re: [HACKERS] Question about RI checks

2014-10-24 Thread Florian Pflug
On Oct24, 2014, at 20:24 , Robert Haas robertmh...@gmail.com wrote: On Fri, Oct 24, 2014 at 2:12 PM, Florian Pflug f...@phlo.org wrote: What about doing one scan using SnapshotAny and then testing each returned row for visibility under both relevant snapshots? See whether there is any tuple

Re: [HACKERS] INSERT ... ON CONFLICT {UPDATE | IGNORE}

2014-10-24 Thread Peter Geoghegan
On Fri, Oct 24, 2014 at 10:04 AM, Robert Haas robertmh...@gmail.com wrote: On Thu, Oct 23, 2014 at 9:43 PM, Peter Geoghegan p...@heroku.com wrote: * CONFLICTING() is renamed to EXCLUDED(). I know that some people wanted me to go a different way with this. I think that there are very good

Re: [HACKERS] pg_background (and more parallelism infrastructure patches)

2014-10-24 Thread Jim Nasby
On 10/24/14, 12:21 PM, Robert Haas wrote: On Fri, Oct 24, 2014 at 1:13 PM, Jim Nasby jim.na...@bluetreble.com wrote: It's a valid concern, but I think the way to handle it if needed is to limit the number of connections a user can open. Or perhaps another option would be to change the

Re: [HACKERS] pg_background (and more parallelism infrastructure patches)

2014-10-24 Thread Jim Nasby
On 10/24/14, 2:23 PM, Jim Nasby wrote: On the serialization structure itself, should we be worried about a mismatch between available GUCs on the sender vs the receiver? Presumably if the sender outputs a GUC that the receiver doesn't know about we'll get an error, but what if the sender

Re: [HACKERS] INSERT ... ON CONFLICT {UPDATE | IGNORE}

2014-10-24 Thread Robert Haas
On Fri, Oct 24, 2014 at 3:01 PM, Peter Geoghegan p...@heroku.com wrote: This is the situation with unique index inference all over again. You don't like a function-like expression. Okay. It would be a lot more helpful if instead of just criticizing, you *also* looked at my reasons for not

Re: [HACKERS] pg_background (and more parallelism infrastructure patches)

2014-10-24 Thread Robert Haas
On Fri, Oct 24, 2014 at 3:23 PM, Jim Nasby jim.na...@bluetreble.com wrote: Here's a review of patch 4. Thanks! Perhaps it would be good to document the serialization format. I at least would have found it helpful, especially when reading estimate_variable_size(). I can take a stab at that if

Re: [HACKERS] pg_background (and more parallelism infrastructure patches)

2014-10-24 Thread Robert Haas
On Fri, Oct 24, 2014 at 3:30 PM, Jim Nasby jim.na...@bluetreble.com wrote: On 10/24/14, 2:23 PM, Jim Nasby wrote: On the serialization structure itself, should we be worried about a mismatch between available GUCs on the sender vs the receiver? Presumably if the sender outputs a GUC that the

Re: [HACKERS] Question about RI checks

2014-10-24 Thread Robert Haas
On Fri, Oct 24, 2014 at 2:58 PM, Florian Pflug f...@phlo.org wrote: I believe the best way forward is to first find a solution for SERIALIZABLE transactions, and then check if it can be applied to REPEATABLE READ mode too. For SERIALIZABLE mode, it's at least clear what we're aiming for --

Re: [HACKERS] pg_background (and more parallelism infrastructure patches)

2014-10-24 Thread Jim Nasby
On 10/24/14, 12:21 PM, Robert Haas wrote: - What should we call dsm_unkeep_mapping, if not that? Only option I can think of beyond unkeep would be dsm_(un)register_keep_mapping. Dunno that it's worth it. - Does anyone have a tangible suggestion for how to reduce the code duplication in

Re: [HACKERS] Question about RI checks

2014-10-24 Thread Kevin Grittner
Florian Pflug f...@phlo.org wrote: On Oct24, 2014, at 20:24 , Robert Haas robertmh...@gmail.com wrote: On Fri, Oct 24, 2014 at 2:12 PM, Florian Pflug f...@phlo.org wrote: What about doing one scan using SnapshotAny and then testing each returned row for visibility under both relevant

Re: [HACKERS] pg_background (and more parallelism infrastructure patches)

2014-10-24 Thread Jim Nasby
On 10/24/14, 3:26 PM, Robert Haas wrote: On Fri, Oct 24, 2014 at 3:30 PM, Jim Nasby jim.na...@bluetreble.com wrote: On 10/24/14, 2:23 PM, Jim Nasby wrote: On the serialization structure itself, should we be worried about a mismatch between available GUCs on the sender vs the receiver?

Re: [HACKERS] pg_background (and more parallelism infrastructure patches)

2014-10-24 Thread Robert Haas
On Fri, Oct 24, 2014 at 4:46 PM, Jim Nasby jim.na...@bluetreble.com wrote: On 10/24/14, 12:21 PM, Robert Haas wrote: - What should we call dsm_unkeep_mapping, if not that? Only option I can think of beyond unkeep would be dsm_(un)register_keep_mapping. Dunno that it's worth it. Hmm, we could

Re: [HACKERS] pg_background (and more parallelism infrastructure patches)

2014-10-24 Thread Robert Haas
On Fri, Oct 24, 2014 at 4:53 PM, Jim Nasby jim.na...@bluetreble.com wrote: The only case I can think of would be actually connecting to a remote database; in that case would we even want something as raw as this? I suspect not, in which case I don't see an issue. On the other hand, if we ever

Re: [HACKERS] Typo fixes for pg_recvlogical documentation

2014-10-24 Thread Michael Paquier
On Fri, Oct 24, 2014 at 7:42 PM, Robert Haas robertmh...@gmail.com wrote: [rhaas pgsql]$ patch -p1 ~/Downloads/20141023_pg_recvlogical_fixes.patch patching file doc/src/sgml/ref/pg_recvlogical.sgml Hunk #1 succeeded at 270 with fuzz 1 (offset 165 lines). Hunk #2 FAILED at 282. Hunk #3 FAILED

Re: [HACKERS] Question about RI checks

2014-10-24 Thread Florian Pflug
On Oct24, 2014, at 22:50 , Kevin Grittner kgri...@ymail.com wrote: I need to spend some more time looking at it, and I have another couple things in front of this on my personal TODO list, but I think that if we had a row lock which was stronger than current SELECT FOR UPDATE behavior, and the

Re: [HACKERS] INSERT ... ON CONFLICT {UPDATE | IGNORE}

2014-10-24 Thread Peter Geoghegan
On Fri, Oct 24, 2014 at 1:07 PM, Robert Haas robertmh...@gmail.com wrote: The problem here isn't that I haven't read your emails. I have read them all, including that one. Moreover, this isn't the first time you've asserted that someone hasn't read one of your emails. So if we're going to

Re: [HACKERS] pg_background (and more parallelism infrastructure patches)

2014-10-24 Thread Petr Jelinek
On 24/10/14 23:03, Robert Haas wrote: On Fri, Oct 24, 2014 at 4:46 PM, Jim Nasby jim.na...@bluetreble.com wrote: On 10/24/14, 12:21 PM, Robert Haas wrote: - What should we call dsm_unkeep_mapping, if not that? Only option I can think of beyond unkeep would be dsm_(un)register_keep_mapping.

Re: [HACKERS] pg_background (and more parallelism infrastructure patches)

2014-10-24 Thread Jim Nasby
On 10/24/14, 4:03 PM, Robert Haas wrote: On Fri, Oct 24, 2014 at 4:46 PM, Jim Nasby jim.na...@bluetreble.com wrote: On 10/24/14, 12:21 PM, Robert Haas wrote: - What should we call dsm_unkeep_mapping, if not that? Only option I can think of beyond unkeep would be

Re: [HACKERS] pg_background (and more parallelism infrastructure patches)

2014-10-24 Thread Petr Jelinek
On 24/10/14 23:07, Robert Haas wrote: On Fri, Oct 24, 2014 at 4:53 PM, Jim Nasby jim.na...@bluetreble.com wrote: The only case I can think of would be actually connecting to a remote database; in that case would we even want something as raw as this? I suspect not, in which case I don't see an

Re: [HACKERS] How ugly would this be? (ALTER DATABASE)

2014-10-24 Thread Jim Nasby
On 10/24/14, 1:28 PM, Robert Haas wrote: On Fri, Oct 24, 2014 at 2:06 PM, Joshua D. Drake j...@commandprompt.com wrote: One of the things we run into quite a bit is customers who are using multiple databases when they should be using multiple schemas. I am sure other consultants run into this

Re: [HACKERS] INSERT ... ON CONFLICT {UPDATE | IGNORE}

2014-10-24 Thread Petr Jelinek
On 25/10/14 00:48, Peter Geoghegan wrote: You're conflating the user-visible syntax with the parse tree representation in way that is utterly without foundation. I don't have a position at this point on which parse-analysis representation is preferable, but it's completely wrong-headed to say

Re: [HACKERS] INSERT ... ON CONFLICT {UPDATE | IGNORE}

2014-10-24 Thread Peter Geoghegan
On Fri, Oct 24, 2014 at 4:39 PM, Petr Jelinek p...@2ndquadrant.com wrote: If you feel so strongly that it's wrong even though everybody else seems to prefer it and if you at the same time feel so strongly about people changing minds once you implement this, maybe the best way to convince us is

Re: [HACKERS] ExclusiveLock on extension of relation with huge shared_buffers

2014-10-24 Thread Jim Nasby
Please don't top-post. On 10/24/14, 3:40 AM, Borodin Vladimir wrote: I have taken some backtraces (they are attached to the letter) of two processes with such command: pid=17981; while true; do date; gdb -batch -e back /usr/pgsql-9.4/bin/postgres $pid; echo; echo; echo; echo; sleep 0.1; done

Re: [HACKERS] superuser() shortcuts

2014-10-24 Thread Jim Nasby
On 10/23/14, 6:23 PM, Alvaro Herrera wrote: Brightwell, Adam wrote: If we were to make it consistent and use the old wording, what do you think about providing an errhint as well? Perhaps for example in slotfuncs.c#pg_create_physical_replication_stot: errmsg - permission denied to create

[HACKERS] Comment patch for bgworker.c

2014-10-24 Thread Jim Nasby
The comment for the BackgroundWorkerSlot structure tripped me up reviewing Robert's background worker patch; it made it clear that you need to use a memory barrier before setting in_use, but normally you'd never need to worry about that because RegisterDynamicBackgroundWorker() handles it for

[HACKERS] Comment in outfunc.c

2014-10-24 Thread Tatsuo Ishii
Hi, I saw this comment in _outQuery() in outfuncs.c: WRITE_ENUM_FIELD(commandType, CmdType); WRITE_ENUM_FIELD(querySource, QuerySource); /* we intentionally do not print the queryId field */ WRITE_BOOL_FIELD(canSetTag); What is the resoning behind the comment?

Re: [HACKERS] Comment in outfunc.c

2014-10-24 Thread Tom Lane
Tatsuo Ishii is...@postgresql.org writes: I saw this comment in _outQuery() in outfuncs.c: WRITE_ENUM_FIELD(commandType, CmdType); WRITE_ENUM_FIELD(querySource, QuerySource); /* we intentionally do not print the queryId field */ WRITE_BOOL_FIELD(canSetTag); What is

[HACKERS] security barrier INSERT

2014-10-24 Thread Drew Crawford
Hi guys, I’m seeing some non-intuitive behavior with the new updateable security barrier views in 9.4. Below is the behavior of 9.4b3: =# create table widget ( id integer); CREATE TABLE =# create view widget_sb WITH (security_barrier=true) AS SELECT * from widget where id = 22; CREATE

Re: [HACKERS] security barrier INSERT

2014-10-24 Thread Brightwell, Adam
Drew, IMHO this is nonintuitive, the intuitive behavior of a security_barrier view should be to forbid inserting rows that can’t appear in the view. Isn't that what WITH CHECK OPTION is meant to accomplish? -Adam -- Adam Brightwell - adam.brightw...@crunchydatasolutions.com Database

Re: [HACKERS] How ugly would this be? (ALTER DATABASE)

2014-10-24 Thread Robert Haas
On Fri, Oct 24, 2014 at 7:37 PM, Jim Nasby jim.na...@bluetreble.com wrote: ISTM that the multiple-databases-per-backend issue is the huge hang-up here. Maybe there's some way that could be hacked around if you're just re-jiggering a bunch of catalog stuff (assuming you lock users out of both