Re: [HACKERS] RLS Design

2014-07-04 Thread Kouhei Kaigai
Sorry for my late responding, now I'm catching up the discussion. * Robert Haas (robertmh...@gmail.com) wrote: On Tue, Jul 1, 2014 at 3:20 PM, Dean Rasheed dean.a.rash...@gmail.com wrote: If RLS quals are instead regarded as constraints on access, and multiple policies apply, then it

Re: [HACKERS] [REVIEW] Re: Compression of full-page-writes

2014-07-04 Thread Abhijit Menon-Sen
At 2014-07-04 14:38:27 +0900, masao.fu...@gmail.com wrote: But 0002-CompressBackupBlock_snappy_lz4_pglz-2.patch doesn't seem to be able to apply to HEAD cleanly. Yes, and it needs quite some reformatting beyond fixing whitespace damage too (long lines, comment formatting, consistent spacing

Re: [HACKERS] Issue while calling new PostgreSQL command from a Java Application

2014-07-04 Thread Ashutosh Bapat
You may have to add code to copy inp_str to _copyVacuumStmt(). See how a character array being copied from other _copy* functions. On Fri, Jul 4, 2014 at 10:43 AM, Ashoke s.ash...@gmail.com wrote: Hi, -- I have defined a new command my_command in PostgreSQL.

Re: [HACKERS] Issue while calling new PostgreSQL command from a Java Application

2014-07-04 Thread Abhijit Menon-Sen
At 2014-07-04 10:43:12 +0530, s.ash...@gmail.com wrote: I am not sure how executing the same command from an application can make a difference. It shouldn't make any difference, of course. But since you're seeing the problem with new code, the overwhelming probability is that there's an error

Re: [HACKERS] Can simplify 'limit 1' with slow function?

2014-07-04 Thread Martijn van Oosterhout
Fascinating. On Fri, Jul 04, 2014 at 10:47:06AM +0800, gotoschool6g wrote: slow query(8531 ms): SELECT ST_Distance_Sphere(shape,ST_GeomFromText('POINT(116.41386186784513 40.12211338311868)')) FROM road order by id LIMIT 1; explain output: Limit (cost=4653.48..4653.48 rows=1 width=3612)

Re: [HACKERS] pg_xlogdump --stats

2014-07-04 Thread Abhijit Menon-Sen
At 2014-06-30 05:19:10 +, dilip.ku...@huawei.com wrote: Please fix these issues and send the updated patch.. I will continue reviewing the patch.. Did you get anywhere with the updated patch? -- Abhijit -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make

Re: [HACKERS] Cluster name in ps output

2014-07-04 Thread Fujii Masao
On Wed, Jul 2, 2014 at 3:45 AM, Vik Fearing vik.fear...@dalibo.com wrote: On 06/29/2014 02:25 PM, Andres Freund wrote: On 2014-06-29 11:11:14 +0100, Thomas Munro wrote: On 29 June 2014 10:55, Andres Freund and...@2ndquadrant.com wrote: So, I'd looked at it with an eye towards committing it

Re: [HACKERS] Issue while calling new PostgreSQL command from a Java Application

2014-07-04 Thread Ashoke
Thank you Ashutosh*.* That was the issue. But, could you please explain why it worked from command line? On Fri, Jul 4, 2014 at 11:49 AM, Ashutosh Bapat ashutosh.ba...@enterprisedb.com wrote: You may have to add code to copy inp_str to _copyVacuumStmt(). See how a character array being

Re: [HACKERS] Cluster name in ps output

2014-07-04 Thread Vik Fearing
On 07/04/2014 08:50 AM, Fujii Masao wrote: On Wed, Jul 2, 2014 at 3:45 AM, Vik Fearing vik.fear...@dalibo.com wrote: Is there a reason for not using this in synchronous_standby_names, perhaps falling back to application_name if not set? You mean that if synchronous_standby_names is an empty

Re: [HACKERS] Issue while calling new PostgreSQL command from a Java Application

