Re: [HACKERS] better atomics - v0.5

2014-06-27 Thread Amit Kapila
On Wed, Jun 25, 2014 at 10:44 PM, Andres Freund wrote: > > Attached is a new version of the atomic operations patch. Lots has > changed since the last post: > > * gcc, msvc work. acc, xlc, sunpro have blindly written support which > should be relatively easy to fix up. All try to implement TAS,

Re: [HACKERS] Window function optimisation, allow pushdowns of items matching PARTITION BY clauses

2014-06-27 Thread Tom Lane
David Rowley writes: > [ wfunc_pushdown_partitionby_v0.4.patch ] I've committed this with the addition of a volatility check and some other basically-cosmetic adjustments. regards, tom lane -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make c

Re: [HACKERS] ALTER SYSTEM RESET?

2014-06-27 Thread Amit Kapila
On Fri, Jun 27, 2014 at 12:27 PM, Vik Fearing wrote: > On 06/27/2014 08:49 AM, Vik Fearing wrote: > > This third patch reformats the documentation in the way I expected it to > > be committed. > > Amit, > > I added this to the next commitfest with your name as reviewer. No issues, I will review i

Re: [HACKERS] better atomics - v0.5

2014-06-27 Thread Robert Haas
On Fri, Jun 27, 2014 at 2:00 PM, Andres Freund wrote: > On 2014-06-27 13:15:25 -0400, Robert Haas wrote: >> On Thu, Jun 26, 2014 at 3:04 PM, Andres Freund >> wrote: >> > I don't really see usecases where it's not related data that's being >> > touched, but: The point is that the fastpath (not us

Re: [HACKERS] Spinlocks and compiler/memory barriers

2014-06-27 Thread Robert Haas
On Fri, Jun 27, 2014 at 2:04 PM, Andres Freund wrote: > On 2014-06-27 13:04:02 -0400, Robert Haas wrote: >> On Thu, Jun 26, 2014 at 6:40 PM, Tom Lane wrote: >> > Andres Freund writes: >> >> On 2014-06-26 14:13:07 -0700, Tom Lane wrote: >> >>> Surely it had better be a read barrier as well? >> >

Re: [HACKERS] [PATCH 0/3] Tau support

2014-06-27 Thread Robert Haas
On Fri, Jun 27, 2014 at 9:03 PM, Tom Lane wrote: > =?UTF-8?q?Asbj=C3=B8rn=20Sloth=20T=C3=B8nnesen?= writes: >> Please see the following patches for implementing support >> for and migrating to Tau in PostgreSQL. > > While I don't particularly object to adding a tau() function, the rest of > this

Re: [HACKERS] [PATCH 0/3] Tau support

2014-06-27 Thread David Fetter
On Fri, Jun 27, 2014 at 06:03:33PM -0700, Tom Lane wrote: > =?UTF-8?q?Asbj=C3=B8rn=20Sloth=20T=C3=B8nnesen?= writes: > > Please see the following patches for implementing support for and > > migrating to Tau in PostgreSQL. > > While I don't particularly object to adding a tau() function, the > re

Re: [HACKERS] [PATCH 0/3] Tau support

2014-06-27 Thread Tom Lane
=?UTF-8?q?Asbj=C3=B8rn=20Sloth=20T=C3=B8nnesen?= writes: > Please see the following patches for implementing support > for and migrating to Tau in PostgreSQL. While I don't particularly object to adding a tau() function, the rest of this seems like change for the sake of change. What's the point

[HACKERS] [PATCH 1/3] Implement tau() function

2014-06-27 Thread Asbjørn Sloth Tønnesen
Signed-off-by: Asbjørn Sloth Tønnesen --- doc/src/sgml/func.sgml| 13 + src/backend/utils/adt/float.c | 17 +++-- src/include/catalog/pg_proc.h | 2 ++ src/include/utils/builtins.h | 1 + 4 files changed, 31 insertions(+), 2 deletions(-) diff --git a/doc/src/sg

[HACKERS] [PATCH 2/3] backend: use M_TAU instead of M_PI

2014-06-27 Thread Asbjørn Sloth Tønnesen
Signed-off-by: Asbjørn Sloth Tønnesen --- src/backend/utils/adt/float.c | 4 ++-- src/backend/utils/adt/geo_ops.c | 8 ++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/backend/utils/adt/float.c b/src/backend/utils/adt/float.c index 1278053..b0211f8 100644 --- a/src/ba

