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 wrote: > David Johnston writes: > > On Thu, Sep 25, 2014 at 12:46 AM, Tom Lane 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

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

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

2014-09-24 Thread Tom Lane
David Johnston writes: > On Thu, Sep 25, 2014 at 12:46 AM, Tom Lane 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 introduce backwards compatibility >>

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 wrote: > Gregory Smith 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

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 shou

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 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 approach that gets

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

2014-09-24 Thread Tom Lane
Gregory Smith 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 out--especially if the alternative

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 desir

Re: [HACKERS] interval typmodout is broken

2014-09-24 Thread Tom Lane
Alvaro Herrera 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 precision just after t

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 wrote: > Robert Haas writes: >> On Wed, Sep 24, 2014 at 12:18 PM, Tom Lane 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.

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

2014-09-24 Thread Robert Haas
On Wed, Sep 24, 2014 at 2:34 PM, Fabien COELHO 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 project. I

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] Immediate standby promotion

2014-09-24 Thread Michael Paquier
On Thu, Sep 25, 2014 at 5:36 AM, Simon Riggs 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 (pgsql-hackers@pos

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 on

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 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 inconsiderable propo

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

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 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 unconditionall

[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 tho

Re: [HACKERS] interval typmodout is broken

2014-09-24 Thread Alvaro Herrera
Tom Lane wrote: > Alvaro Herrera 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

Re: [HACKERS] interval typmodout is broken

2014-09-24 Thread Tom Lane
Alvaro Herrera 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 > snprintf(res,

Re: [HACKERS] missing isinf declaration on solaris

2014-09-24 Thread Alvaro Herrera
Tom Lane wrote: > Peter Eisentraut 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 pretty

Re: [HACKERS] Immediate standby promotion

2014-09-24 Thread Simon Riggs
On 18 September 2014 01:22, Robert Haas 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 exact pat

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

2014-09-24 Thread Tom Lane
Robert Haas writes: > On Wed, Sep 24, 2014 at 12:18 PM, Tom Lane 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 that version, can you suggest some

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 signat

[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); whic

Re: [HACKERS] missing isinf declaration on solaris

2014-09-24 Thread Tom Lane
Peter Eisentraut 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 pretty much stop getting any warnings

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 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 tha

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 wrote: > Robert Haas 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 bu

Re: [HACKERS] Spinlocks and compiler/memory barriers

2014-09-24 Thread Andres Freund
On 2014-09-09 17:54:03 -0400, Robert Haas wrote: > So, that's committed, then. I think we should pick something that uses > spinlocks and is likely to fail spectacularly if we haven't got this > totally right yet, and de-volatilize it. And then watch to see what > turns red in the buildfarm and/or

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,

[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] 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

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 Tom Lane
Heikki Linnakangas 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 wrapper aroun

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 writes: > >>>On 2014-09-24 18:55:51 +0300, Heikki Linnakangas wrote: > There doesn't seem to be any hardware implementations

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 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 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 instructio

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

2014-09-24 Thread Tom Lane
Kevin Grittner 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) / abs(b). >

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

2014-09-24 Thread Kevin Grittner
Fabien COELHO 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 have. >

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 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 > >> t

Re: [HACKERS] Final Patch for GROUPING SETS

2014-09-24 Thread Andrew Gierth
> "Heikki" == Heikki Linnakangas 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 recut patch w

Re: [HACKERS] better atomics - v0.6

2014-09-24 Thread Tom Lane
Andres Freund 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 efficiently on ll/sc

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

2014-09-24 Thread Tom Lane
Robert Haas 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 inadequate. There are e

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 ba

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

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

2014-09-24 Thread Robert Haas
On Wed, Sep 17, 2014 at 7:40 PM, Kouhei Kaigai 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. create_custom_

[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 director

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 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 > instructions. I

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 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 +++-- src/bin/pg_c

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 pos

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] 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 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 union all > select

Re: [HACKERS] "Core" function in Postgres

2014-09-24 Thread Merlin Moncure
On Tue, Sep 23, 2014 at 7:02 PM, Michael Paquier wrote: > On Wed, Sep 24, 2014 at 8:29 AM, Mingzhe Li 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 simple C program. I want >> to know the f

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 data

Re: [HACKERS] missing isinf declaration on solaris

2014-09-24 Thread Oskari Saarenmaa
24.09.2014, 16:21, Tom Lane kirjoitti: Oskari Saarenmaa 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 un

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 a

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] delta relations in AFTER triggers

2014-09-24 Thread Heikki Linnakangas
On 09/24/2014 12:22 AM, Kevin Grittner wrote: Heikki Linnakangas 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 until it is closed, exc

Re: [HACKERS] make pg_controldata accept "-D dirname"

2014-09-24 Thread Tom Lane
Abhijit Menon-Sen 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 without > an o

Re: [HACKERS] missing isinf declaration on solaris

2014-09-24 Thread Tom Lane
Oskari Saarenmaa 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 a coupl

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 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 p

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 chang

Re: [HACKERS] missing isinf declaration on solaris

2014-09-24 Thread Oskari Saarenmaa
24.09.2014, 15:25, Tom Lane kirjoitti: Oskari Saarenmaa 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 which is included by , but it's su

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 pgsql-hacke

Re: [HACKERS] make pg_controldata accept "-D dirname"

2014-09-24 Thread Thom Brown
On 24 September 2014 12:04, Magnus Hagander wrote: > On Wed, Sep 24, 2014 at 12: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

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. > > Ye

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 > 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

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

Re: [HACKERS] missing isinf declaration on solaris

2014-09-24 Thread Tom Lane
Oskari Saarenmaa 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 which is included by , > but it's surrounded by #if defined(_STDC_C9

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 sp

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 > 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.

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

2014-09-24 Thread Tom Lane
Heikki Linnakangas 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 high-order JEntry

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 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 anything, not even if y

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 cha

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 Date: Wed, 24 Sep 2014 16:48

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 d

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 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

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

2014-09-24 Thread Heikki Linnakangas
On 09/24/2014 01:50 PM, Thom Brown wrote: On 15 August 2014 16:31, Pavel Stehule wrote: 2014-08-14 9:03 GMT+02:00 Heikki Linnakangas : 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 seems:

[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 15d43a3

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

2014-09-24 Thread Thom Brown
On 15 August 2014 16:31, Pavel Stehule wrote: > Hi > > > 2014-08-14 9:03 GMT+02:00 Heikki Linnakangas : > >> 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 seems: >>> >>> pg_dump: pg_bac

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 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 likely that there'

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 0

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. PQgetC

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 = PQresultErrorFi

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 pg

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

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 mak

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 gaus

Re: [HACKERS] BRIN indexes - TRAP: BadArgument

2014-09-24 Thread Heikki Linnakangas
On 09/23/2014 10:04 PM, Alvaro Herrera wrote: + + The BRIN implementation in PostgreSQL + is primarily maintained by Álvaro Herrera. + We don't usually have such verbiage in the docs. The GIN and GiST pages do, but I think those are a historic exceptions, not something we want to do