2014-07-04 Thread Ashutosh Bapat
On Fri, Jul 4, 2014 at 12:30 PM, Ashoke s.ash...@gmail.com wrote: Thank you Ashutosh*.* That was the issue. But, could you please explain why it worked from command line? I do not know. Any time we add a member to a node and find it's value coming out NULL or 0 instead of the one set,

Re: [HACKERS] pg_xlogdump --stats

2014-07-04 Thread Dilip kumar
On 04 July 2014 12:07, Abhijit Menon-Sen Wrote, -Original Message- From: Abhijit Menon-Sen [mailto:a...@2ndquadrant.com] Sent: 04 July 2014 12:07 To: Dilip kumar Cc: pgsql-hackers@postgresql.org; furu...@pm.nttdata.co.jp Subject: Re: [HACKERS] pg_xlogdump --stats At 2014-06-30

Re: [HACKERS] pg_xlogdump --stats

2014-07-04 Thread Abhijit Menon-Sen
At 2014-07-04 08:38:17 +, dilip.ku...@huawei.com wrote: Once you fix above erros, I think patch is ok from my side. I've attached two updated patches here, including the fix to the usage message. I'll mark this ready for committer now. (The rm_identify patch is posted separately from the

Re: [HACKERS] pg_xlogdump --stats

2014-07-04 Thread Andres Freund
On 2014-07-04 14:16:42 +0530, Abhijit Menon-Sen wrote: At 2014-07-04 08:38:17 +, dilip.ku...@huawei.com wrote: Once you fix above erros, I think patch is ok from my side. I've attached two updated patches here, including the fix to the usage message. I'll mark this ready for committer

Re: [HACKERS] pg_xlogdump --stats

2014-07-04 Thread Abhijit Menon-Sen
At 2014-07-04 10:54:08 +0200, and...@2ndquadrant.com wrote: I'm pretty sure that most committers would want to apply the rm_identity part in a separate commit first. Could you make it two patches, one introducing rm_identity, and another with xlogdump using it? Sure, attached. -- Abhijit

Re: [HACKERS] pg_xlogdump --stats

2014-07-04 Thread Andres Freund
Hi, On 2014-07-04 14:42:03 +0530, Abhijit Menon-Sen wrote: Sure, attached. +const char * +heap_identify(uint8 info) +{ + const char *id = NULL; + + switch (info XLOG_HEAP_OPMASK) + { + case XLOG_HEAP_INSERT: + id = INSERT; +

Re: [HACKERS] WAL replay bugs

2014-07-04 Thread Kyotaro HORIGUCHI
Hello, thank you for considering my comments, including somewhat impractical ones. I'll have a look at the latest patch sooner. At Fri, 4 Jul 2014 15:29:51 +0900, Michael Paquier michael.paqu...@gmail.com wrote in cab7npqt_fs_3jlnhywc6nzej4sbl6dgslfvcg0jbukgjep9...@mail.gmail.com OK, I have

Re: [HACKERS] [PATCH] introduce XLogLockBlockRangeForCleanup()

2014-07-04 Thread Amit Khandekar
On 3 July 2014 16:59, Simon Riggs si...@2ndquadrant.com wrote: I think we should say this though LockBufHdr(buf); valid = ((buf-flags BM_VALID) != 0); if (valid) PinBuffer_Locked(buf); else UnlockBufHdr(buf); since otherwise we would access the buffer flags without the

Re: [HACKERS] WAL replay bugs

2014-07-04 Thread Kyotaro HORIGUCHI
Hello, At Thu, 3 Jul 2014 14:48:50 +0900, Michael Paquier michael.paqu...@gmail.com wrote in cab7npqq2y3qkapasac6oxxqtwbvkkxcrftua0w+dx-j3i-l...@mail.gmail.com TODO ... Each type of page can be confirmed by the following way *if* its type is previously *hinted* except for gin.

Re: [HACKERS] Escaping from blocked send() reprised.

2014-07-04 Thread Kyotaro HORIGUCHI
Hello, At Tue, 1 Jul 2014 21:21:38 +0200, Martijn van Oosterhout klep...@svana.org wrote in 20140701192138.gb20...@svana.org On Tue, Jul 01, 2014 at 12:26:43PM +0900, Kyotaro HORIGUCHI wrote: 1. I think it's the case that there are platforms around where a signal won't cause send() to

[HACKERS] No toast table for pg_shseclabel but for pg_seclabel

2014-07-04 Thread Andres Freund
Hi, postgres=# SELECT oid::regclass, reltoastrelid FROM pg_class WHERE relname IN ('pg_seclabel', 'pg_shseclabel'); oid | reltoastrelid ---+--- pg_seclabel | 3598 pg_shseclabel | 0 (2 rows) Isn't that a somewhat odd choice? Why do we

Re: [HACKERS] Escaping from blocked send() reprised.

2014-07-04 Thread Kyotaro HORIGUCHI
Hello, thank you for keeping this discussion moving. I think there's no such a reasonable time. The behavior might should be determined from another point.. On alternative would be let pg_terminate_backend() have a parameter instructing force shutodwn (how to propagate it?), or make a

Re: [HACKERS] gaussian distribution pgbench

2014-07-04 Thread Fabien COELHO
Yea. I certainly disagree with the patch in it's current state because it copies the same 15 lines several times with a two word difference. Independent of whether we want those options, I don't think that's going to fly. I liked a simple static string for the different variants, which

Re: [HACKERS] pg_xlogdump --stats

2014-07-04 Thread Abhijit Menon-Sen
At 2014-07-04 11:34:21 +0200, and...@2ndquadrant.com wrote: So we're leaking memory here? For --stats that could well be relevant... Will fix (I think using a static buffer would be OK here). I think we're going to have to redefine the PGAC_FUNC_SNPRINTF_LONG_LONG_INT_FORMAT callsite in

Re: [HACKERS] gaussian distribution pgbench

2014-07-04 Thread Andres Freund
On 2014-07-04 11:59:23 +0200, Fabien COELHO wrote: Yea. I certainly disagree with the patch in it's current state because it copies the same 15 lines several times with a two word difference. Independent of whether we want those options, I don't think that's going to fly. I liked a simple

Re: [HACKERS] pg_xlogdump --stats

2014-07-04 Thread Andres Freund
On 2014-07-04 15:34:14 +0530, Abhijit Menon-Sen wrote: At 2014-07-04 11:34:21 +0200, and...@2ndquadrant.com wrote: So we're leaking memory here? For --stats that could well be relevant... Will fix (I think using a static buffer would be OK here). In that place, yes. There there's

Re: [HACKERS] No toast table for pg_shseclabel but for pg_seclabel

2014-07-04 Thread Andres Freund
On 2014-07-04 11:50:17 +0200, Andres Freund wrote: Hi, postgres=# SELECT oid::regclass, reltoastrelid FROM pg_class WHERE relname IN ('pg_seclabel', 'pg_shseclabel'); oid | reltoastrelid ---+--- pg_seclabel | 3598 pg_shseclabel |

Re: [HACKERS] pg_xlogdump --stats

2014-07-04 Thread gotoschool6g
I'm pretty sure that most committers would want to apply the rm_identity part in a separate commit first. Could you make it two patches, one introducing rm_identity, and another with xlogdump using it? Carp the code: const char * clog_identify(uint8 info) { switch (info) {

Re: [HACKERS] pg_xlogdump --stats

2014-07-04 Thread Andres Freund
On 2014-07-04 18:31:34 +0800, gotoschool6g wrote: I'm pretty sure that most committers would want to apply the rm_identity part in a separate commit first. Could you make it two patches, one introducing rm_identity, and another with xlogdump using it? Carp the code: const char

Re: [HACKERS] pg_receivexlog add synchronous mode

2014-07-04 Thread furuyao
Thanks for reviewing the patch! I think that this refactoring patch is useful for improving source code readability and making the future patches simpler, whether we adopt your patch or not. So, barring any objections, I'm thinking to commit this refactoring patch. Committed! It is

Re: [HACKERS] log_error_verbosity and unexpected errors

2014-07-04 Thread Oskari Saarenmaa
On 02/07/14 22:10, Tom Lane wrote: Greg Stark st...@mit.edu writes: I think log_error_verbosity is a strange variable. It's useless for expected user-facing errors but essential for unexpected errors that indicate bugs in the code -- and you can only have it on for everything or off for

Re: [HACKERS] pg_xlogdump --stats

2014-07-04 Thread Abhijit Menon-Sen
At 2014-07-04 11:34:21 +0200, and...@2ndquadrant.com wrote: I think we're going to have to redefine the PGAC_FUNC_SNPRINTF_LONG_LONG_INT_FORMAT callsite in configure.in to define INT64_MODIFIER='ll/l/I64D' I've attached a patch to do this, and also add INT64_MODIFIER to pg_config.h.in:

Re: [HACKERS] No toast table for pg_shseclabel but for pg_seclabel

2014-07-04 Thread Kohei KaiGai
Here is no other reason than what Alvaro mentioned in the upthread. We intended to store security label of SELinux (less than 100bytes at most), so I didn't think it leads any problem actually. On the other hands, pg_seclabel was merged in another development cycle. We didn't have deep discussion

Re: [HACKERS] [PATCH] introduce XLogLockBlockRangeForCleanup()

2014-07-04 Thread Abhijit Menon-Sen
Updated patch attached, thanks. Amit: what's your conclusion from the review? -- Abhijit diff --git a/src/backend/access/nbtree/nbtxlog.c b/src/backend/access/nbtree/nbtxlog.c index 5f9fc49..dc90c02 100644 --- a/src/backend/access/nbtree/nbtxlog.c +++ b/src/backend/access/nbtree/nbtxlog.c @@

[HACKERS] [RFC: bug fix?] Connection attempt block forever when the synchronous standby is not running

2014-07-04 Thread MauMau
Hello, My customer reported a strange connection hang problem. He and I couldn't reproduce it. I haven't been able to understand the cause, but I can think of one hypothesis. Could you give me your opinions on whether my hypothesis is correct, and a direction on how to fix the problem?

Re: [HACKERS] Issue while calling new PostgreSQL command from a Java Application

2014-07-04 Thread Tom Lane
Ashoke s.ash...@gmail.com writes: Thank you Ashutosh*.* That was the issue. But, could you please explain why it worked from command line? Simple vs extended query protocol, probably --- the former avoids copying the constructed parsetree, but I think the latter doesn't. Or maybe the JDBC

Re: [HACKERS] Cluster name in ps output

2014-07-04 Thread Tom Lane
Vik Fearing vik.fear...@dalibo.com writes: You mean that if synchronous_standby_names is an empty it automatically should be set to cluster_name? No, I mean that synchronous_standby_names should look at cluster_name first, and if it's not set then unfortunately look at application_name for

Re: [HACKERS] No toast table for pg_shseclabel but for pg_seclabel

2014-07-04 Thread Tom Lane
Kohei KaiGai kai...@kaigai.gr.jp writes: Here is no other reason than what Alvaro mentioned in the upthread. We intended to store security label of SELinux (less than 100bytes at most), so I didn't think it leads any problem actually. On the other hands, pg_seclabel was merged in another

Re: [HACKERS] [REVIEW] Re: Compression of full-page-writes

2014-07-04 Thread Abhijit Menon-Sen
At 2014-07-04 19:27:10 +0530, rahilasye...@gmail.com wrote: Please find attached patches with no whitespace error and improved formatting. Thanks. There are still numerous formatting changes required, e.g. spaces around = and correct formatting of comments. And git diff --check still has a

Re: [HACKERS] RLS Design

2014-07-04 Thread Stephen Frost
Kaigai, On Thursday, July 3, 2014, Kouhei Kaigai kai...@ak.jp.nec.com wrote: Sorry for my late responding, now I'm catching up the discussion. * Robert Haas (robertmh...@gmail.com javascript:;) wrote: On Tue, Jul 1, 2014 at 3:20 PM, Dean Rasheed dean.a.rash...@gmail.com javascript:;

Re: [HACKERS] Doing better at HINTing an appropriate column within errorMissingColumn()

2014-07-04 Thread Abhijit Menon-Sen
At 2014-07-02 15:51:08 -0700, p...@heroku.com wrote: Attached revision factors in everyone's concerns here, I think. Is anyone planning to review Peter's revised patch? These new measures make the coding somewhat more complex than that of the initial version, although overall the parser code

Re: [HACKERS] [REVIEW] Re: Compression of full-page-writes

2014-07-04 Thread Abhijit Menon-Sen
At 2014-07-04 21:02:33 +0530, a...@2ndquadrant.com wrote: +/* + */ +static const struct config_enum_entry backup_block_compression_options[] = { Oh, I forgot to mention that the configuration setting changes are also pending. I think we had a working consensus to use

Re: [HACKERS] pg_xlogdump --stats

2014-07-04 Thread Alvaro Herrera
Andres Freund wrote: On 2014-07-04 18:31:34 +0800, gotoschool6g wrote: Carp the code: const char * clog_identify(uint8 info) { switch (info) { case CLOG_ZEROPAGE: return ZEROPAGE; case CLOG_TRUNCATE: return TRUNCATE; break; }

Re: [HACKERS] pg_xlogdump --stats

2014-07-04 Thread Abhijit Menon-Sen
At 2014-07-04 13:43:46 -0400, alvhe...@2ndquadrant.com wrote: Now, I see that pg_xlogdump is checking for NULL return, but I'm not sure this is the best possible API. Note that the patched pg_xlogdump will display rm_name/0xNN for any records that rm_identify returns a NULL for. Earlier,

Re: [HACKERS] buildfarm and rolling release distros

2014-07-04 Thread Christoph Berg
Re: Craig Ringer 2014-07-02 53b39638.9010...@2ndquadrant.com +1. The buildfarm has one such member already, anchovy, and I recall it having given at least one helpful forewarning. It shows as Arch Linux testing [updated daily], which is sufficient annotation for me. Its failure rate

Re: [HACKERS] RLS Design

2014-07-04 Thread Kouhei Kaigai
Kaigai, On Thursday, July 3, 2014, Kouhei Kaigai kai...@ak.jp.nec.com wrote: Sorry for my late responding, now I'm catching up the discussion. * Robert Haas (robertmh...@gmail.com javascript:; ) wrote: On Tue, Jul 1, 2014 at 3:20 PM, Dean Rasheed

[HACKERS] DISTINCT with btree skip scan

2014-07-04 Thread Thomas Munro
Hello As an exercise I hacked up the simplest code I could think of that would demonstrate a faster DISTINCT based on skipping ahead to the next distinct value in an index-only scan. Please see the attached (extremely buggy) patch, and the example session below. (It's against my natural instinct

Re: [HACKERS] DISTINCT with btree skip scan

2014-07-04 Thread Vik Fearing
On 07/05/2014 02:17 AM, Thomas Munro wrote: As an exercise I hacked up the simplest code I could think of that would demonstrate a faster DISTINCT based on skipping ahead to the next distinct value in an index-only scan. Please see the attached (extremely buggy) patch, and the example session

Re: [HACKERS] Aggregate function API versus grouping sets

2014-07-04 Thread Vik Fearing
On 07/02/2014 10:15 PM, Andrew Gierth wrote: (Had one request so far for a mode() variant that returns the unique modal value if one exists, otherwise null; so the current set of ordered-set aggs by no means exhausts the possible applications.) I resemble that remark. :) But seriously, am I

Re: [HACKERS] Pg_upgrade and toast tables bug discovered

2014-07-04 Thread Bruce Momjian
On Fri, Jul 4, 2014 at 12:01:37AM -0400, Bruce Momjian wrote: The most robust, but not trivial, approach seems to be to prevent toast table creation if there wasn't a set_next_toast_pg_class_oid(). Then, after all relations are created, iterate over all pg_class entries that possibly need

Re: [HACKERS] postgresql.auto.conf and reload

2014-07-04 Thread Amit Kapila
On Fri, Jun 27, 2014 at 9:11 AM, Amit Kapila amit.kapil...@gmail.com wrote: On Thu, Jun 26, 2014 at 1:49 PM, Christoph Berg c...@df7cb.de wrote: Re: Amit Kapila 2014-06-26 CAA4eK1+mUTjc=GXJK3bYtSwV2BmBni= phevbqlqkhduv9cw...@mail.gmail.com How about adding a note in Alter System so that