[HACKERS] [PATCH 3/3] earthdistance: TWO_PI => M_TAU

2014-06-27 Thread Asbjørn Sloth Tønnesen
Signed-off-by: Asbjørn Sloth Tønnesen --- contrib/earthdistance/earthdistance.c | 12 +++- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/contrib/earthdistance/earthdistance.c b/contrib/earthdistance/earthdistance.c index 6bbebdf..432309c 100644 --- a/contrib/earthdistance

[HACKERS] [PATCH 0/3] Tau support

2014-06-27 Thread Asbjørn Sloth Tønnesen
Hi, Please see the following patches for implementing support for and migrating to Tau in PostgreSQL. Happy Tau Day Hacking http://tauday.com/ Make sure to check out this shory story: http://tauday.com/a-parable Asbjørn Sloth Tønnesen (3): Implement tau() function backend: use M_TAU inst

Re: [HACKERS] delta relations in AFTER triggers

2014-06-27 Thread David Fetter
On Sat, Jun 21, 2014 at 11:06:26AM -0700, Kevin Grittner wrote: > Kevin Grittner wrote: > > Kevin Grittner wrote: > > > >> I've already said that I now think we should use the standard > >> CREATE TRIGGER syntax to specify the transition tables, and that > >> if we do that we don't need the relop

Re: [HACKERS] Atomics hardware support table & supported architectures

2014-06-27 Thread Noah Misch
On Fri, Jun 27, 2014 at 07:51:32PM +0200, Andres Freund wrote: > On 2014-06-27 13:12:31 -0400, Robert Haas wrote: > > I don't personally object to dropping Alpha, but when this was > > discussed back in October, Stefan did: > > > > http://www.postgresql.org/message-id/52616373.10...@kaltenbrunner.

Re: [HACKERS] Atomics hardware support table & supported architectures

2014-06-27 Thread Stefan Kaltenbrunner
On 06/27/2014 08:26 PM, Tom Lane wrote: > Andres Freund writes: >> On 2014-06-27 13:12:31 -0400, Robert Haas wrote: >>> I don't personally object to dropping Alpha, but when this was >>> discussed back in October, Stefan did: >>> >>> http://www.postgresql.org/message-id/52616373.10...@kaltenbrunne

[HACKERS] Re: [BUGS] BUG #8673: Could not open file "pg_multixact/members/xxxx" on slave during hot_standby

2014-06-27 Thread Alvaro Herrera
Jeff Janes wrote: > This problem was initially fairly easy to reproduce, but since I > started adding instrumentation specifically to catch it, it has become > devilishly hard to reproduce. > > I think my next step will be to also log each of the values which goes > into the complex if (...) expr

Re: [HACKERS] better atomics - v0.5

2014-06-27 Thread Andres Freund
On 2014-06-27 13:15:25 -0400, Robert Haas wrote: > On Thu, Jun 26, 2014 at 3:04 PM, Andres Freund wrote: > > I don't really see usecases where it's not related data that's being > > touched, but: The point is that the fastpath (not using a spinlock) might > > touch the atomic variable, even while

Re: [HACKERS] Atomics hardware support table & supported architectures

2014-06-27 Thread Tom Lane
Andres Freund writes: > On 2014-06-27 13:12:31 -0400, Robert Haas wrote: >> I don't personally object to dropping Alpha, but when this was >> discussed back in October, Stefan did: >> >> http://www.postgresql.org/message-id/52616373.10...@kaltenbrunner.cc As an ex-packager I do not believe the a

Re: [HACKERS] pgaudit - an auditing extension for PostgreSQL

2014-06-27 Thread Stephen Frost
Robert, * Robert Haas (robertmh...@gmail.com) wrote: > I agree with Stephen's statement that the audit configuration > shouldn't be managed in flat files. If somebody wants to do that in > an extension, fine, but I don't think we should commit anything into > our source tree that works that way.

Re: [HACKERS] Spinlocks and compiler/memory barriers

2014-06-27 Thread Andres Freund
On 2014-06-27 13:04:02 -0400, Robert Haas wrote: > On Thu, Jun 26, 2014 at 6:40 PM, Tom Lane wrote: > > Andres Freund writes: > >> On 2014-06-26 14:13:07 -0700, Tom Lane wrote: > >>> Surely it had better be a read barrier as well? > > > >> I don't immediately see why it has to be read barrier? Ho

Re: [HACKERS] Atomics hardware support table & supported architectures

