Re: [HACKERS] Index scan optimization

2014-09-24 Thread Rajeev rastogi
On 22 September 2014 18:51, Stephen Frost Wrote: * Rajeev rastogi (rajeev.rast...@huawei.com) wrote: Thanks, I shall start to prepare a patch for this optimization and share in 1 or 2 days. This sounded interesting to me also- please be sure to put it on the open commitfest once you have

Re: [HACKERS] Extending COPY TO

2014-09-24 Thread Andrea Riciputi
Hi all, thanks for all your answers, I see your point. And I also understand the argument according to which there always be some other use case to satisfy. However your suggestion to use COPY TO sql TO PROGRAM doesn’t seem to me to fit well the use case I have in mind. Imagine you access PG

[HACKERS] missing isinf declaration on solaris

2014-09-24 Thread Oskari Saarenmaa
GCC 4.9 build on Solaris 10 shows these warnings about isinf: float.c: In function 'is_infinite': float.c:178:2: warning: implicit declaration of function 'isinf' [-Wimplicit-function-declaration] See

Re: [HACKERS] BRIN indexes - TRAP: BadArgument

2014-09-24 Thread Heikki Linnakangas
On 09/23/2014 10:04 PM, Alvaro Herrera wrote: + para + The acronymBRIN/acronym implementation in productnamePostgreSQL/productname + is primarily maintained by Aacute;lvaro Herrera. + /para We don't usually have such verbiage in the docs. The GIN and GiST pages do, but I think those

Re: [HACKERS] add modulo (%) operator to pgbench

2014-09-24 Thread Fabien COELHO
Hello Heikki, If you reject it, you can also remove the gaussian and exponential random distribution which is near useless without a mean to add a minimal pseudo-random stage, for which (x * something) % size is a reasonable approximation, hence the modulo submission. I'm confused. The

Re: [HACKERS] pgcrypto: PGP signatures

2014-09-24 Thread Abhijit Menon-Sen
At 2014-09-15 13:37:48 +0200, ma...@joh.to wrote: I'm not sure we're talking about the same thing. No, we weren't. I was under the impression that the signatures could be validated. Sorry for the noise. -- Abhijit -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make

Re: [HACKERS] a fast bloat measurement tool (was Re: Measuring relation free space)

2014-09-24 Thread Abhijit Menon-Sen
Hi Amit. Thanks for your comments, and I'm sorry it's taken me so long to respond. At 2014-08-03 11:18:57 +0530, amit.kapil...@gmail.com wrote: After looking at code, I also felt that it is better to add this as a version of pg_stattuple. I started off trying to do that, but now I'm afraid I

Re: [HACKERS] a fast bloat measurement tool (was Re: Measuring relation free space)

2014-09-24 Thread Andres Freund
Hi, On 2014-09-24 14:26:37 +0530, Abhijit Menon-Sen wrote: Thanks for your comments, and I'm sorry it's taken me so long to respond. At 2014-08-03 11:18:57 +0530, amit.kapil...@gmail.com wrote: After looking at code, I also felt that it is better to add this as a version of

Re: [HACKERS] TODO : Allow parallel cores to be used by vacuumdb [ WIP ]

2014-09-24 Thread Dilip kumar
On 24 August 2014 11:33, Amit Kapila Wrote Thanks for you comments, i have worked on both the review comment lists, sent on 19 August, and 24 August. Latest patch is attached with the mail.. on 19 August: You can compare against SQLSTATE by using below API. val =

Re: [HACKERS] Extending COPY TO

2014-09-24 Thread Heikki Linnakangas
On 09/24/2014 09:23 AM, Andrea Riciputi wrote: Imagine you access PG from an application written in the language X using a driver library, both your application and your PG instance run on two different hosts. In that scenario, you'll be using the PQgetCopyData function to get the data.

Re: [HACKERS] add modulo (%) operator to pgbench

2014-09-24 Thread Heikki Linnakangas
On 09/24/2014 10:45 AM, Fabien COELHO wrote: Currently these distributions are achieved by mapping a continuous function onto integers, so that neighboring integers get neighboring number of draws, say with size=7: #draws 10 6 3 1 0 0 0 // some exponential distribution int drawn

Re: [HACKERS] jsonb format is pessimal for toast compression

2014-09-24 Thread Heikki Linnakangas
On 09/24/2014 08:16 AM, Tom Lane wrote: Jan Wieck j...@wi3ck.info writes: On 09/15/2014 09:46 PM, Craig Ringer wrote: Anyway - this is looking like the change will go in, and with it a catversion bump. Introduction of a jsonb version/flags byte might be worthwhile at the same time. It seems

