Re: [HACKERS] [PATCH] Negative Transition Aggregate Functions (WIP)

2014-04-10 Thread David Rowley
On Thu, Apr 10, 2014 at 9:55 AM, Tom Lane t...@sss.pgh.pa.us wrote: I'm pretty sure David Rowley did some benchmarking. The results should be in this thread somewhere I think, but they currently evade me... Maybe David can re-post, if he's following this... I saw benchmarks addressing

Re: [HACKERS] [PATCH] Negative Transition Aggregate Functions (WIP)

2014-04-10 Thread David Rowley
On Thu, Apr 10, 2014 at 9:55 AM, Tom Lane t...@sss.pgh.pa.us wrote: Florian Pflug f...@phlo.org writes: I was (and still am) not in favour of duplicating the whole quadruple of (state, initialvalue, transferfunction, finalfunction) because it seems excessive. In fact, I believed that doing

Re: [HACKERS] WAL replay bugs

2014-04-10 Thread sachin kotwal
I executed given steps many times to produce this bug. But still I unable to hit this bug. I used attached scripts to produce this bug. Can I get scripts to produce this bug? wal_replay_bug.sh http://postgresql.1045698.n5.nabble.com/file/n5799512/wal_replay_bug.sh - Thanks and

Re: [HACKERS] WAL replay bugs

2014-04-10 Thread Heikki Linnakangas
On 04/10/2014 10:52 AM, sachin kotwal wrote: I executed given steps many times to produce this bug. But still I unable to hit this bug. I used attached scripts to produce this bug. Can I get scripts to produce this bug? wal_replay_bug.sh

Re: [HACKERS] Get more from indices.

2014-04-10 Thread Etsuro Fujita
(2014/04/10 0:08), Tom Lane wrote: Kyotaro HORIGUCHI horiguchi.kyot...@lab.ntt.co.jp writes: Oops! I found a bug in this patch. The previous v8 patch missed the case that build_index_pathkeys() could build a partial pathkeys from the index tlist. TBH I think that's barely the tip of the

[HACKERS]

2014-04-10 Thread Rajeev rastogi
On 10 April 2014 11:18, Pavan Deolasee Wrote: I could think of few global variables like transaction properties related(i.e. read-only mode, isolation level etc). As I plan to keep transaction properties of autonomous transaction same as main transaction, so there is no need to have these

Re: [HACKERS] small typo about comment in xlog.c

2014-04-10 Thread Heikki Linnakangas
On 04/10/2014 07:19 AM, Tomonari Katsumata wrote: Hi, I'm reading xlog.c, and I noticed a comment of do_pg_abort_backup is typo. ... 10247 * NB: This is only for aborting a non-exclusive backup that doesn't write 10248 * backup_label. A backup started with pg_stop_backup() needs to be

Re: [HACKERS] Autonomous Transaction (WIP)

2014-04-10 Thread Rajeev rastogi
On 10 April 2014 11:18, Pavan Deolasee Wrote: I could think of few global variables like transaction properties related(i.e. read-only mode, isolation level etc). As I plan to keep transaction properties of autonomous transaction same as main transaction, so there is no need to have these

Re: [HACKERS] WIP patch (v2) for updatable security barrier views

2014-04-10 Thread Gregory Smith
On 4/9/14 9:56 PM, Stephen Frost wrote: As for docs and testing, those are things we would certainly be better off with and may mean that this isn't able to make it into 9.4, which is fair, but I wouldn't toss it out solely due to that. We have a git repo with multiple worked out code

Re: [HACKERS] [BUG FIX] Compare returned value by socket() against PGINVALID_SOCKET instead of 0

2014-04-10 Thread Bruce Momjian
On Thu, Apr 10, 2014 at 11:05:49AM +0530, Amit Kapila wrote: On Tue, Apr 8, 2014 at 11:32 PM, Bruce Momjian br...@momjian.us wrote: On Sun, Apr 6, 2014 at 11:45:59AM +0530, Amit Kapila wrote: In fact, this C program compiled by gcc on Debian issues no compiler warnings and returns 'hello',