2014-06-27 Thread Andres Freund
On 2014-06-27 13:12:31 -0400, Robert Haas wrote: > I have noticed that most PostgreSQL committers seem for format their > commit messages so that paragraphs are separated by a blank line, but > you seem not to do that. I find that less readable. I'll change that. > > Since there seems to be (una

Re: [HACKERS] Spinlocks and compiler/memory barriers

2014-06-27 Thread Andres Freund
On 2014-06-27 13:00:34 -0400, Robert Haas wrote: > There are two separate issues here: > > 1. SpinLockAcquire and SpinLockRelease are not guaranteed to be > compiler barriers, so all relevant memory accesses in the critical > section need to be done using volatile pointers. Failing to do this > i

Re: [HACKERS] pgaudit - an auditing extension for PostgreSQL

2014-06-27 Thread Robert Haas
On Thu, Jun 26, 2014 at 3:50 AM, Abhijit Menon-Sen wrote: > At 2014-06-25 10:36:07 -0400, sfr...@snowman.net wrote: >> >> To me, that's ridiculous on the face of it. Other databases have had >> this kind of capability as a matter of course for decades- we are far >> behind in this area. > > OK, I

Re: [HACKERS] better atomics - v0.5

2014-06-27 Thread Robert Haas
On Thu, Jun 26, 2014 at 3:04 PM, Andres Freund wrote: > I don't really see usecases where it's not related data that's being > touched, but: The point is that the fastpath (not using a spinlock) might > touch the atomic variable, even while the slowpath has acquired the > spinlock. So the slowpath

Re: [HACKERS] Atomics hardware support table & supported architectures

2014-06-27 Thread Robert Haas
On Fri, Jun 27, 2014 at 9:59 AM, Andres Freund wrote: > On 2014-06-24 10:22:08 -0700, Tom Lane wrote: >> Andres Freund writes: >> > On 2014-06-24 13:03:37 -0400, Noah Misch wrote: >> >> If a change has the potential to make some architectures give wrong >> >> answers only at odd times, that's a d

Re: [HACKERS] Spinlocks and compiler/memory barriers

2014-06-27 Thread Robert Haas
On Thu, Jun 26, 2014 at 6:40 PM, Tom Lane wrote: > Andres Freund writes: >> On 2014-06-26 14:13:07 -0700, Tom Lane wrote: >>> Surely it had better be a read barrier as well? > >> I don't immediately see why it has to be read barrier? Hoisting a load >> from after the release into the locked area

Re: [HACKERS] Spinlocks and compiler/memory barriers

2014-06-27 Thread Robert Haas
On Thu, Jun 26, 2014 at 5:01 PM, Andres Freund wrote: > But a) isn't really avoidable because it'll otherwise generate compiler > warnings and b) is done that way all over the tree. E.g. lwlock.c has > several copies of (note the nonvolatility of proc): > volatile LWLock *lock = l; >

Re: [HACKERS] Index-only scans and non-MVCC snapshots

2014-06-27 Thread Ryan Johnson
On 27/06/2014 8:20 AM, Alvaro Herrera wrote: Ryan Johnson wrote: On 26/06/2014 11:04 PM, Alvaro Herrera wrote: Ryan Johnson wrote: As part of a research project, I'm trying to change Read Committed isolation to use HeapTupleSatisfiesNow rather than acquiring a new snapshot at every command [1]

[HACKERS] pgstat_heap() consults freed memory

2014-06-27 Thread Noah Misch
pgstat_heap() creates a BufferAccessStrategy and attaches it to a HeapScanDesc. It continues to use that strategy after calling heap_endscan(), which frees the strategy. This is only a risk when the table contains empty pages at the end. I get a crash in an assert-enabled build with this test pr

Re: [HACKERS] Index-only scans and non-MVCC snapshots

2014-06-27 Thread Andres Freund
On 2014-06-27 08:39:13 -0600, Ryan Johnson wrote: > On 27/06/2014 3:14 AM, Andres Freund wrote: > >On 2014-06-26 22:47:47 -0600, Ryan Johnson wrote: > >>Hi, > >> > >>As part of a research project, I'm trying to change Read Committed isolation > >>to use HeapTupleSatisfiesNow rather than acquiring a

Re: [HACKERS] Index-only scans and non-MVCC snapshots