Re: [HACKERS] pg_dump bug in 9.4beta2 and HEAD

2014-09-24 Thread Thom Brown
On 15 August 2014 16:31, Pavel Stehule pavel.steh...@gmail.com wrote: Hi 2014-08-14 9:03 GMT+02:00 Heikki Linnakangas hlinnakan...@vmware.com: On 08/14/2014 06:53 AM, Joachim Wieland wrote: I'm seeing an assertion failure with pg_dump -c --if-exists which is not ready to handle BLOBs it

[HACKERS] make pg_controldata accept -D dirname

2014-09-24 Thread Abhijit Menon-Sen
Hi. I can never remember that pg_controldata takes only a dirname rather than -D dirname, and I gather I'm not the only one. Here's a tiny patch to make it work either way. As far as I can see, it doesn't break anything, not even if you have a data directory named -D. -- Abhijit From

Re: [HACKERS] make pg_controldata accept -D dirname

2014-09-24 Thread Magnus Hagander
On Wed, Sep 24, 2014 at 12:59 PM, Abhijit Menon-Sen a...@2ndquadrant.com wrote: Hi. I can never remember that pg_controldata takes only a dirname rather than -D dirname, and I gather I'm not the only one. Here's a tiny patch to make it work either way. As far as I can see, it doesn't break

Re: [HACKERS] make pg_controldata accept -D dirname

2014-09-24 Thread Heikki Linnakangas
On 09/24/2014 01:59 PM, Abhijit Menon-Sen wrote: Hi. I can never remember that pg_controldata takes only a dirname rather than -D dirname, and I gather I'm not the only one. Here's a tiny patch to make it work either way. As far as I can see, it doesn't break anything, not even if you have a

Re: [HACKERS] make pg_controldata accept -D dirname

2014-09-24 Thread Abhijit Menon-Sen
At 2014-09-24 14:03:41 +0300, hlinnakan...@vmware.com wrote: Ah, I frequently run into that too; but with pg_resetxlog. Well, that's no fun. Patch attached. -- Abhijit From 23fc4d90d0353e1c6d65ca5715fc0338199f01cf Mon Sep 17 00:00:00 2001 From: Abhijit Menon-Sen a...@2ndquadrant.com Date: Wed,

Re: [HACKERS] END_OF_RECOVERY shutdowns and ResetUnloggedRelations()

2014-09-24 Thread Abhijit Menon-Sen
Hi Andres, Robert. I've attached four patches here. 1. Move the call to ResetUnloggedRelations(UNLOGGED_RELATION_INIT) to earlier in StartupXLOG. 2. Inside that function, issue fsync()s for the main forks we create by copying the _init fork. 3. A small fixup to add a const to typedef

Re: [HACKERS] make pg_controldata accept -D dirname

2014-09-24 Thread Michael Paquier
On Wed, Sep 24, 2014 at 7:59 PM, Abhijit Menon-Sen a...@2ndquadrant.com wrote: I can never remember that pg_controldata takes only a dirname rather than -D dirname, and I gather I'm not the only one. Here's a tiny patch to make it work either way. As far as I can see, it doesn't break

Re: [HACKERS] jsonb format is pessimal for toast compression

2014-09-24 Thread Tom Lane
Heikki Linnakangas hlinnakan...@vmware.com writes: On 09/24/2014 08:16 AM, Tom Lane wrote: Heikki's patch would eat up the high-order JEntry bits, but the other points remain. If we don't need to be backwards-compatible with the 9.4beta on-disk format, we don't necessarily need to eat the

Re: [HACKERS] make pg_controldata accept -D dirname

2014-09-24 Thread Rajeev rastogi
On 24 September 2014 17:15, Michael Paquier Wrote: On Wed, Sep 24, 2014 at 7:59 PM, Abhijit Menon-Sen a...@2ndquadrant.com wrote: I can never remember that pg_controldata takes only a dirname rather than -D dirname, and I gather I'm not the only one. Here's a tiny patch to make it work

Re: [HACKERS] better atomics - v0.6

2014-09-24 Thread Heikki Linnakangas
On 09/23/2014 12:01 AM, Andres Freund wrote: Hi, I've finally managed to incorporate (all the?) feedback I got for 0.5. Imo the current version looks pretty good. Thanks! I agree it looks good. Some random comments after a quick read-through: There are some spurious whitespace changes in

Re: [HACKERS] missing isinf declaration on solaris