[HACKERS] Adding unsigned 256 bit integers

2014-04-10 Thread Olivier Lalonde
I was wondering if there would be any way to do the following in PostgreSQL: UPDATE cryptotable SET work = work + 'some big hexadecimal number' where work is an unsigned 256 bit integer. Right now my column is a character varying(64) column (hexadecimal representation of the number) but I

Re: [HACKERS] Get more from indices.

2014-04-10 Thread Tom Lane
Etsuro Fujita fujita.ets...@lab.ntt.co.jp writes: (2014/04/10 0:08), Tom Lane wrote: TBH I think that's barely the tip of the iceberg of cases where this patch will get the wrong answer. Also, I don't see it doing anything to check the ordering of multiple index columns I think that the

Re: [HACKERS] Adding unsigned 256 bit integers

2014-04-10 Thread Andrew Dunstan
On 04/10/2014 09:13 AM, Olivier Lalonde wrote: I was wondering if there would be any way to do the following in PostgreSQL: UPDATE cryptotable SET work = work + 'some big hexadecimal number' where work is an unsigned 256 bit integer. Right now my column is a character varying(64) column

Re: [HACKERS] Adding unsigned 256 bit integers

2014-04-10 Thread Craig Ringer
On 04/10/2014 09:13 PM, Olivier Lalonde wrote: I was wondering if there would be any way to do the following in PostgreSQL: UPDATE cryptotable SET work = work + 'some big hexadecimal number' For readers finding this in the archives, this question also appears here:

[HACKERS] Partial match fix for fast scan

2014-04-10 Thread Alexander Korotkov
Hi, GIN partial match appears to be broken after fast scan. Following simple test case raises assertion failure. create extension btree_gin; create table test as (select id, random() as val from generate_series(1,100) id); create index test_idx on test using gin (val); vacuum test; select *

Re: [HACKERS] Adding unsigned 256 bit integers

2014-04-10 Thread k...@rice.edu
On Thu, Apr 10, 2014 at 09:13:47PM +0800, Olivier Lalonde wrote: I was wondering if there would be any way to do the following in PostgreSQL: UPDATE cryptotable SET work = work + 'some big hexadecimal number' where work is an unsigned 256 bit integer. Right now my column is a character

Re: [HACKERS] [PATCH] Negative Transition Aggregate Functions (WIP)

2014-04-10 Thread Tom Lane
Dean Rasheed dean.a.rash...@gmail.com writes: On 10 April 2014 01:13, Florian Pflug f...@phlo.org wrote: However, I still believe the best approach at this point is to just work on making int4_avg_accum faster. I still see no principal reason what it has to be noticeably slower - the only

Re: [HACKERS] Problem with displaying wide tables in psql

2014-04-10 Thread Greg Stark
Ok, So I've hacked on this a bit. Below is a test case showing the problems I've found. 1) It isn't using the newline and wrap indicators or dividing lines. 2) The header is not being displayed properly when it contains a newline. I can hack in the newline and wrap indicators but the header

Re: [HACKERS] Partial match fix for fast scan