2014-06-27 Thread Ryan Johnson
On 27/06/2014 3:14 AM, Andres Freund wrote: On 2014-06-26 22:47:47 -0600, Ryan Johnson wrote: Hi, As part of a research project, I'm trying to change Read Committed isolation to use HeapTupleSatisfiesNow rather than acquiring a new snapshot at every command [1]. Things appear to have gone reaso

Re: [HACKERS] WAL replay bugs

2014-06-27 Thread Michael Paquier
On Fri, Jun 27, 2014 at 2:57 PM, Michael Paquier wrote: > Here are rebased patches, their was a conflict with a recent commit in > contrib/pg_upgrade. > I am resending patch 2 as it contained a rebase conflict not correctly resolved (Thanks Alvaro). Regards, -- Michael From d4f0289ffcece54a78e5

Re: [HACKERS] Index-only scans and non-MVCC snapshots

2014-06-27 Thread Alvaro Herrera
Ryan Johnson wrote: > On 26/06/2014 11:04 PM, Alvaro Herrera wrote: > >Ryan Johnson wrote: > >>As part of a research project, I'm trying to change Read Committed > >>isolation to use HeapTupleSatisfiesNow rather than acquiring a new > >>snapshot at every command [1]. > >Are you aware of this? > > >

Re: [HACKERS] change alter user to be a true alias for alter role

2014-06-27 Thread Vik Fearing
On 06/19/2014 07:18 PM, Tom Lane wrote: > Jov writes: >> the doc say: >>> ALTER USER is now an alias for ALTER >>> ROLE > >> but alter user lack the following format: >> ... > > If we're going to have a policy that these commands b

Re: [HACKERS] Atomics hardware support table & supported architectures

2014-06-27 Thread Andres Freund
On 2014-06-24 10:22:08 -0700, Tom Lane wrote: > Andres Freund writes: > > On 2014-06-24 13:03:37 -0400, Noah Misch wrote: > >> If a change has the potential to make some architectures give wrong > >> answers only at odd times, that's a different kind of problem. For > >> that reason, actively bre

Re: [HACKERS] idle_in_transaction_timeout

2014-06-27 Thread Robert Haas
On Wed, Jun 25, 2014 at 11:40 AM, Tom Lane wrote: > Fujii Masao writes: >> Why is IIT timeout turned on only when send_ready_for_query is true? >> I was thinking it should be turned on every time a message is received. >> Imagine the case where the session is in idle-in-transaction state and >> a

Re: [HACKERS] pg_receivexlog add synchronous mode

2014-06-27 Thread Andres Freund
On 2014-06-05 19:13:34 +0900, furu...@pm.nttdata.co.jp wrote: > > -Original Message- > > Hi, > > > > On 2014-06-05 17:09:44 +0900, furu...@pm.nttdata.co.jp wrote: > > > Synchronous(synchronous_commit = on) mode offers the ability to > > confirm WAL have been streamed in the same way as syn

Re: [HACKERS] pg_receivexlog add synchronous mode

2014-06-27 Thread Fujii Masao
On Thu, Jun 26, 2014 at 7:01 PM, wrote: >> The patch looks somewhat complicated and bugs can be easily introduced >> because it tries to not only add new feature but also reorganize the main >> loop in HandleCopyStream at the same time. To keep the patch simple, I'm >> thinking to firstly apply t

Re: [HACKERS] pg_resetxlog to clear backup start/end locations.

2014-06-27 Thread Fujii Masao
On Fri, Jun 27, 2014 at 12:29 PM, Kyotaro HORIGUCHI wrote: > Hello, I have finished the patches for all of 9.x. > >> I dont' touch what '-n' option shows and rewrite documents for >> the option a bit. And '-n' won't show the changes of backup >> location. > > -8.4: does not have backup locations i

Re: [HACKERS] Index-only scans and non-MVCC snapshots

2014-06-27 Thread Andres Freund
On 2014-06-26 22:47:47 -0600, Ryan Johnson wrote: > Hi, > > As part of a research project, I'm trying to change Read Committed isolation > to use HeapTupleSatisfiesNow rather than acquiring a new snapshot at every > command [1]. Things appear to have gone reasonably well so far, except > certain q

Re: [HACKERS] RLS Design

2014-06-27 Thread Dean Rasheed
On 26 June 2014 18:04, Robert Haas wrote: >> ALTER TABLE t1 SET POLICY p1 ON SELECT TO t1_p1_sel_quals; >> GRANT SELECT ON TABLE t1 TO role1 USING p1; > > As I see it, the downside of this is that it gets a lot more complex. > We have to revise the ACL representation, which is already pretty darn