2014-09-24 Thread Tom Lane
Oskari Saarenmaa o...@ohmu.fi writes: GCC 4.9 build on Solaris 10 shows these warnings about isinf: float.c: In function 'is_infinite': float.c:178:2: warning: implicit declaration of function 'isinf' Ugh. isinf declaration is in iso/math_c99.h which is included by math.h, but it's

Re: [HACKERS] better atomics - v0.6

2014-09-24 Thread Andres Freund
On 2014-09-24 14:59:19 +0300, Heikki Linnakangas wrote: On 09/23/2014 12:01 AM, Andres Freund wrote: Hi, I've finally managed to incorporate (all the?) feedback I got for 0.5. Imo the current version looks pretty good. Thanks! I agree it looks good. Some random comments after a quick

Re: [HACKERS] make pg_controldata accept -D dirname

2014-09-24 Thread Alvaro Herrera
Magnus Hagander wrote: On Wed, Sep 24, 2014 at 12:59 PM, Abhijit Menon-Sen a...@2ndquadrant.com wrote: Hi. I can never remember that pg_controldata takes only a dirname rather than -D dirname, and I gather I'm not the only one. Here's a tiny patch to make it work either way. As far as

Re: [HACKERS] pg_dump bug in 9.4beta2 and HEAD

2014-09-24 Thread Alvaro Herrera
Heikki Linnakangas wrote: On 09/24/2014 01:50 PM, Thom Brown wrote: I am sending two patches first is fast fix second fix is implementation of Heikki' idea. I'm guessing this issue is still unresolved? It would be nice to get this off the open items list. Yeah, I had completely

Re: [HACKERS] make pg_controldata accept -D dirname

2014-09-24 Thread Thom Brown
On 24 September 2014 12:04, Magnus Hagander mag...@hagander.net wrote: On Wed, Sep 24, 2014 at 12:59 PM, Abhijit Menon-Sen a...@2ndquadrant.com wrote: Hi. I can never remember that pg_controldata takes only a dirname rather than -D dirname, and I gather I'm not the only one. Here's a

Re: [HACKERS] make pg_controldata accept -D dirname

2014-09-24 Thread Heikki Linnakangas
On 09/24/2014 02:21 PM, Abhijit Menon-Sen wrote: At 2014-09-24 14:03:41 +0300, hlinnakan...@vmware.com wrote: Ah, I frequently run into that too; but with pg_resetxlog. Well, that's no fun. Patch attached. Thanks. Please update the docs and usage(), too. - Heikki -- Sent via

Re: [HACKERS] missing isinf declaration on solaris

2014-09-24 Thread Oskari Saarenmaa
24.09.2014, 15:25, Tom Lane kirjoitti: Oskari Saarenmaa o...@ohmu.fi writes: GCC 4.9 build on Solaris 10 shows these warnings about isinf: float.c: In function 'is_infinite': float.c:178:2: warning: implicit declaration of function 'isinf' Ugh. isinf declaration is in iso/math_c99.h which

Re: [HACKERS] make pg_controldata accept -D dirname

2014-09-24 Thread Abhijit Menon-Sen
At 2014-09-24 16:02:29 +0300, hlinnakan...@vmware.com wrote: Thanks. Please update the docs and usage(), too. I'm sorry, but I don't think it would be an improvement to make the docs explain that it's valid to use either -D datadir or specify it without an option. If both commands were changed

Re: [HACKERS] missing isinf declaration on solaris

2014-09-24 Thread Andres Freund
On 2014-09-24 08:25:34 -0400, Tom Lane wrote: I'm worried that __C99FEATURES__ might do other, not-so-C89-compatible things in later Solaris releases. Possibly that risk could be addressed by having src/template/solaris make an OS version check before adding the switch, but it'd be a bit

Re: [HACKERS] make pg_controldata accept -D dirname

2014-09-24 Thread Abhijit Menon-Sen
To put it another way, I doubt any of the people who were surprised by it looked at either the usage message or the docs. ;-) -- Abhijit -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers

Re: [HACKERS] missing isinf declaration on solaris

2014-09-24 Thread Tom Lane
Oskari Saarenmaa o...@ohmu.fi writes: ... so to enable XPG6 we'd need to use C99 mode anyway. OK. Could we just use -std=gnu99 (with -fgnu89-inline if required) with GCC on Solaris? ISTM it would be cleaner to just properly enable c99 mode rather than define an undocumented macro to use

Re: [HACKERS] make pg_controldata accept -D dirname

2014-09-24 Thread Tom Lane
Abhijit Menon-Sen a...@2ndquadrant.com writes: At 2014-09-24 16:02:29 +0300, hlinnakan...@vmware.com wrote: Thanks. Please update the docs and usage(), too. I'm sorry, but I don't think it would be an improvement to make the docs explain that it's valid to use either -D datadir or specify it

