Re: [HACKERS] Adding support for Default partition in partitioning

2017-06-15 Thread Amit Langote
Oops, I meant to send one more comment. On 2017/06/15 15:48, Amit Langote wrote: > BTW, I noticed the following in 0002 +errmsg("there exists a default partition for table \"%s\", cannot add a new partition", This error message style seems novel to me. I'

Re: [HACKERS] A bug in mapping attributes in ATExecAttachPartition()

2017-06-15 Thread Ashutosh Bapat
On Thu, Jun 15, 2017 at 10:46 AM, Amit Langote wrote: > Thanks for taking a look. > > On 2017/06/14 20:06, Ashutosh Bapat wrote: >> On Wed, Jun 14, 2017 at 9:20 AM, Amit Langote >> wrote: >>> >>> By the way, I mentioned an existing problem in one of the earlier emails >>> on this thread about dif

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

2017-06-15 Thread Shubham Barai
On 15 June 2017 at 07:23, Alvaro Herrera wrote: > Shubham Barai wrote: > > Hi, > > > > I have made some changes in tests and pushed them to my branch. > > > > Thanks for helping me out with testing. > > > > Now, current head produces false positives but, with my patch, it > doesn't. > > > > Here

Re: [HACKERS] Race conditions with WAL sender PID lookups

2017-06-15 Thread Kyotaro HORIGUCHI
Hi, At Thu, 8 Jun 2017 13:15:02 +0900, Michael Paquier wrote in > On Thu, Jun 8, 2017 at 3:31 AM, Robert Haas wrote: > > I think if you're going to fix it so that we take spinlocks on > > MyWalSnd in a bunch of places that we didn't take them before, it > > would make sense to fix all the plac

Re: [HACKERS] Race conditions with WAL sender PID lookups

2017-06-15 Thread Simon Riggs
On 15 June 2017 at 02:59, Noah Misch wrote: > Formally, the causative commit is the one that removed the superuser() test, > namely 25fff40. > > [Action required within three days. This is a generic notification.] > > The above-described topic is currently a PostgreSQL 10 open item. Simon, > si

Re: [HACKERS] A bug in mapping attributes in ATExecAttachPartition()

2017-06-15 Thread Amit Langote
Thanks for the review. On 2017/06/15 16:08, Ashutosh Bapat wrote: > On Thu, Jun 15, 2017 at 10:46 AM, Amit Langote wrote: >> If we end up having to perform the validation scan and the table being >> attached is a partitioned table, we will scan its leaf partitions. Each >> of those leaf partition

[HACKERS] Missing comment for create_modifytable_path

2017-06-15 Thread Etsuro Fujita
While working on adding support for tuple routing for foreign partitions, I noticed that in create_modifytable_path, we forgot to add a comment on its new argument 'partitioned_rels'. Attached a patch for including that in the comments for that function. Best regards, Etsuro Fujita diff --git

Re: [HACKERS] A bug in mapping attributes in ATExecAttachPartition()

2017-06-15 Thread Ashutosh Bapat
On Thu, Jun 15, 2017 at 2:12 PM, Amit Langote wrote: > Thanks for the review. > > On 2017/06/15 16:08, Ashutosh Bapat wrote: >> On Thu, Jun 15, 2017 at 10:46 AM, Amit Langote wrote: >>> If we end up having to perform the validation scan and the table being >>> attached is a partitioned table, we w

[HACKERS] Typo in comment in ecpg datetime.c

2017-06-15 Thread Daniel Gustafsson
Spotted s/fiedls/fields/ in src/interfaces/ecpg/pgtypeslib/datetime.c per the attached patch. cheers ./daniel typo-ecpg_datetime.patch Description: Binary data -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org

Re: [HACKERS] A bug in mapping attributes in ATExecAttachPartition()

2017-06-15 Thread Amit Langote
On 2017/06/15 17:53, Ashutosh Bapat wrote: > On Thu, Jun 15, 2017 at 2:12 PM, Amit Langote wrote: >>> Both of the above comments are not related to the bug that is being fixed, >>> but >>> they apply to the same code where the bug exists. So instead of fixing it >>> twice, may be we should expand

Re: [HACKERS] A bug in mapping attributes in ATExecAttachPartition()

2017-06-15 Thread Ashutosh Bapat
On Thu, Jun 15, 2017 at 2:30 PM, Amit Langote wrote: > On 2017/06/15 17:53, Ashutosh Bapat wrote: >> On Thu, Jun 15, 2017 at 2:12 PM, Amit Langote wrote: Both of the above comments are not related to the bug that is being fixed, but they apply to the same code where the bug exists.

Re: [HACKERS] Broken hint bits (freeze)

2017-06-15 Thread Amit Kapila
On Wed, Jun 14, 2017 at 8:44 PM, Bruce Momjian wrote: > On Wed, Jun 14, 2017 at 07:45:17PM +0530, Amit Kapila wrote: >> > Now, it seems we later added a doc section early on that talks about >> > "Verify standby servers" so I have moved the wal_level section into that >> > block, which should be s

Re: [HACKERS] A bug in mapping attributes in ATExecAttachPartition()

2017-06-15 Thread Amit Langote
On 2017/06/15 18:05, Ashutosh Bapat wrote: > On Thu, Jun 15, 2017 at 2:30 PM, Amit Langote > wrote: >> On 2017/06/15 17:53, Ashutosh Bapat wrote: >>> On Thu, Jun 15, 2017 at 2:12 PM, Amit Langote wrote: > Both of the above comments are not related to the bug that is being > fixed, but >>>

Re: [HACKERS] Regarding Postgres Dynamic Shared Memory (DSA)

2017-06-15 Thread Thomas Munro
On Thu, Jun 15, 2017 at 6:32 PM, Mahi Gurram wrote: > Followed the same as per your suggestion. Refer the code snippet below: > >> void >> _PG_init(void){ >> RequestAddinShmemSpace(1); >> PreviousShmemHook = shmem_startup_hook; >>shmem_startup_hook = BufferShmemHook; >> } >

[HACKERS] Making server name part of the startup message

2017-06-15 Thread Satyanarayana Narlapuram
As a cloud service, Azure Database for PostgreSQL uses a gateway proxy to route connections to a node hosting the actual server. To do that, the proxy needs to know the name of the server it tries to locate. As a work-around we currently overload the username parameter to pass in the server name

[HACKERS] Adding connection id in the startup message

2017-06-15 Thread Satyanarayana Narlapuram
As a cloud service, Azure Database for PostgreSQL uses a gateway proxy to route connections to a node hosting the actual server. Potentially there could be multiple hops (for example client, optional proxy at the client like pgbouncer for connection pooling, Azure gateway proxy, backend server)

Re: [HACKERS] Detection of IPC::Run presence in SSL TAP tests

2017-06-15 Thread Peter Eisentraut
On 6/13/17 03:49, Michael Paquier wrote: > 001_ssltests.pl in src/test/ssl/ includes the following to skip all > tests should IPC::Run be not available: We used to have stanzas like that elsewhere but then removed them in favor of the configure option. It looks like this was forgotten. I have co

Re: [HACKERS] intermittent failures in Cygwin from select_parallel tests

2017-06-15 Thread Amit Kapila
On Thu, Jun 15, 2017 at 3:31 AM, Tom Lane wrote: > I wrote: >> But surely the silent treatment should only apply to DSM_OP_CREATE? > > Oh ... scratch that, it *does* only apply to DSM_OP_CREATE. > > The lack of any other message before the 'could not map' failure must, > then, mean that dsm_attach

Re: [HACKERS] Adding connection id in the startup message

2017-06-15 Thread Peter Eisentraut
On 6/15/17 03:11, Satyanarayana Narlapuram wrote: > Client adds a connection id in the startup message and send it to the > server it is trying to connect to. Proxy logs the connection id > information in its logs, and passes it to the server. Server logs the > connection Id in the server log, and

Re: [HACKERS] Disallowing multiple queries per PQexec()

2017-06-15 Thread Daniel Verite
Fabien COELHO wrote: > I'm not fully convinced by this feature: using multiple queries is a > useful trick to reduce network-related latency by combining several > queries in one packet. Devs and even ORMs could use this trick. It's proposed as an option. For apps that intentionally put

Re: [HACKERS] Adding connection id in the startup message

2017-06-15 Thread Stephen Frost
* Peter Eisentraut (peter.eisentr...@2ndquadrant.com) wrote: > On 6/15/17 03:11, Satyanarayana Narlapuram wrote: > > Client adds a connection id in the startup message and send it to the > > server it is trying to connect to. Proxy logs the connection id > > information in its logs, and passes it t

Re: [HACKERS] Making server name part of the startup message

2017-06-15 Thread Tom Lane
Satyanarayana Narlapuram writes: > As a cloud service, Azure Database for PostgreSQL uses a gateway proxy to > route connections to a node hosting the actual server. To do that, the proxy > needs to know the name of the server it tries to locate. As a work-around we > currently overload the use

Re: [HACKERS] Making server name part of the startup message

2017-06-15 Thread Peter Eisentraut
On 6/15/17 03:20, Satyanarayana Narlapuram wrote: > As a cloud service, Azure Database for PostgreSQL uses a gateway proxy > to route connections to a node hosting the actual server. To do that, > the proxy needs to know the name of the server it tries to locate. As a > work-around we currently ove

Re: [HACKERS] Typo in comment in ecpg datetime.c

2017-06-15 Thread Peter Eisentraut
On 6/15/17 04:54, Daniel Gustafsson wrote: > Spotted s/fiedls/fields/ in src/interfaces/ecpg/pgtypeslib/datetime.c per the > attached patch. fixed -- Peter Eisentraut http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services -- Sent via pgs

Re: [HACKERS] Adding connection id in the startup message

2017-06-15 Thread Tom Lane
Satyanarayana Narlapuram writes: > As a cloud service, Azure Database for PostgreSQL uses a gateway proxy to > route connections to a node hosting the actual server. Potentially there > could be multiple hops (for example client, optional proxy at the client like > pgbouncer for connection pool

Re: [HACKERS] Refreshing subscription relation state inside a transaction block

2017-06-15 Thread Peter Eisentraut
On 6/15/17 02:41, Petr Jelinek wrote: > Hmm, forcibly stopping currently running table sync is not what was > intended, I'll have to look into it. We should not be forcibly stopping > anything except the main apply worker during drop subscription (and we > do that only because we can't drop the rem

Re: [HACKERS] intermittent failures in Cygwin from select_parallel tests

2017-06-15 Thread Robert Haas
On Wed, Jun 14, 2017 at 6:01 PM, Tom Lane wrote: > I wrote: >> But surely the silent treatment should only apply to DSM_OP_CREATE? > > Oh ... scratch that, it *does* only apply to DSM_OP_CREATE. > > The lack of any other message before the 'could not map' failure must, > then, mean that dsm_attach

Re: [HACKERS] intermittent failures in Cygwin from select_parallel tests

2017-06-15 Thread Tom Lane
Robert Haas writes: > On Wed, Jun 14, 2017 at 6:01 PM, Tom Lane wrote: >> The lack of any other message before the 'could not map' failure must, >> then, mean that dsm_attach() couldn't find an entry in shared memory >> that it wanted to attach to. But how could that happen? > Well, as Amit poi

Re: [HACKERS] intermittent failures in Cygwin from select_parallel tests

2017-06-15 Thread Robert Haas
On Thu, Jun 15, 2017 at 10:05 AM, Tom Lane wrote: >> Well, as Amit points out, there are entirely legitimate ways for that >> to happen. If the leader finishes the whole query itself before the >> worker reaches the dsm_attach() call, it will call dsm_detach(), >> destroying the segment, and the

Re: [HACKERS] Disallowing multiple queries per PQexec()

2017-06-15 Thread Daniel Verite
Andres Freund wrote: > Since it's an application writer's choice whether to use it, > it seems to make not that much sense to have a > serverside guc - it can't really be sensible set. The application writers who are concerned by this wouldn't know that they have a choice. If there were i

Re: [HACKERS] Getting server crash on Windows when using ICU collation

2017-06-15 Thread Amit Kapila
On Mon, Jun 12, 2017 at 10:08 AM, Ashutosh Sharma wrote: > PFA patch that fixes the issue described in above thread. As mentioned > in the above thread, the crash is basically happening in varstr_cmp() > function and it's only happening on Windows because in varstr_cmp(), > if the collation prov

Re: [HACKERS] WIP Patch: Pgbench Serialization and deadlock errors

2017-06-15 Thread Robert Haas
On Wed, Jun 14, 2017 at 4:48 AM, Marina Polyakova wrote: > Now in pgbench we can test only transactions with Read Committed isolation > level because client sessions are disconnected forever on serialization > failures. There were some proposals and discussions about it (see message > here [1] and

Re: [HACKERS] intermittent failures in Cygwin from select_parallel tests

2017-06-15 Thread Amit Kapila
On Thu, Jun 15, 2017 at 7:42 PM, Robert Haas wrote: > On Thu, Jun 15, 2017 at 10:05 AM, Tom Lane wrote: >>> Well, as Amit points out, there are entirely legitimate ways for that >>> to happen. If the leader finishes the whole query itself before the >>> worker reaches the dsm_attach() call, it w

Re: [HACKERS] WIP Patch: Pgbench Serialization and deadlock errors

2017-06-15 Thread Marina Polyakova
Sounds like a good idea. Thank you! Please add to the next CommitFest Done: https://commitfest.postgresql.org/14/1170/ and review somebody else's patch in exchange for having your own patch reviewed. Of course, I remember about it. -- Marina Polyakova Postgres Professional: http://www.p

Re: [HACKERS] memory fields from getrusage()

2017-06-15 Thread Robert Haas
On Wed, Jun 14, 2017 at 6:28 PM, Justin Pryzby wrote: > On Tue, Jun 13, 2017 at 12:16:00PM -0400, Robert Haas wrote: >> It might be worth adding platform-specific code for common platforms. > > All I care (which linux happily/happens to support) is maxrss; I was probably > originally interested in

Re: [HACKERS] intermittent failures in Cygwin from select_parallel tests

2017-06-15 Thread Tom Lane
Robert Haas writes: > On Thu, Jun 15, 2017 at 10:05 AM, Tom Lane wrote: >> But we know, from the subsequent failed assertion, that the leader was >> still trying to launch parallel workers. So that particular theory >> doesn't hold water. > Is there any chance that it's already trying to launch

Re: [HACKERS] intermittent failures in Cygwin from select_parallel tests

2017-06-15 Thread Robert Haas
On Thu, Jun 15, 2017 at 10:32 AM, Tom Lane wrote: > Robert Haas writes: >> On Thu, Jun 15, 2017 at 10:05 AM, Tom Lane wrote: >>> But we know, from the subsequent failed assertion, that the leader was >>> still trying to launch parallel workers. So that particular theory >>> doesn't hold water.

Re: [HACKERS] intermittent failures in Cygwin from select_parallel tests

2017-06-15 Thread Tom Lane
Robert Haas writes: > On Thu, Jun 15, 2017 at 10:32 AM, Tom Lane wrote: >> It's fairly hard to read this other than as telling us that the worker was >> launched for the EXPLAIN (although really? why aren't we skipping that if >> EXEC_FLAG_EXPLAIN_ONLY?), ... > Uh, because ANALYZE was used? ...

Re: [HACKERS] intermittent failures in Cygwin from select_parallel tests

2017-06-15 Thread Robert Haas
On Thu, Jun 15, 2017 at 10:38 AM, Tom Lane wrote: > Robert Haas writes: >> On Thu, Jun 15, 2017 at 10:32 AM, Tom Lane wrote: >>> It's fairly hard to read this other than as telling us that the worker was >>> launched for the EXPLAIN (although really? why aren't we skipping that if >>> EXEC_FLAG_

Re: [HACKERS] logical replication: \dRp+ and "for all tables"

2017-06-15 Thread Peter Eisentraut
On 6/10/17 02:02, Jeff Janes wrote: > On Fri, Jun 9, 2017 at 10:20 PM, Masahiko Sawada > wrote: > > On Sat, Jun 10, 2017 at 7:29 AM, Jeff Janes > wrote: > > If I create a publication "for all tables", \dRp+ doesn't indicate i

Re: [HACKERS] Refreshing subscription relation state inside a transaction block

2017-06-15 Thread Petr Jelinek
On 15/06/17 15:52, Peter Eisentraut wrote: > On 6/15/17 02:41, Petr Jelinek wrote: >> Hmm, forcibly stopping currently running table sync is not what was >> intended, I'll have to look into it. We should not be forcibly stopping >> anything except the main apply worker during drop subscription (and

Re: [HACKERS] intermittent failures in Cygwin from select_parallel tests

2017-06-15 Thread Tom Lane
Robert Haas writes: > On Thu, Jun 15, 2017 at 10:38 AM, Tom Lane wrote: >> ... er, -ENOCAFFEINE. Nonetheless, there are no checks of >> EXEC_FLAG_EXPLAIN_ONLY in any parallel-query code, so I think >> a bet is being missed somewhere. > ExecGather() is where workers get launched, and that ain't

Re: [HACKERS] memory fields from getrusage()

2017-06-15 Thread Justin Pryzby
On Thu, Jun 15, 2017 at 10:29:21AM -0400, Robert Haas wrote: > On Wed, Jun 14, 2017 at 6:28 PM, Justin Pryzby wrote: > > On Tue, Jun 13, 2017 at 12:16:00PM -0400, Robert Haas wrote: > >> It might be worth adding platform-specific code for common platforms. > > > > All I care (which linux happily/h

Re: [HACKERS] Bug in ExecModifyTable function and trigger issues for foreign tables

2017-06-15 Thread Ildus Kurbangaliev
On Mon, 5 Jun 2017 17:25:27 +0900 Etsuro Fujita wrote: > On 2017/06/02 18:10, Etsuro Fujita wrote: > > On 2017/05/16 21:36, Etsuro Fujita wrote: > >> One approach I came up with to fix this issue is to rewrite the > >> targetList entries of an inherited UPDATE/DELETE properly using > >> rewri

Re: [HACKERS] memory fields from getrusage()

2017-06-15 Thread Tom Lane
Justin Pryzby writes: > Comments ? I was wondering whether it'd be better to drive this off of configure probes for the existence of the struct fields. However, in view of the same fields having different contents on some platforms, such a probe wouldn't really help much --- you'd still need pla

Re: [HACKERS] intermittent failures in Cygwin from select_parallel tests

2017-06-15 Thread Robert Haas
On Thu, Jun 15, 2017 at 10:21 AM, Amit Kapila wrote: > Yes, I think it is for next query. If you refer the log below from lorikeet: > > 2017-06-13 16:44:57.179 EDT [59404ec6.2758:63] LOG: statement: > EXPLAIN (analyze, timing off, summary off, costs off) SELECT * FROM > tenk1; > 2017-06-13 16:44

Re: [HACKERS] Getting server crash on Windows when using ICU collation

2017-06-15 Thread Peter Eisentraut
On 6/12/17 00:38, Ashutosh Sharma wrote: > PFA patch that fixes the issue described in above thread. As mentioned > in the above thread, the crash is basically happening in varstr_cmp() > function and it's only happening on Windows because in varstr_cmp(), > if the collation provider is ICU, we d

[HACKERS] logical replication read-only slave

2017-06-15 Thread Maeldron T.
Hello, I played around a bit with the logical replication in 10.0 beta 1. My first question was: is it possible to set the "slave" server to run in (almost) read-only mode? The current setup is the following: There is a Rails application running on multiple servers Two PostgreSQL servers, strea

Re: [HACKERS] logical replication read-only slave

2017-06-15 Thread Peter Eisentraut
On 6/15/17 11:12, Maeldron T. wrote: > However, it provides me a safety net that I could not execute writes on > the slave by accident. Not only I couldn’t do it, I would also receive a > notification from the software about the attempt as it would throw an > exception. > > Let’s say I would switc

Re: [HACKERS] Making server name part of the startup message

2017-06-15 Thread Alvaro Herrera
Tom Lane wrote: > Satyanarayana Narlapuram writes: > > Change the Postgres wire protocol to include server name in the startup > > message. This field can be an optional field driven by the connection > > parameters for psql (-N, --servername). > > We need this extra parameter for backward comp

Re: [HACKERS] Misnaming of staext_dependencies_load

2017-06-15 Thread Alvaro Herrera
Kyotaro HORIGUCHI wrote: > Hello. > > It is annoying that only staext_dependencies_load is prefixed > with "staext" (two t's) among several similar names prefixed by > "statext"(three t's). > > Should we rename it to have the same prefix? Sure. Pushed, thanks. -- Álvaro Herrera

Re: [HACKERS] WIP: Data at rest encryption

2017-06-15 Thread Robert Haas
On Wed, Jun 14, 2017 at 5:41 PM, Stephen Frost wrote: > I don't believe that was ever intended to be the final solution, I was > just pointing out that it's what the WIP patch did. > > The discussion had moved into having a command called which provided the > key on stdout, as I recall, allowing i

Re: [HACKERS] Get stuck when dropping a subscription during synchronizing table

2017-06-15 Thread Peter Eisentraut
On 6/14/17 18:35, Petr Jelinek wrote: > Attached fixes it (it was mostly about order of calls). So do I understand this right that the actual fix is just moving up the logicalrep_worker_stop() call in DropSubscription(). > I also split the > SetSubscriptionRelState into 2 separate interface while

Re: [HACKERS] Making server name part of the startup message

2017-06-15 Thread Tom Lane
Alvaro Herrera writes: > Tom Lane wrote: >> This makes no sense at all. The client is telling the server what the >> server's name is? > I think for instance you could have one pgbouncer instance (or whatever > pooler) pointing to several different servers. So the client connects > to the poole

[HACKERS] Huge pages support on Windows

2017-06-15 Thread Andrea caldarone
Hi all, First of all bear with me since I'm new in PostgreSQL world, I'm SQL Server DBA with 20yrs experience. I've seen the thread started by Tsunakawa Takayuki about huge pages support on windows and his version of pg_ctl.c in commit fest. I see no information anywhere about how to recompile onl

Re: [HACKERS] WIP: Data at rest encryption

2017-06-15 Thread Peter Eisentraut
On 6/14/17 17:41, Stephen Frost wrote: >> Relying on environment variables is clearly pretty crappy. So if that's >> the proposal, then I think it needs to be better. > I don't believe that was ever intended to be the final solution, I was > just pointing out that it's what the WIP patch did. > >

Re: [HACKERS] Something is rotten in publication drop

2017-06-15 Thread Peter Eisentraut
On 6/9/17 11:45, Tom Lane wrote: > What we've done in many comparable situations is to allow a > catalog-probing function to return NULL instead of failing > when handed an OID or other identifier that it can't locate. > Here it seems like pg_get_publication_tables() needs to use > missing_ok = TRU

[HACKERS] GiST API Adancement

2017-06-15 Thread Yuan Dong
Hi hackers, I want to hack a little. I applied for GSoC project (https://wiki.postgresql.org/wiki/GSoC_2017#GiST_API_advancement), but now I'm going to hack on my own. With the help of Andrew Borodin, I want to start the project with adding a third state to collision check. The third state is t

[HACKERS] ASOF join

2017-06-15 Thread Konstantin Knizhnik
I wonder if there were some discussion/attempts to add ASOF join to Postgres (sorry, may be there is better term for it, I am refereeing KDB definition: http://code.kx.com/wiki/Reference/aj ). Such kind of join can be useful when we need to associate two timeseries. It is quite popular in tradi

Re: [HACKERS] Get stuck when dropping a subscription during synchronizing table

2017-06-15 Thread Petr Jelinek
On 15/06/17 17:53, Peter Eisentraut wrote: > On 6/14/17 18:35, Petr Jelinek wrote: >> Attached fixes it (it was mostly about order of calls). > > So do I understand this right that the actual fix is just moving up the > logicalrep_worker_stop() call in DropSubscription(). > No the fix is heap_ope

Re: [HACKERS] Making server name part of the startup message

2017-06-15 Thread Magnus Hagander
On Thu, Jun 15, 2017 at 5:57 PM, Tom Lane wrote: > Alvaro Herrera writes: > > Tom Lane wrote: > >> This makes no sense at all. The client is telling the server what the > >> server's name is? > > > I think for instance you could have one pgbouncer instance (or whatever > > pooler) pointing to s

Re: [HACKERS] Something is rotten in publication drop

2017-06-15 Thread Tom Lane
Peter Eisentraut writes: > On 6/9/17 11:45, Tom Lane wrote: >> What we've done in many comparable situations is to allow a >> catalog-probing function to return NULL instead of failing >> when handed an OID or other identifier that it can't locate. >> Here it seems like pg_get_publication_tables()

Re: [HACKERS] Get stuck when dropping a subscription during synchronizing table

2017-06-15 Thread Peter Eisentraut
On 6/15/17 12:22, Petr Jelinek wrote: > On 15/06/17 17:53, Peter Eisentraut wrote: >> On 6/14/17 18:35, Petr Jelinek wrote: >>> Attached fixes it (it was mostly about order of calls). >> >> So do I understand this right that the actual fix is just moving up the >> logicalrep_worker_stop() call in D

Re: [HACKERS] Adding support for Default partition in partitioning

2017-06-15 Thread Ashutosh Bapat
Some more comments on the latest set of patches. In heap_drop_with_catalog(), we heap_open() the parent table to get the default partition OID, if any. If the relcache doesn't have an entry for the parent, this means that the entry will be created, only to be invalidated at the end of the function

Re: [HACKERS] Shortened URLs for commit messages

2017-06-15 Thread Bruce Momjian
On Tue, May 23, 2017 at 11:25:07PM -0400, Bruce Momjian wrote: > I have written the following sed script to convert regular Postgres > email message URLs to their shorter form for commit messages: > > sed > 's;http\(s\?\)://www\.postgresql\.org/message-id/;http\1://postgr.es/m/;gi' > > in case

Re: [HACKERS] Broken hint bits (freeze)

2017-06-15 Thread Bruce Momjian
On Thu, Jun 15, 2017 at 03:00:18PM +0530, Amit Kapila wrote: > On Wed, Jun 14, 2017 at 8:44 PM, Bruce Momjian wrote: > > On Wed, Jun 14, 2017 at 07:45:17PM +0530, Amit Kapila wrote: > >> > Now, it seems we later added a doc section early on that talks about > >> > "Verify standby servers" so I hav

Re: [HACKERS] UPDATE of partition key

2017-06-15 Thread Amit Khandekar
On 13 June 2017 at 15:40, Amit Khandekar wrote: > While rebasing my patch for the below recent commit, I realized that a > similar issue exists for the uptate-tuple-routing patch as well : > > commit 78a030a441966d91bc7e932ef84da39c3ea7d970 > Author: Tom Lane > Date: Mon Jun 12 23:29:44 2017 -0

Re: [HACKERS] Getting server crash on Windows when using ICU collation

2017-06-15 Thread Ashutosh Sharma
Hi, On Thu, Jun 15, 2017 at 7:43 PM, Amit Kapila wrote: > On Mon, Jun 12, 2017 at 10:08 AM, Ashutosh Sharma > wrote: >> PFA patch that fixes the issue described in above thread. As mentioned >> in the above thread, the crash is basically happening in varstr_cmp() >> function and it's only hap

Re: [HACKERS] Getting server crash on Windows when using ICU collation

2017-06-15 Thread Ashutosh Sharma
Hi, On Thu, Jun 15, 2017 at 8:36 PM, Peter Eisentraut wrote: > On 6/12/17 00:38, Ashutosh Sharma wrote: >> PFA patch that fixes the issue described in above thread. As mentioned >> in the above thread, the crash is basically happening in varstr_cmp() >> function and it's only happening on Windo

Re: [HACKERS] Get stuck when dropping a subscription during synchronizing table

2017-06-15 Thread Petr Jelinek
On 15/06/17 18:36, Peter Eisentraut wrote: > On 6/15/17 12:22, Petr Jelinek wrote: >> On 15/06/17 17:53, Peter Eisentraut wrote: >>> On 6/14/17 18:35, Petr Jelinek wrote: Attached fixes it (it was mostly about order of calls). >>> >>> So do I understand this right that the actual fix is just m

Re: [HACKERS] intermittent failures in Cygwin from select_parallel tests

2017-06-15 Thread Tom Lane
Robert Haas writes: > I think you're right. So here's a theory: > 1. The ERROR mapping the DSM segment is just a case of the worker the > losing a race, and isn't a bug. I concur that this is a possibility, but if we expect this to happen, seems like there should be other occurrences in the bui

Re: [HACKERS] WIP: Data at rest encryption

2017-06-15 Thread Robert Haas
On Thu, Jun 15, 2017 at 12:06 PM, Peter Eisentraut wrote: > Making this work well would be a major part of the usability story that > this is being sold on. If the proposed solution is that you can cobble > together a few bits of shell, then not only is that not very > user-friendly, it also won'

Re: [HACKERS] pgbench tap tests & minor fixes

2017-06-15 Thread Fabien COELHO
As for me, I would do expr_scanner_chomp_substring(PsqlScanState, int, int&); that changes end_offset as desired... Why not. And use it instead of end_offset = expr_scanner_offset(sstate) - 1; I removed these? The second issue: you are removing all trailing \n and \r. I think you should

Re: [HACKERS] WIP Patch: Pgbench Serialization and deadlock errors

2017-06-15 Thread Andres Freund
Hi, On 2017-06-14 11:48:25 +0300, Marina Polyakova wrote: > Now in pgbench we can test only transactions with Read Committed isolation > level because client sessions are disconnected forever on serialization > failures. There were some proposals and discussions about it (see message > here [1] an

Re: [HACKERS] Adding support for Default partition in partitioning

2017-06-15 Thread Robert Haas
On Thu, Jun 15, 2017 at 12:54 PM, Ashutosh Bapat wrote: > Some more comments on the latest set of patches. > > In heap_drop_with_catalog(), we heap_open() the parent table to get the > default partition OID, if any. If the relcache doesn't have an entry for the > parent, this means that the entry

[HACKERS] Typo in CREATE SUBSCRIPTION documentation

2017-06-15 Thread Julien Rouhaud
Hi, I just found $SUBJECT, patch attached. -- Julien Rouhaud http://dalibo.com - http://dalibo.org diff --git a/doc/src/sgml/ref/create_subscription.sgml b/doc/src/sgml/ref/create_subscription.sgml index 77bf87681b..3ca06fb3c3 100644 --- a/doc/src/sgml/ref/create_subscription.sgml +++ b/doc/src/s

[HACKERS] Приглашение: Re: [HACKERS] intermittent failures in Cygwin from select... - пт, 16 июнь 2017 09:00 - 10:00 (MSK) (pgsql-hackers@postgresql.org)

2017-06-15 Thread Vladimir Sitnikov
BEGIN:VCALENDAR PRODID:-//Google Inc//Google Calendar 70.9054//EN VERSION:2.0 CALSCALE:GREGORIAN METHOD:REQUEST BEGIN:VEVENT DTSTART:20170616T06Z DTEND:20170616T07Z DTSTAMP:20170615T193848Z ORGANIZER;CN=Vladimir Sitnikov:mailto:sitnikov.vladi...@gmail.com UID:2a6cc082-5202-11e7-978f-bfaa91f

Re: [HACKERS] Detection of IPC::Run presence in SSL TAP tests

2017-06-15 Thread Tom Lane
Michael Paquier writes: > On Tue, Jun 13, 2017 at 11:14 PM, Tom Lane wrote: >> I'd vote for removing this and adding a configure-time check that >> insists on IPC::Run when --enable-tap-tests is given. > There was a patch last year to do something like that: > https://www.postgresql.org/message-

Re: [HACKERS] Detection of IPC::Run presence in SSL TAP tests

2017-06-15 Thread Peter Eisentraut
On 6/15/17 15:57, Tom Lane wrote: > Pushed, thanks. I grabbed the very latest copy of ax_prog_perl_modules > out of the GNU archives --- it's only cosmetically different, but we > might as well be au courant. Um, this patch was previously rejected. Shouldn't we at least discuss it, or have it go

Re: [HACKERS] WIP Patch: Pgbench Serialization and deadlock errors

2017-06-15 Thread Kevin Grittner
On Thu, Jun 15, 2017 at 2:16 PM, Andres Freund wrote: > On 2017-06-14 11:48:25 +0300, Marina Polyakova wrote: >> I suggest a patch where pgbench client sessions are not disconnected because >> of serialization or deadlock failures and these failures are mentioned in >> reports. > > I think that's

Re: [HACKERS] WIP: Data at rest encryption

2017-06-15 Thread Bruce Momjian
On Thu, Jun 15, 2017 at 03:09:32PM -0400, Robert Haas wrote: > To be honest, I find the hostility toward this feature a bit baffling. > The argument seems to be essentially that we shouldn't have this > feature because we'd have to maintain the code and many of the same > goals could be accomplishe

Re: [HACKERS] Detection of IPC::Run presence in SSL TAP tests

2017-06-15 Thread Tom Lane
Peter Eisentraut writes: > On 6/15/17 15:57, Tom Lane wrote: >> Pushed, thanks. I grabbed the very latest copy of ax_prog_perl_modules >> out of the GNU archives --- it's only cosmetically different, but we >> might as well be au courant. > Um, this patch was previously rejected. Shouldn't we a

Re: [HACKERS] WIP: Data at rest encryption

2017-06-15 Thread Robert Haas
On Thu, Jun 15, 2017 at 4:29 PM, Bruce Momjian wrote: > I think the big win for having OS features in the database is > selectivity --- the ability to selectively apply a feature to part of > the database. This is what you are doing by putting a password on your > SSH key, and my idea about row e

Re: [HACKERS] intermittent failures in Cygwin from select_parallel tests

2017-06-15 Thread Tom Lane
I wrote: > Robert Haas writes: >> I think you're right. So here's a theory: >> 1. The ERROR mapping the DSM segment is just a case of the worker the >> losing a race, and isn't a bug. > I concur that this is a possibility, Actually, no, it isn't. I tried to reproduce the problem by inserting

[HACKERS] pg_waldump command line arguments

2017-06-15 Thread Robert Haas
pg_waldump --help claims that you run it like this: Usage: pg_waldump [OPTION]... [STARTSEG [ENDSEG]] And https://www.postgresql.org/docs/10/static/pgwaldump.html agrees. Since square brackets indicate optional arguments, this sort of makes it sound like running pg_waldump with no arguments oug

Re: [HACKERS] intermittent failures in Cygwin from select_parallel tests

2017-06-15 Thread Robert Haas
On Thu, Jun 15, 2017 at 5:06 PM, Tom Lane wrote: > I wrote: >> Robert Haas writes: >>> I think you're right. So here's a theory: > >>> 1. The ERROR mapping the DSM segment is just a case of the worker the >>> losing a race, and isn't a bug. > >> I concur that this is a possibility, > > Actually,

Re: [HACKERS] WIP: Data at rest encryption

2017-06-15 Thread Bruce Momjian
On Thu, Jun 15, 2017 at 05:04:17PM -0400, Robert Haas wrote: > > Also, there is the sense that security requires > > trust of the root user, while using Postgres doesn't require the root > > user to also use Postgres. > > I don't understand this. It is certainly true that you're running > binarie

Re: [HACKERS] intermittent failures in Cygwin from select_parallel tests

2017-06-15 Thread Tom Lane
Robert Haas writes: > On Thu, Jun 15, 2017 at 5:06 PM, Tom Lane wrote: >> ... nodeGather cannot deem the query done until it's seen EOF on >> each tuple queue, which it cannot see until each worker has attached >> to and then detached from the associated shm_mq. > Oh. That's sad. It definitely

Re: [HACKERS] WIP Patch: Pgbench Serialization and deadlock errors

2017-06-15 Thread Alvaro Herrera
Kevin Grittner wrote: > On Thu, Jun 15, 2017 at 2:16 PM, Andres Freund wrote: > > On 2017-06-14 11:48:25 +0300, Marina Polyakova wrote: > >> P.S. Does this use case (do not retry transaction with serialization or > >> deadlock failure) is most interesting or failed transactions should be > >> ret

Re: [HACKERS] WIP Patch: Pgbench Serialization and deadlock errors

2017-06-15 Thread Thomas Munro
On Fri, Jun 16, 2017 at 9:18 AM, Alvaro Herrera wrote: > Kevin Grittner wrote: >> On Thu, Jun 15, 2017 at 2:16 PM, Andres Freund wrote: >> > On 2017-06-14 11:48:25 +0300, Marina Polyakova wrote: > >> >> P.S. Does this use case (do not retry transaction with serialization or >> >> deadlock failure

Re: [HACKERS] WIP Patch: Pgbench Serialization and deadlock errors

2017-06-15 Thread Kevin Grittner
On Thu, Jun 15, 2017 at 4:18 PM, Alvaro Herrera wrote: > Kevin Grittner wrote: > As far as I understand her proposal, it is exactly the opposite -- if a > transaction fails, it is discarded. And this P.S. note is asking > whether this is a good idea, or would we prefer that failing > transaction

Re: [HACKERS] Decimal64 and Decimal128

2017-06-15 Thread Thomas Munro
On Fri, Sep 25, 2015 at 5:06 PM, Pavel Stehule wrote: > 2015-09-25 0:25 GMT+02:00 Jim Nasby : >> >> On 9/24/15 3:35 PM, Peter Geoghegan wrote: >>> >>> I would worry about the implicit casts you've added. They might cause >>> problems. >> >> >> Given the cycle created between numeric->decimal and d

Re: [HACKERS] intermittent failures in Cygwin from select_parallel tests

2017-06-15 Thread Robert Haas
On Thu, Jun 15, 2017 at 5:16 PM, Tom Lane wrote: > Robert Haas writes: >> On Thu, Jun 15, 2017 at 5:06 PM, Tom Lane wrote: >>> ... nodeGather cannot deem the query done until it's seen EOF on >>> each tuple queue, which it cannot see until each worker has attached >>> to and then detached from t

Re: [HACKERS] subscription worker signalling wal writer too much

2017-06-15 Thread Jeff Janes
On Wed, Jun 14, 2017 at 4:29 PM, Andres Freund wrote: > On 2017-06-14 16:24:27 -0700, Jeff Janes wrote: > > On Wed, Jun 14, 2017 at 3:20 PM, Andres Freund > wrote: > > > > > On 2017-06-14 15:08:49 -0700, Jeff Janes wrote: > > > > On Wed, Jun 14, 2017 at 11:55 AM, Jeff Janes > > > wrote: > > > >

Re: [HACKERS] WIP: Data at rest encryption

2017-06-15 Thread Stephen Frost
Bruce, * Bruce Momjian (br...@momjian.us) wrote: > On Thu, Jun 15, 2017 at 05:04:17PM -0400, Robert Haas wrote: > > > Also, there is the sense that security requires > > > trust of the root user, while using Postgres doesn't require the root > > > user to also use Postgres. > > > > I don't unders

Re: [HACKERS] WIP: Data at rest encryption

2017-06-15 Thread Bruce Momjian
On Thu, Jun 15, 2017 at 06:41:08PM -0400, Stephen Frost wrote: > > > > One serious difference between in-database-encryption and SSH keys is > > > > that the use of passwords for SSH is well understood and reasonable to > > > > use, while I think we all admit that use of passwords for database > >

Re: [HACKERS] WIP: Data at rest encryption

2017-06-15 Thread Stephen Frost
Bruce, * Bruce Momjian (br...@momjian.us) wrote: > On Thu, Jun 15, 2017 at 06:41:08PM -0400, Stephen Frost wrote: > > > > > One serious difference between in-database-encryption and SSH keys is > > > > > that the use of passwords for SSH is well understood and reasonable to > > > > > use, while I

Re: [HACKERS] WIP: Data at rest encryption

2017-06-15 Thread Bruce Momjian
On Thu, Jun 15, 2017 at 07:27:55PM -0400, Stephen Frost wrote: > I expect the same would happen with the shell-command approach suggested > up-thread and the prompt-on-stdin approach too, they aren't great but I > expect users would still use the feature. As Robert and I have > mentioned, there is

Re: [HACKERS] WIP: Data at rest encryption

2017-06-15 Thread Alvaro Herrera
Bruce Momjian wrote: > On Thu, Jun 15, 2017 at 07:27:55PM -0400, Stephen Frost wrote: > > I expect the same would happen with the shell-command approach suggested > > up-thread and the prompt-on-stdin approach too, they aren't great but I > > expect users would still use the feature. As Robert and

Re: [HACKERS] WIP: Data at rest encryption

2017-06-15 Thread Stephen Frost
Bruce, * Bruce Momjian (br...@momjian.us) wrote: > On Thu, Jun 15, 2017 at 07:27:55PM -0400, Stephen Frost wrote: > > I expect the same would happen with the shell-command approach suggested > > up-thread and the prompt-on-stdin approach too, they aren't great but I > > expect users would still us

  1   2   >