2014-04-10 Thread Fabrízio de Royes Mello
On Thu, Apr 10, 2014 at 11:09 AM, Alexander Korotkov aekorot...@gmail.comwrote: Hi, GIN partial match appears to be broken after fast scan. Following simple test case raises assertion failure. create extension btree_gin; create table test as (select id, random() as val from

Re: [HACKERS] psql \d+ and oid display

2014-04-10 Thread Robert Haas
On Wed, Apr 9, 2014 at 11:42 AM, Bruce Momjian br...@momjian.us wrote: On Wed, Apr 9, 2014 at 09:27:11AM -0400, Robert Haas wrote: On Wed, Apr 9, 2014 at 1:02 AM, Tom Lane t...@sss.pgh.pa.us wrote: Robert Haas robertmh...@gmail.com writes: Well, that's sorta my concern. I mean, right now

Re: [HACKERS] psql \d+ and oid display

2014-04-10 Thread Bruce Momjian
On Thu, Apr 10, 2014 at 12:23:40PM -0400, Robert Haas wrote: What might make more sense is this: if ((tableinfo.relkind == 'r' || tableinfo.relkind == 'm') /* * No need to display default values; we already display a * REPLICA IDENTITY

Re: [HACKERS] Minor performance improvement in transition to external sort

2014-04-10 Thread Simon Riggs
On 6 February 2014 18:21, Jeff Janes jeff.ja...@gmail.com wrote: On Tue, Feb 4, 2014 at 2:22 PM, Jeremy Harris j...@wizmail.org wrote: The attached patch replaces the existing siftup method for heapify with a siftdown method. Tested with random integers it does 18% fewer compares and takes

Re: [HACKERS] psql \d+ and oid display

2014-04-10 Thread Greg Stark
If it's conditional I think when it matches a guc is too hard for users to use. I think say nothing if oids are off and say something of their on would be fine. It would result in clutter for users which oids on by default but that's a non default setting. And the consequences of having oids on

Re: [HACKERS] psql \d+ and oid display

2014-04-10 Thread Bruce Momjian
On Thu, Apr 10, 2014 at 01:05:32PM -0400, Greg Stark wrote: If it's conditional I think when it matches a guc is too hard for users to use. Yes, we gave up on having the OID display match the GUC; we just display something if and only if it oids are present. Robert is talking about the

Re: [HACKERS] [PATCH] Negative Transition Aggregate Functions (WIP)

2014-04-10 Thread Dean Rasheed
On 10 April 2014 15:18, Tom Lane t...@sss.pgh.pa.us wrote: Dean Rasheed dean.a.rash...@gmail.com writes: On 10 April 2014 01:13, Florian Pflug f...@phlo.org wrote: However, I still believe the best approach at this point is to just work on making int4_avg_accum faster. I still see no principal

Re: [HACKERS] [PATCH] Negative Transition Aggregate Functions (WIP)

2014-04-10 Thread Tom Lane
Dean Rasheed dean.a.rash...@gmail.com writes: On 10 April 2014 15:18, Tom Lane t...@sss.pgh.pa.us wrote: This idea of a separate firsttrans function is interesting but perhaps orthogonal to the current patch. Also, I don't quite understand how it would work for aggregates with null

Re: [HACKERS] [PATCH] Negative Transition Aggregate Functions (WIP)

2014-04-10 Thread Dean Rasheed
On 10 April 2014 19:04, Tom Lane t...@sss.pgh.pa.us wrote: Dean Rasheed dean.a.rash...@gmail.com writes: On 10 April 2014 15:18, Tom Lane t...@sss.pgh.pa.us wrote: This idea of a separate firsttrans function is interesting but perhaps orthogonal to the current patch. Also, I don't quite

Re: [HACKERS] [PATCH] Negative Transition Aggregate Functions (WIP)

2014-04-10 Thread Tom Lane
Dean Rasheed dean.a.rash...@gmail.com writes: On 10 April 2014 19:04, Tom Lane t...@sss.pgh.pa.us wrote: What about names for the invertible-aggregate infrastructure? I'm tempted to prefix inv to all the existing names, but then invsfunc means the alternate forward function ... can we use

Re: [HACKERS] Partial match fix for fast scan

2014-04-10 Thread Alexander Korotkov
On Thu, Apr 10, 2014 at 8:22 PM, Fabrízio de Royes Mello fabriziome...@gmail.com wrote: On Thu, Apr 10, 2014 at 11:09 AM, Alexander Korotkov aekorot...@gmail.com wrote: Hi, GIN partial match appears to be broken after fast scan. Following simple test case raises assertion failure.

Re: [HACKERS] [PATCH] Negative Transition Aggregate Functions (WIP)

2014-04-10 Thread Dean Rasheed
On 10 April 2014 19:54, Tom Lane t...@sss.pgh.pa.us wrote: Dean Rasheed dean.a.rash...@gmail.com writes: On 10 April 2014 19:04, Tom Lane t...@sss.pgh.pa.us wrote: What about names for the invertible-aggregate infrastructure? I'm tempted to prefix inv to all the existing names, but then

Re: [HACKERS] Problem with displaying wide tables in psql

2014-04-10 Thread Sergey Muraviov
Hi. Thanks for your tests. I've fixed problem with headers, but got new one with data. I'll try to solve it tomorrow. 2014-04-10 18:45 GMT+04:00 Greg Stark st...@mit.edu: Ok, So I've hacked on this a bit. Below is a test case showing the problems I've found. 1) It isn't using the newline

Re: [HACKERS] Partial match fix for fast scan

2014-04-10 Thread Heikki Linnakangas
On 04/10/2014 10:00 PM, Alexander Korotkov wrote: On Thu, Apr 10, 2014 at 8:22 PM, Fabrízio de Royes Mello fabriziome...@gmail.com wrote: On Thu, Apr 10, 2014 at 11:09 AM, Alexander Korotkov aekorot...@gmail.com wrote: GIN partial match appears to be broken after fast scan. Following

Re: [HACKERS] trailing comment ghost-timing

2014-04-10 Thread Bruce Momjian
On Mon, Mar 31, 2014 at 02:06:28PM -0400, Bruce Momjian wrote: Where are we on this? It seem odd that psql sends /* */ comments to the server, but not -- comments. Should this be documented or changed? I am confused why changing the behavior would affect the regression test output as --

Re: [HACKERS] [PATCH] Negative Transition Aggregate Functions (WIP)

2014-04-10 Thread Florian Pflug
On Apr10, 2014, at 02:13 , Florian Pflug f...@phlo.org wrote: On Apr9, 2014, at 23:17 , Florian Pflug f...@phlo.org wrote: On Apr9, 2014, at 21:35 , Tom Lane t...@sss.pgh.pa.us wrote: A quick test says that avg(int4) is about five percent slower than sum(int4), so that's the kind of hit we'd

Re: [HACKERS] PostgreSQL in Windows console and Ctrl-C

2014-04-10 Thread Bruce Momjian
Can someone with Windows expertise comment on whether this should be applied? --- On Tue, Jan 7, 2014 at 12:44:33PM +0100, Christian Ullrich wrote: Hello all, when pg_ctl start is used to run PostgreSQL in a console

Re: [HACKERS] [PATCH] Negative Transition Aggregate Functions (WIP)

2014-04-10 Thread Tom Lane
Dean Rasheed dean.a.rash...@gmail.com writes: I was imagining that firsttrans would only be passed the first value to be aggregated, not any previous state, and that it would be illegal to specify both an initcond and a firsttrans function. The forward transition function would only be called

Re: [HACKERS] [PATCH] Negative Transition Aggregate Functions (WIP)

2014-04-10 Thread Florian Pflug
On Apr10, 2014, at 21:34 , Dean Rasheed dean.a.rash...@gmail.com wrote: On 10 April 2014 19:54, Tom Lane t...@sss.pgh.pa.us wrote: So if we go with that terminology, perhaps these names for the new CREATE AGGREGATE parameters: initfuncapplies to plain aggregation, mutually exclusive

Re: [HACKERS] [PATCH] Negative Transition Aggregate Functions (WIP)

2014-04-10 Thread Tom Lane
Florian Pflug f...@phlo.org writes: I still think you're getting ahead of yourselves here. The number of aggregates which benefit from this is tiny SUM(int2,int4) and maybe BOOL_{AND,OR}. And in the SUM(int2,int4) case *only* on 64-bit archs - for the others, the state type is already

Re: [HACKERS] [PATCH] Negative Transition Aggregate Functions (WIP)

2014-04-10 Thread Florian Pflug
On Apr11, 2014, at 00:07 , Tom Lane t...@sss.pgh.pa.us wrote: Florian Pflug f...@phlo.org writes: I still think you're getting ahead of yourselves here. The number of aggregates which benefit from this is tiny SUM(int2,int4) and maybe BOOL_{AND,OR}. And in the SUM(int2,int4) case *only* on

Re: [HACKERS] psql \d+ and oid display

2014-04-10 Thread Bruce Momjian
On Tue, Apr 1, 2014 at 10:45:29AM -0700, Jeff Janes wrote: I am suggesting it for at least some other things. I'm rather aggrieved that \d+ without argument shows you the size and the description/comment for every table, but \d+ foo does not show you the size and description/comment of the

Re: [HACKERS] [PATCH] Negative Transition Aggregate Functions (WIP)

2014-04-10 Thread Tom Lane
Florian Pflug f...@phlo.org writes: My argument is that is costs us more complexity to duplicate everything for the invertible case, *and* the result seems less flexible - not from the POV of aggregate implementations, but from the POV of future extensions. [ shrug... ] You can argue against

Re: [HACKERS] psql \d+ and oid display

2014-04-10 Thread Bruce Momjian
On Thu, Apr 10, 2014 at 01:10:35PM -0400, Bruce Momjian wrote: On Thu, Apr 10, 2014 at 01:05:32PM -0400, Greg Stark wrote: If it's conditional I think when it matches a guc is too hard for users to use. Yes, we gave up on having the OID display match the GUC; we just display something if

Re: [HACKERS] psql \d+ and oid display

2014-04-10 Thread Tom Lane
Bruce Momjian br...@momjian.us writes: It also has changed the OID status to only display if it exists. One question that came up with Robert is whether OID status should appear for \d as well, now that is only shows up when present. Yeah, I was wondering about that too. If part of the

Re: [HACKERS] psql \d+ and oid display

2014-04-10 Thread Bruce Momjian
On Thu, Apr 10, 2014 at 07:58:55PM -0400, Tom Lane wrote: Bruce Momjian br...@momjian.us writes: It also has changed the OID status to only display if it exists. One question that came up with Robert is whether OID status should appear for \d as well, now that is only shows up when

Re: [HACKERS] [PATCH] Negative Transition Aggregate Functions (WIP)

2014-04-10 Thread Florian Pflug
On Apr11, 2014, at 01:30 , Tom Lane t...@sss.pgh.pa.us wrote: Florian Pflug f...@phlo.org writes: As for evidence - have you looked at the patch I posted? I'd be very interested to know if it removes the performance differences you saw. (1) You can't really prove the absence of a performance

Re: [HACKERS] WAL replay bugs

2014-04-10 Thread Sachin D. Kotwal
On Thu, Apr 10, 2014 at 6:21 PM, Heikki Linnakangas hlinnakan...@vmware.com wrote: On 04/10/2014 10:52 AM, sachin kotwal wrote: I executed given steps many times to produce this bug. But still I unable to hit this bug. I used attached scripts to produce this bug. Can I get scripts to

Re: [HACKERS] PostgreSQL in Windows console and Ctrl-C

2014-04-10 Thread Haribabu Kommi
On Fri, Apr 11, 2014 at 7:44 AM, Bruce Momjian br...@momjian.us wrote: Can someone with Windows expertise comment on whether this should be applied? I tested the same in windows and it is working as specified. The same background running server can be closed with ctrl+break command.

Re: [HACKERS] PostgreSQL in Windows console and Ctrl-C

2014-04-10 Thread Bruce Momjian
On Fri, Apr 11, 2014 at 11:58:58AM +1000, Haribabu Kommi wrote: On Fri, Apr 11, 2014 at 7:44 AM, Bruce Momjian br...@momjian.us wrote: Can someone with Windows expertise comment on whether this should be applied? I tested the same in windows and it is working as specified. The same

Re: [HACKERS] PostgreSQL in Windows console and Ctrl-C

2014-04-10 Thread Haribabu Kommi
On Fri, Apr 11, 2014 at 12:12 PM, Bruce Momjian br...@momjian.us wrote: On Fri, Apr 11, 2014 at 11:58:58AM +1000, Haribabu Kommi wrote: On Fri, Apr 11, 2014 at 7:44 AM, Bruce Momjian br...@momjian.us wrote: Can someone with Windows expertise comment on whether this should be applied? I

Re: [HACKERS] Get more from indices.

2014-04-10 Thread Etsuro Fujita
(2014/04/10 22:25), Tom Lane wrote: Etsuro Fujita fujita.ets...@lab.ntt.co.jp writes: (2014/04/10 0:08), Tom Lane wrote: TBH I think that's barely the tip of the iceberg of cases where this patch will get the wrong answer. Also, I don't see it doing anything to check the ordering of

Re: [HACKERS] WIP patch (v2) for updatable security barrier views

2014-04-10 Thread Stephen Frost
Dean, Craig, all, * Dean Rasheed (dean.a.rash...@gmail.com) wrote: This is reflected in the change to the regression test output where, in one of the tests, the ctids for the table to update are no longer coming from the same table. I think a better approach is to push down the rowmark into

Re: [HACKERS] Adding unsigned 256 bit integers

2014-04-10 Thread Leon Smith
pgmp is also worth mentioning here, and it's likely to be more efficient than the numeric type or something you hack up yourself: http://pgmp.projects.pgfoundry.org/ Best, Leon On Thu, Apr 10, 2014 at 10:11 AM, k...@rice.edu k...@rice.edu wrote: On Thu, Apr 10, 2014 at 09:13:47PM +0800,

Re: [HACKERS] [BUG FIX] Compare returned value by socket() against PGINVALID_SOCKET instead of 0

2014-04-10 Thread Amit Kapila
On Thu, Apr 10, 2014 at 5:21 PM, Bruce Momjian br...@momjian.us wrote: On Thu, Apr 10, 2014 at 11:05:49AM +0530, Amit Kapila wrote: Ah, yes, good point. This is going to require backpatching then. I also think so. I think it's better to use check like below, just for matter of consistency

Re: [HACKERS] [BUG FIX] Compare returned value by socket() against PGINVALID_SOCKET instead of 0

2014-04-10 Thread Amit Kapila
On Fri, Apr 11, 2014 at 10:00 AM, Amit Kapila amit.kapil...@gmail.com wrote: On Thu, Apr 10, 2014 at 5:21 PM, Bruce Momjian br...@momjian.us wrote: On Thu, Apr 10, 2014 at 11:05:49AM +0530, Amit Kapila wrote: Ah, yes, good point. This is going to require backpatching then. I also think so.

Re: [HACKERS] Get more from indices.

2014-04-10 Thread Kyotaro HORIGUCHI
Hi, sorry for the absense. I've been back. Attached is the patch following the discussion below. (2014/04/10 0:08), Tom Lane wrote: TBH I think that's barely the tip of the iceberg of cases where this patch will get the wrong answer. Also, I don't see it doing anything to check the

Re: [HACKERS] Get more from indices.

2014-04-10 Thread Kyotaro HORIGUCHI
# Sorry for accidentialy sending the previous mail unfinished. ## ...and I seem to have bombed uncertain files off out of my ## home directory by accident, too :( = Hi, sorry for the absense. I've been back. Thank you for continuing this discussion. Attached is the patch following the

Re: [HACKERS] PostgreSQL in Windows console and Ctrl-C

2014-04-10 Thread Amit Kapila
On Fri, Apr 11, 2014 at 3:14 AM, Bruce Momjian br...@momjian.us wrote: Can someone with Windows expertise comment on whether this should be applied? I don't think this is a complete fix, for example what about platform where _CreateRestrictedToken() is not supported. For Example, the current