Re: [HACKERS] delta relations in AFTER triggers

2014-09-24 Thread Heikki Linnakangas
On 09/24/2014 12:22 AM, Kevin Grittner wrote: Heikki Linnakangas hlinnakan...@vmware.com wrote: instead of passing parameters to the SPI calls individually, you invented SPI_register_tuplestore which affects all subsequent SPI calls. All subsequent SPI calls on that particular SPI connection

Re: [HACKERS] make pg_controldata accept -D dirname

2014-09-24 Thread Abhijit Menon-Sen
At 2014-09-24 09:25:12 -0400, t...@sss.pgh.pa.us wrote: What's so hard about [ -D ] before the datadir argument? I'm sorry to have given you the impression that I objected to it because it was hard. Since I proposed the same thing a few lines after what you quoted, I guess I have to agree it's

Re: [HACKERS] make pg_controldata accept -D dirname

2014-09-24 Thread Heikki Linnakangas
On 09/24/2014 04:49 PM, Abhijit Menon-Sen wrote: At 2014-09-24 09:25:12 -0400, t...@sss.pgh.pa.us wrote: What's so hard about [ -D ] before the datadir argument? I'm sorry to have given you the impression that I objected to it because it was hard. Since I proposed the same thing a few lines

Re: [HACKERS] missing isinf declaration on solaris

2014-09-24 Thread Oskari Saarenmaa
24.09.2014, 16:21, Tom Lane kirjoitti: Oskari Saarenmaa o...@ohmu.fi writes: ... so to enable XPG6 we'd need to use C99 mode anyway. OK. Could we just use -std=gnu99 (with -fgnu89-inline if required) with GCC on Solaris? ISTM it would be cleaner to just properly enable c99 mode rather than

Re: [HACKERS] make pg_controldata accept -D dirname

2014-09-24 Thread Alvaro Herrera
Abhijit Menon-Sen wrote: P.S. Trivia: I can't find any other options in Postgres where the argument is mandatory but the option is optional. psql behaves similarly with its -d and -U switches also; note --help: Usage: psql [OPTION]... [DBNAME [USERNAME]] ... -d, --dbname=DBNAME

Re: [HACKERS] Core function in Postgres

2014-09-24 Thread Merlin Moncure
On Tue, Sep 23, 2014 at 7:02 PM, Michael Paquier michael.paqu...@gmail.com wrote: On Wed, Sep 24, 2014 at 8:29 AM, Mingzhe Li mingzhe0...@gmail.com wrote: Hi experts, I want to know what's the core function used in Postgres server? I am looking for something corresponding to main() in a

Re: [HACKERS] identify_locking_dependencies is broken for schema-only dumps

2014-09-24 Thread Robert Haas
On Fri, Sep 19, 2014 at 11:23 AM, Robert Haas robertmh...@gmail.com wrote: This can lead to deadlocks during parallel restore. Test case: create table bar (a int primary key, b int); create table baz (z int, a int references bar); create view foo as select a, b, sum(1) from bar group by a

Re: [HACKERS] Final Patch for GROUPING SETS

2014-09-24 Thread Heikki Linnakangas
There's been a lot of discussion and I haven't followed it in detail. Andrew, there were some open questions, but have you gotten enough feedback so that you know what to do next? I'm trying to get this commitfest to an end, and this is still in Needs Review state... - Heikki -- Sent via

Re: [HACKERS] “Core” function in Postgres

2014-09-24 Thread Craig Ringer
On 09/24/2014 07:29 AM, Mingzhe Li wrote: PS: I have the same post on stackoverflow. Since no one answered there, I just report here. Thanks for mentioning it. In future, please include a link. You might want to wait more than a couple of hours too ;-) For reference, the Stack Overflow post

Re: [HACKERS] make pg_controldata accept -D dirname

2014-09-24 Thread Abhijit Menon-Sen
Updated patches attached. -- Abhijit From b3bd465357f96ebf1953b3a98f25fb51bac5eb26 Mon Sep 17 00:00:00 2001 From: Abhijit Menon-Sen a...@2ndquadrant.com Date: Wed, 24 Sep 2014 16:26:00 +0530 Subject: Make pg_controldata ignore a -D before DataDir --- doc/src/sgml/ref/pg_controldata.sgml| 5

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

2014-09-24 Thread Ants Aasma
On Tue, Sep 23, 2014 at 8:15 PM, Florian Weimer f...@deneb.enyo.de wrote: * Ants Aasma: CRC has exactly one hardware implementation in general purpose CPU's I'm pretty sure that's not true. Many general purpose CPUs have CRC circuity, and there must be some which also expose them as

[HACKERS] src/backend/replication/Makefile misses -I.

2014-09-24 Thread Andres Freund
Hi, Because of the atomics patch I was building postgres with sun studio. Turns out vpath builds don't work in that scenario when building from git. The problem is that the replication Makefile override CPPFLAGS := -I$(srcdir) $(CPPFLAGS) includes the source directory, but not the current

Re: [HACKERS] [v9.5] Custom Plan API

2014-09-24 Thread Robert Haas
On Wed, Sep 17, 2014 at 7:40 PM, Kouhei Kaigai kai...@ak.jp.nec.com wrote: At this moment, I revised the above portion of the patches. create_custom_plan() was modified to call PlanCustomPath callback next to the initialization of tlist and clauses. It's probably same as what you suggested.

Re: [HACKERS] better atomics - v0.6

2014-09-24 Thread Heikki Linnakangas
On 09/24/2014 03:37 PM, Andres Freund wrote: +/* + * pg_fetch_add_until_u32 - saturated addition to variable + * + * Returns the the value of ptr after the arithmetic operation. + * + * Full barrier semantics. + */ +STATIC_IF_INLINE uint32 +pg_atomic_fetch_add_until_u32(volatile

Re: [HACKERS] better atomics - v0.6

2014-09-24 Thread Andres Freund
On 2014-09-24 18:55:51 +0300, Heikki Linnakangas wrote: On 09/24/2014 03:37 PM, Andres Freund wrote: +/* + * pg_fetch_add_until_u32 - saturated addition to variable + * + * Returns the the value of ptr after the arithmetic operation. + * + * Full barrier semantics. + */

Re: [HACKERS] identify_locking_dependencies is broken for schema-only dumps

2014-09-24 Thread Tom Lane
Robert Haas robertmh...@gmail.com writes: If there are no comments on this soon-ish, I'm going to push and back-patched the patch I attached. Sorry for not paying attention sooner. After studying it for awhile, I think the change is probably all right but your proposed comment is entirely

Re: [HACKERS] better atomics - v0.6

2014-09-24 Thread Tom Lane
Andres Freund and...@2ndquadrant.com writes: On 2014-09-24 18:55:51 +0300, Heikki Linnakangas wrote: There doesn't seem to be any hardware implementations of that in the patch. Is there any architecture that has an instruction or compiler intrinsic for that? You can implement it rather

Re: [HACKERS] Final Patch for GROUPING SETS

2014-09-24 Thread Andrew Gierth
Heikki == Heikki Linnakangas hlinnakan...@vmware.com writes: Heikki There's been a lot of discussion and I haven't followed it in Heikki detail. Andrew, there were some open questions, but have you Heikki gotten enough feedback so that you know what to do next? I was holding off on posting a

Re: [HACKERS] better atomics - v0.6

2014-09-24 Thread Andres Freund
On 2014-09-24 12:44:09 -0400, Tom Lane wrote: Andres Freund and...@2ndquadrant.com writes: On 2014-09-24 18:55:51 +0300, Heikki Linnakangas wrote: There doesn't seem to be any hardware implementations of that in the patch. Is there any architecture that has an instruction or compiler

Re: [HACKERS] add modulo (%) operator to pgbench

2014-09-24 Thread Kevin Grittner
Fabien COELHO coe...@cri.ensmp.fr wrote: So my opinion is that this small modulo operator patch is both useful and harmless, so it should be committed. You've really failed to make that case --- in particular, AFAICS there is not even consensus on the exact semantics that the operator should

Re: [HACKERS] add modulo (%) operator to pgbench

2014-09-24 Thread Tom Lane
Kevin Grittner kgri...@ymail.com writes: Assuming that all values are integers, for: x = a / b; y = a % b; If b is zero either statement must generate an error. If a and b have the same sign, x must be positive; else x must be negative. It must hold that abs(x) is equal to abs(a)

Re: [HACKERS] better atomics - v0.6

2014-09-24 Thread Heikki Linnakangas
On 09/24/2014 07:57 PM, Andres Freund wrote: On 2014-09-24 12:44:09 -0400, Tom Lane wrote: Andres Freund and...@2ndquadrant.com writes: On 2014-09-24 18:55:51 +0300, Heikki Linnakangas wrote: There doesn't seem to be any hardware implementations of that in the patch. Is there any architecture

Re: [HACKERS] add modulo (%) operator to pgbench

2014-09-24 Thread Fabien COELHO
No, it depends totally on the application. For financial and physical inventory purposes where I have had occasion to use it, the properties which were important were: [...] Hmmm. Probably I'm biased towards my compiler with an integer linear flavor field, where C-like % is always a pain,

Re: [HACKERS] better atomics - v0.6

2014-09-24 Thread Andres Freund
On 2014-09-24 21:19:06 +0300, Heikki Linnakangas wrote: On 09/24/2014 07:57 PM, Andres Freund wrote: On 2014-09-24 12:44:09 -0400, Tom Lane wrote: Andres Freund and...@2ndquadrant.com writes: On 2014-09-24 18:55:51 +0300, Heikki Linnakangas wrote: There doesn't seem to be any hardware

Re: [HACKERS] better atomics - v0.6

2014-09-24 Thread Tom Lane
Heikki Linnakangas hlinnakan...@vmware.com writes: On 09/24/2014 07:57 PM, Andres Freund wrote: On 2014-09-24 12:44:09 -0400, Tom Lane wrote: I think the question is more like what in the world happened to confining ourselves to a small set of atomics. I fail to see why the existance of a

Re: [HACKERS] add modulo (%) operator to pgbench

2014-09-24 Thread Fabien COELHO
The idea of a modulo operator was not rejected, we'd just like to have the infrastructure in place first. Sigh. How to transform a trivial 10 lines patch into a probably 500+ lines project involving flex bison some non trivial data structures, and which may get rejected on any ground...

Re: [HACKERS] better atomics - v0.6

2014-09-24 Thread Andres Freund
On 2014-09-24 14:28:18 -0400, Tom Lane wrote: Note that the spinlock code separates s_lock.h (hardware implementations) from spin.h (a hardware-independent abstraction layer). Perhaps there's room for a similar separation here. Luckily that separation exists ;). The hardware dependant bits

[HACKERS] json_object_agg return on no rows

2014-09-24 Thread Andrew Dunstan
Probably due to an oversight on my part, json_object_agg currently returns a json object with no fields rather than NULL, which the docs say it will, and which would be consistent with all other aggregates except count(). I don't think we ever discussed this, so it's probably just a slip up.

Re: [HACKERS] add modulo (%) operator to pgbench

2014-09-24 Thread Heikki Linnakangas
On 09/24/2014 09:34 PM, Fabien COELHO wrote: The idea of a modulo operator was not rejected, we'd just like to have the infrastructure in place first. Sigh. How to transform a trivial 10 lines patch into a probably 500+ lines project involving flex bison some non trivial data structures,

Re: [HACKERS] identify_locking_dependencies is broken for schema-only dumps

2014-09-24 Thread Robert Haas
On Wed, Sep 24, 2014 at 12:18 PM, Tom Lane t...@sss.pgh.pa.us wrote: Robert Haas robertmh...@gmail.com writes: If there are no comments on this soon-ish, I'm going to push and back-patched the patch I attached. Sorry for not paying attention sooner. After studying it for awhile, I think the

Re: [HACKERS] missing isinf declaration on solaris

2014-09-24 Thread Peter Eisentraut
On 9/24/14 9:21 AM, Tom Lane wrote: Oskari Saarenmaa o...@ohmu.fi writes: ... so to enable XPG6 we'd need to use C99 mode anyway. OK. Could we just use -std=gnu99 (with -fgnu89-inline if required) with GCC on Solaris? ISTM it would be cleaner to just properly enable c99 mode rather

[HACKERS] interval typmodout is broken

2014-09-24 Thread Alvaro Herrera
I just noticed when working on DDL deparsing that the typmodout routine for intervals is broken. The code uses if (precision != INTERVAL_FULL_PRECISION) snprintf(res, 64, %s(%d), fieldstr, precision); else snprintf(res, 64, %s, fieldstr); which

Re: [HACKERS] RLS feature has been committed

2014-09-24 Thread Stephen Frost
Heikki, * Heikki Linnakangas (hlinnakan...@vmware.com) wrote: Some random comments after a quick read-through of the patch: Many thanks for this, again. I've pushed updates along with the fix for relcache which was identified by the buildfarm. Thanks, Stephen

Re: [HACKERS] identify_locking_dependencies is broken for schema-only dumps

2014-09-24 Thread Tom Lane
Robert Haas robertmh...@gmail.com writes: On Wed, Sep 24, 2014 at 12:18 PM, Tom Lane t...@sss.pgh.pa.us wrote: Sorry for not paying attention sooner. After studying it for awhile, I think the change is probably all right but your proposed comment is entirely inadequate. If you don't like

Re: [HACKERS] Immediate standby promotion

2014-09-24 Thread Simon Riggs
On 18 September 2014 01:22, Robert Haas robertmh...@gmail.com wrote: fast promotion was actually a supported option in r8 of Postgres but this option was removed when we implemented streaming replication in r9.0 The *rough* requirement is sane, but that's not the same thing as saying this

Re: [HACKERS] missing isinf declaration on solaris

2014-09-24 Thread Alvaro Herrera
Tom Lane wrote: Peter Eisentraut pete...@gmx.net writes: On 9/24/14 9:21 AM, Tom Lane wrote: Agreed, but what about non-GCC compilers? Stick AC_PROG_CC_C99 into configure.in. I think that's a bad idea, unless you mean to do it only on Solaris. If we do that unconditionally, we will

Re: [HACKERS] interval typmodout is broken

2014-09-24 Thread Tom Lane
Alvaro Herrera alvhe...@2ndquadrant.com writes: I just noticed when working on DDL deparsing that the typmodout routine for intervals is broken. The code uses if (precision != INTERVAL_FULL_PRECISION) snprintf(res, 64, %s(%d), fieldstr, precision); else

Re: [HACKERS] Review of GetUserId() Usage

2014-09-24 Thread Stephen Frost
Alvaro, * Alvaro Herrera (alvhe...@2ndquadrant.com) wrote: I think the case for pgstat_get_backend_current_activity() and pg_stat_get_activity and the other pgstatfuncs.c callers is easy to make and seems acceptable to me; but I would leave pg_signal_backend out of that discussion, because it

Re: [HACKERS] interval typmodout is broken

2014-09-24 Thread Alvaro Herrera
Tom Lane wrote: Alvaro Herrera alvhe...@2ndquadrant.com writes: I just noticed when working on DDL deparsing that the typmodout routine for intervals is broken. The code uses if (precision != INTERVAL_FULL_PRECISION) snprintf(res, 64, %s(%d), fieldstr, precision);

[HACKERS] Sloppy thinking about leakproof properties of opclass co-members

2014-09-24 Thread Tom Lane
It strikes me that there's a significant gap in the whole leakproof function business, namely that no consideration has been given to planner-driven transformations of queries. As an example, if we have a = b and b = c, the planner may generate and apply a = c instead of one or both of those

Re: [HACKERS] missing isinf declaration on solaris

2014-09-24 Thread Peter Eisentraut
On 9/24/14 4:26 PM, Tom Lane wrote: Peter Eisentraut pete...@gmx.net writes: On 9/24/14 9:21 AM, Tom Lane wrote: Agreed, but what about non-GCC compilers? Stick AC_PROG_CC_C99 into configure.in. I think that's a bad idea, unless you mean to do it only on Solaris. If we do that

Re: [HACKERS] proposal: rounding up time value less than its unit.

2014-09-24 Thread Peter Eisentraut
On 9/23/14 11:55 PM, Gregory Smith wrote: Right now there are people out there who have configurations that look like this: log_rotation_age=60 In order to get hourly rotation. These users will suffer some trauma should they upgrade to a version where this parameter now means a new log

Re: [HACKERS] B-Tree support function number 3 (strxfrm() optimization)

2014-09-24 Thread Peter Geoghegan
On Fri, Sep 19, 2014 at 2:54 PM, Peter Geoghegan p...@heroku.com wrote: Probably not - it appears to make very little difference to unoptimized pass-by-reference types whether or not datum1 can be used (see my simulation of Kevin's worst case, for example [1]). Streaming through a not

Re: [HACKERS] delta relations in AFTER triggers

2014-09-24 Thread Craig Ringer
On 08/28/2014 05:03 AM, Kevin Grittner wrote: I don't have to squint that hard -- I've always been comfortable with the definition of a table as a relation variable, and it's not too big a stretch to expand that to a tuplestore. ;-) In fact, I will be surprised if someone doesn't latch onto

Re: [HACKERS] Immediate standby promotion

2014-09-24 Thread Michael Paquier
On Thu, Sep 25, 2014 at 5:36 AM, Simon Riggs si...@2ndquadrant.com wrote: We go to a lot of trouble to ensure data is successfully on disk and in WAL. I won't give that up, nor do I want to make it easier to lose data than it already is. +1. -- Michael -- Sent via pgsql-hackers mailing list

Re: [HACKERS] delta relations in AFTER triggers

2014-09-24 Thread Craig Ringer
On 09/15/2014 10:25 PM, Kevin Grittner wrote: I broke out the changes from the previous patch in multiple commits in my repository on github: *Thankyou* That gives me the incentive to pull it and test it. A nice patch series published in a git repo is so much easier to work with than a giant

Re: [HACKERS] add modulo (%) operator to pgbench

2014-09-24 Thread Robert Haas
On Wed, Sep 24, 2014 at 2:34 PM, Fabien COELHO coe...@cri.ensmp.fr wrote: Sigh. How to transform a trivial 10 lines patch into a probably 500+ lines project involving flex bison some non trivial data structures, and which may get rejected on any ground... Maybe I'll set that as a student

Re: [HACKERS] identify_locking_dependencies is broken for schema-only dumps

2014-09-24 Thread Robert Haas
On Wed, Sep 24, 2014 at 4:36 PM, Tom Lane t...@sss.pgh.pa.us wrote: Robert Haas robertmh...@gmail.com writes: On Wed, Sep 24, 2014 at 12:18 PM, Tom Lane t...@sss.pgh.pa.us wrote: Sorry for not paying attention sooner. After studying it for awhile, I think the change is probably all right but

Re: [HACKERS] interval typmodout is broken

2014-09-24 Thread Tom Lane
Alvaro Herrera alvhe...@2ndquadrant.com writes: Tom Lane wrote: You sure about that? The grammar for INTERVAL is weird. Well, I tested what is taken on input, and yes I agree the grammar is weird (but not more weird than timestamp/timestamptz, mind). The input function only accepts the

Re: [HACKERS] proposal: rounding up time value less than its unit.

2014-09-24 Thread Gregory Smith
On 9/24/14, 6:45 PM, Peter Eisentraut wrote: But then this proposal is just one of several others that break backward compatibility, and does so in a more or less silent way. Then we might as well pick another approach that gets closer to the root of the problem. I was responding to some

Re: [HACKERS] proposal: rounding up time value less than its unit.

2014-09-24 Thread Tom Lane
Gregory Smith gregsmithpg...@gmail.com writes: I don't see any agreement on the real root of a problem here yet. That makes gauging whether any smaller change leads that way or not fuzzy. I personally would be fine doing nothing right now, instead waiting until that's charted

Re: [HACKERS] proposal: rounding up time value less than its unit.

2014-09-24 Thread David Johnston
On Thu, Sep 25, 2014 at 12:11 AM, Gregory Smith gregsmithpg...@gmail.com wrote: On 9/24/14, 6:45 PM, Peter Eisentraut wrote: But then this proposal is just one of several others that break backward compatibility, and does so in a more or less silent way. Then we might as well pick another

Re: [HACKERS] a fast bloat measurement tool (was Re: Measuring relation free space)

2014-09-24 Thread Abhijit Menon-Sen
At 2014-09-24 11:09:24 +0200, and...@2ndquadrant.com wrote: Why not add it to the stattuple extension, but as an independent function (and file)? Thanks, that's a good idea. I'll do that. I think it's completely unacceptable to copy a visibility routine. OK. Which visibility routine should

Re: [HACKERS] proposal: rounding up time value less than its unit.

2014-09-24 Thread David Johnston
On Thu, Sep 25, 2014 at 12:46 AM, Tom Lane t...@sss.pgh.pa.us wrote: Gregory Smith gregsmithpg...@gmail.com writes: I don't see any agreement on the real root of a problem here yet. That makes gauging whether any smaller change leads that way or not fuzzy. I personally would be fine doing

Re: [HACKERS] proposal: rounding up time value less than its unit.

2014-09-24 Thread Tom Lane
David Johnston david.g.johns...@gmail.com writes: On Thu, Sep 25, 2014 at 12:46 AM, Tom Lane t...@sss.pgh.pa.us wrote: TBH I've also been wondering whether any of these proposed cures are better than the disease. The changes that can be argued to make the behavior more sane are also ones that

Re: [HACKERS] add modulo (%) operator to pgbench

2014-09-24 Thread Gregory Smith
On 9/24/14, 10:10 PM, Robert Haas wrote: I think you're making a mountain out of a molehill. I implemented this today in about three hours. I think you're greatly understating your own efficiency at shift/reducing parser mountains down to molehills. Fabien even guessed the LOC size of the

Re: [HACKERS] proposal: rounding up time value less than its unit.

2014-09-24 Thread David Johnston
On Thu, Sep 25, 2014 at 1:04 AM, Tom Lane t...@sss.pgh.pa.us wrote: David Johnston david.g.johns...@gmail.com writes: On Thu, Sep 25, 2014 at 12:46 AM, Tom Lane t...@sss.pgh.pa.us wrote: TBH I've also been wondering whether any of these proposed cures are better than the disease. The