[HACKERS] Unwanted LOG during recovery of DROP TABLESPACE REDO

2014-07-16 Thread Rajeev rastogi
I found and fixed a bug that causes recovery (crash recovery , PITR) to throw unwanted LOG message if the tablespace symlink is not found during the processing of DROP TABLESPACE redo. LOG: could not remove symbolic link pg_tblspc/16384: No such file or

Re: Bug in spg_range_quad_inner_consistent for adjacent operator (was Re: [HACKERS] Add a filed to PageHeaderData)

2014-07-16 Thread Heikki Linnakangas
On 07/16/2014 08:30 AM, Michael Paquier wrote: On Wed, Jul 16, 2014 at 1:34 PM, Pavan Deolasee pavan.deola...@gmail.com wrote: Heikki, did you get chance to commit your patch? IMHO we should get the bug fix in before minor releases next week. My apologies if you've already committed it and I've

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

2014-07-16 Thread Magnus Hagander
On Jul 16, 2014 7:05 AM, Alvaro Herrera alvhe...@2ndquadrant.com wrote: Tom Lane wrote: Dilip kumar dilip.ku...@huawei.com writes: On 15 July 2014 19:01, Magnus Hagander Wrote, I am late to this game, but the first thing to my mind was - do we really need the whole forking/threading

Re: [HACKERS] Deadlocks in HS (on 9.0 :( )

2014-07-16 Thread Andres Freund
On 2014-07-15 16:54:05 +0100, Greg Stark wrote: We've observed a 9.0 database have undetected deadlocks repeatedly in hot standby mode. I think what's happening is that autovacuum is kicking off a VACUUM of some system catalogs -- it seems to usually be pg_statistics' toast table actually.

Re: [HACKERS] Built-in binning functions

2014-07-16 Thread Petr Jelinek
On 08/07/14 02:14, Tom Lane wrote: Petr Jelinek p...@2ndquadrant.com writes: here is a patch implementing varwidth_bucket (naming is up for discussion) function which does binning with variable bucket width. I didn't see any discussion of the naming question in this thread. I'd like to

[HACKERS] [BUG?] tuples from file_fdw has strange xids.

2014-07-16 Thread Kyotaro HORIGUCHI
Hello, I found that tuples come from file_fdw has strange xmin and xmax. postgres=# select tableoid, xmin, xmax, * from passwd1; tableoid | xmin |xmax| uname | pass | uid | gid | .. 16396 | 244 | 4294967295 | root | x| 0 | 0 | root... 16396 |

[HACKERS] BUFFER_LOCK_EXCLUSIVE is used in ginbuildempty().

2014-07-16 Thread Kyotaro HORIGUCHI
Hello, As far as I see gin seems using GIN_EXCLUSIVE instead of BUFFER_LOCK_EXCLUSIVE for LockBuffer, but the raw BUFFER_LOCK_EXCLUSIVE appears in ginbuildempty(). Does it has a meaning to fix them to GIN_EXCLUSIVE? regards, -- Kyotaro Horiguchi NTT Open Source Software Center diff --git

Re: [HACKERS] [bug fix] pg_ctl always uses the same event source

2014-07-16 Thread Magnus Hagander
On Wed, Jul 16, 2014 at 6:37 AM, Amit Kapila amit.kapil...@gmail.com wrote: On Tue, Jul 15, 2014 at 8:57 PM, MauMau maumau...@gmail.com wrote: From: Magnus Hagander mag...@hagander.net Well, it does in a couple of places. I'm nto sure it's that important (as nobody has AFAIK ever requested

Re: [HACKERS] Allowing join removals for more join types

2014-07-16 Thread David Rowley
On Wed, Jul 16, 2014 at 1:17 PM, Tom Lane t...@sss.pgh.pa.us wrote: David Rowley dgrowle...@gmail.com writes: I've attached an updated patch which puts in some fast path code for subquery type joins. I'm really not too sure on a good name for this function. I've ended up with

[HACKERS] [TODO] Process pg_hba.conf keywords as case-insensitive

2014-07-16 Thread Viswanatham kirankumar
Attached patch is implementing following TODO item Process pg_hba.conf keywords as case-insensitive * More robust pg_hba.conf parsing/error logginghttp://archives.postgresql.org/pgsql-hackers/2009-09/msg00432.php Thanks Regards, Viswanatham Kiran Kumar

Re: [HACKERS] Allowing NOT IN to use ANTI joins

2014-07-16 Thread David Rowley
On Wed, Jul 16, 2014 at 9:11 AM, Tom Lane t...@sss.pgh.pa.us wrote: Simon Riggs si...@2ndquadrant.com writes: On 15 July 2014 12:58, David Rowley dgrowle...@gmail.com wrote: I found that the call to is_NOTANY_compatible_with_antijoin adds about 0.2% and 2.3% to total planning time. Though

Re: [HACKERS] better atomics - v0.5

2014-07-16 Thread Amit Kapila
On Mon, Jul 14, 2014 at 12:47 AM, Andres Freund and...@2ndquadrant.com wrote: On 2014-07-08 11:51:14 +0530, Amit Kapila wrote: On Thu, Jul 3, 2014 at 10:56 AM, Amit Kapila amit.kapil...@gmail.com wrote: Further review of patch: 1. /* * pg_atomic_test_and_set_flag - TAS() * *

Re: [HACKERS] SSL information view

2014-07-16 Thread Magnus Hagander
On Mon, Jul 14, 2014 at 7:54 PM, Stefan Kaltenbrunner ste...@kaltenbrunner.cc wrote: On 07/13/2014 10:35 PM, Magnus Hagander wrote: On Sun, Jul 13, 2014 at 10:32 PM, Stefan Kaltenbrunner ste...@kaltenbrunner.cc wrote: On 07/12/2014 03:08 PM, Magnus Hagander wrote: As an administrator, I find

Re: [HACKERS] [bug fix] pg_ctl always uses the same event source

2014-07-16 Thread Amit Kapila
On Wed, Jul 16, 2014 at 2:11 PM, Magnus Hagander mag...@hagander.net wrote: On Wed, Jul 16, 2014 at 6:37 AM, Amit Kapila amit.kapil...@gmail.com wrote: There's also the change to throw an error if the source is already registered, which is potentially a bigger problem. I think generally if

Re: [HACKERS] [bug fix] pg_ctl always uses the same event source

2014-07-16 Thread Magnus Hagander
On Wed, Jul 16, 2014 at 12:31 PM, Amit Kapila amit.kapil...@gmail.com wrote: On Wed, Jul 16, 2014 at 2:11 PM, Magnus Hagander mag...@hagander.net wrote: On Wed, Jul 16, 2014 at 6:37 AM, Amit Kapila amit.kapil...@gmail.com wrote: There's also the change to throw an error if the source is

Re: [HACKERS] [bug fix] pg_ctl always uses the same event source

2014-07-16 Thread Amit Kapila
On Wed, Jul 16, 2014 at 4:06 PM, Magnus Hagander mag...@hagander.net wrote: On Wed, Jul 16, 2014 at 12:31 PM, Amit Kapila amit.kapil...@gmail.com wrote: On Wed, Jul 16, 2014 at 2:11 PM, Magnus Hagander mag...@hagander.net wrote: On Wed, Jul 16, 2014 at 6:37 AM, Amit Kapila

Re: [HACKERS] [bug fix] pg_ctl always uses the same event source

2014-07-16 Thread MauMau
From: Magnus Hagander mag...@hagander.net There's also the change to throw an error if the source is already registered, which is potentially a bigger problem. Since the default will be the same everywhere, do we really want to throw an error when you install a second version, now that this is

Re: [HACKERS] [TODO] Process pg_hba.conf keywords as case-insensitive

2014-07-16 Thread Michael Paquier
On Wed, Jul 16, 2014 at 6:23 PM, Viswanatham kirankumar viswanatham.kiranku...@huawei.com wrote: Attached patch is implementing following TODO item Process pg_hba.conf keywords as case-insensitive More robust pg_hba.conf parsing/error logging You should consider adding this patch to the next

Re: [HACKERS] [bug fix] pg_ctl always uses the same event source

2014-07-16 Thread MauMau
From: Amit Kapila amit.kapil...@gmail.com So as a conclusion, the left over items to be handled for patch are: 1. Remove the new usage related to use of same event source name for registration from pgevent. 2. Document the information to prevent loss of messages in some scenarios as explained

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

2014-07-16 Thread Dilip kumar
On 16 July 2014 12:13 Magnus Hagander Wrote, Yeah, those are exactly my points. I think it would be significantly simpler to do it that way, rather than forking and threading. And also easier to make portable... (and as a optimization on Alvaros suggestion, you can of course reuse the

[HACKERS] Improvement of versioning on Windows, take two

2014-07-16 Thread Michael Paquier
Hi all, Please find attached a patch finishing the work begun during CF1. This adds versioning support for all the remaining dll and exe files on both MinGW and MSVC: - regress.dll (MSVC only) - isolationtester.exe - pg_isolation_regress.exe - pg_regress.exe - pg_regress_ecpg.exe - zic.exe I will

Re: [HACKERS] Pg_upgrade and toast tables bug discovered

2014-07-16 Thread Bruce Momjian
On Mon, Jul 14, 2014 at 09:40:33PM +0200, Andres Freund wrote: On 2014-07-11 09:55:34 -0400, Bruce Momjian wrote: On Fri, Jul 11, 2014 at 09:48:06AM -0400, Bruce Momjian wrote: Uh, why does this need to be in ALTER TABLE? Can't this be part of table creation done by pg_dump? Uh,

Re: [HACKERS] Pg_upgrade and toast tables bug discovered

2014-07-16 Thread Andres Freund
On 2014-07-16 10:19:05 -0400, Bruce Momjian wrote: What would be nice is if I could mark just the tables that will need toast tables created in that later phase (those tables that didn't have a toast table in the old cluster, but need one in the new cluster). However, I can't see

Re: [HACKERS] Unwanted LOG during recovery of DROP TABLESPACE REDO

2014-07-16 Thread Tom Lane
Rajeev rastogi rajeev.rast...@huawei.com writes: I found and fixed a bug that causes recovery (crash recovery , PITR) to throw unwanted LOG message if the tablespace symlink is not found during the processing of DROP TABLESPACE redo. LOG: could not remove

Re: [HACKERS] Allowing join removals for more join types

2014-07-16 Thread Tom Lane
David Rowley dgrowle...@gmail.com writes: On Wed, Jul 16, 2014 at 1:17 PM, Tom Lane t...@sss.pgh.pa.us wrote: Notably, I felt that pathnode.c was a pretty questionable place to be exporting distinctness-proof logic from, and after some reflection decided to move those functions to

Re: [HACKERS] [BUG?] tuples from file_fdw has strange xids.

2014-07-16 Thread Tom Lane
Kyotaro HORIGUCHI horiguchi.kyot...@lab.ntt.co.jp writes: Hello, I found that tuples come from file_fdw has strange xmin and xmax. file_fdw isn't documented to return anything useful for xmin/xmax/etc, so I don't find this surprising. The patch attached fixes the header of materialized tuple

Re: [HACKERS] [GSoC2014] Patch ALTER TABLE ... SET LOGGED

2014-07-16 Thread Christoph Berg
Re: Fabrízio de Royes Mello 2014-07-15 CAFcNs+pXpmfwi_rKF-cSBOHWC+E=xtsrnxicrgay6bcmthb...@mail.gmail.com What about the wqueue mechanism, though? Isn't that made exactly for the kind of catalog updates you are doing? Works, but this mechanism create a new entry in pg_class for toast, so

Re: [HACKERS] [TODO] Process pg_hba.conf keywords as case-insensitive

2014-07-16 Thread Christoph Berg
Re: Viswanatham kirankumar 2014-07-16 ec867def52699d4189b584a14baa7c2165440...@blreml504-mbx.china.huawei.com Attached patch is implementing following TODO item Process pg_hba.conf keywords as case-insensitive * More robust pg_hba.conf parsing/error

Re: [HACKERS] [TODO] Process pg_hba.conf keywords as case-insensitive

2014-07-16 Thread Tom Lane
Christoph Berg c...@df7cb.de writes: Re: Viswanatham kirankumar 2014-07-16 ec867def52699d4189b584a14baa7c2165440...@blreml504-mbx.china.huawei.com Attached patch is implementing following TODO item Process pg_hba.conf keywords as case-insensitive Hmm. I see a case for accepting ALL (as in

Re: [HACKERS] Pg_upgrade and toast tables bug discovered

2014-07-16 Thread Robert Haas
On Wed, Jul 16, 2014 at 10:19 AM, Bruce Momjian br...@momjian.us wrote: On Mon, Jul 14, 2014 at 09:40:33PM +0200, Andres Freund wrote: On 2014-07-11 09:55:34 -0400, Bruce Momjian wrote: On Fri, Jul 11, 2014 at 09:48:06AM -0400, Bruce Momjian wrote: Uh, why does this need to be in ALTER

Re: [HACKERS] [GSoC2014] Patch ALTER TABLE ... SET LOGGED

2014-07-16 Thread Andres Freund
Hi, I quickly looked at this patch and I think there's major missing pieces around buffer management and wal logging. a) Currently buffers that are in memory marked as permanent/non-permanent aren't forced out to disk/pruned from cache, not even when they're dirty. b) When converting from

Re: [HACKERS] [GSoC2014] Patch ALTER TABLE ... SET LOGGED

2014-07-16 Thread Andres Freund
On 2014-07-16 20:25:42 +0200, Andres Freund wrote: Hi, I quickly looked at this patch and I think there's major missing pieces around buffer management and wal logging. a) Currently buffers that are in memory marked as permanent/non-permanent aren't forced out to disk/pruned from

Re: [HACKERS] Built-in binning functions

2014-07-16 Thread Pavel Stehule
2014-07-16 10:04 GMT+02:00 Petr Jelinek p...@2ndquadrant.com: On 08/07/14 02:14, Tom Lane wrote: Petr Jelinek p...@2ndquadrant.com writes: here is a patch implementing varwidth_bucket (naming is up for discussion) function which does binning with variable bucket width. I didn't see any

[HACKERS] Allow GRANT TRIGGER privilege to DROP TRIGGER (Re: Bug ##7716)

2014-07-16 Thread Keith Fiske
I'd reported a few years ago what seemed an inconsistency with the TRIGGER permission on tables where it allows a role to create a trigger but not to drop it. I don't have the original email to reply directly to the thread anymore, but I've moved on to actually trying to fix it myself, hence

Re: [HACKERS] [GSoC2014] Patch ALTER TABLE ... SET LOGGED

2014-07-16 Thread Fabrízio de Royes Mello
On Wed, Jul 16, 2014 at 3:53 PM, Andres Freund and...@2ndquadrant.com wrote: On 2014-07-16 20:25:42 +0200, Andres Freund wrote: Hi, I quickly looked at this patch and I think there's major missing pieces around buffer management and wal logging. a) Currently buffers that are in

[HACKERS] Question about src/timezone/zic.c

2014-07-16 Thread John Cochran
I've recently found some time on my hands and have decided to see about contributing to the PostgreSQL project, so I've started browsing the code to get somewhat familiar with it. The file src/timezone/zic.c caused me to raise my eyebrows a bit and I have a question to ask because of this. I

Re: [HACKERS] [GSoC2014] Patch ALTER TABLE ... SET LOGGED

2014-07-16 Thread Andres Freund
On 2014-07-16 20:53:06 +0200, Andres Freund wrote: On 2014-07-16 20:25:42 +0200, Andres Freund wrote: Hi, I quickly looked at this patch and I think there's major missing pieces around buffer management and wal logging. a) Currently buffers that are in memory marked as

Re: [HACKERS] Question about src/timezone/zic.c

2014-07-16 Thread Tom Lane
John Cochran j69coch...@gmail.com writes: [ useless code in zic.c ] I agree with you that that function looks pretty pointless, but here's the thing: that's not our code. Most of the code in src/timezone is taken directly from the IANA tzcode distribution (see src/timezone/README), and we're

Re: [HACKERS] [GSoC2014] Patch ALTER TABLE ... SET LOGGED

2014-07-16 Thread Fabrízio de Royes Mello
On Wed, Jul 16, 2014 at 7:26 PM, Andres Freund and...@2ndquadrant.com wrote: On 2014-07-16 20:53:06 +0200, Andres Freund wrote: On 2014-07-16 20:25:42 +0200, Andres Freund wrote: Hi, I quickly looked at this patch and I think there's major missing pieces around buffer management

Re: [HACKERS] Allow GRANT TRIGGER privilege to DROP TRIGGER (Re: Bug ##7716)

2014-07-16 Thread Tom Lane
Keith Fiske ke...@omniti.com writes: I found RemoveTriggerById() in backend/commands/trigger.c which seems to be the code that actually drops the trigger. And I see in CreateTrigger() above it how to use pg_class_aclcheck() to check for valid permissions, so I was going to see about adding

Re: [HACKERS] RLS Design

2014-07-16 Thread Tom Lane
Brightwell, Adam adam.brightw...@crunchydatasolutions.com writes: You could do: ALTER TABLE table_name ADD POLICY policy_name (quals); ALTER TABLE table_name POLICY FOR role_name IS policy_name; ALTER TABLE table_name DROP POLICY policy_name; I am attempting to modify the grammar to

Re: [HACKERS] RLS Design

2014-07-16 Thread Stephen Frost
Adam, * Tom Lane (t...@sss.pgh.pa.us) wrote: Brightwell, Adam adam.brightw...@crunchydatasolutions.com writes: ALTER TABLE table_name ADD POLICY policy_name (quals); ALTER TABLE table_name POLICY FOR role_name IS policy_name; ALTER TABLE table_name DROP POLICY policy_name; [...] This

Re: [HACKERS] Question about src/timezone/zic.c

2014-07-16 Thread Stephen Frost
* Tom Lane (t...@sss.pgh.pa.us) wrote: One thing that *would* be worth doing is merging upstream's recent updates; for all I know they've already dealt with this. According to the README, we last synced with the 2010c tzcode release, so we're short a few years worth of upstream bug fixes

Re: [HACKERS] RLS Design

2014-07-16 Thread Brightwell, Adam
Tom, Thanks for the feedback. 20MB messages to the list aren't that friendly. Please don't do that again, unless asked to. Apologies, I didn't realize it was so large until after it was sent. At any rate, it won't happen again. FWIW, the above syntax is a nonstarter, at least unless

Re: [HACKERS] RLS Design

2014-07-16 Thread Brightwell, Adam
Stephen, Yeah, now that we're trying to bake this into ALTER TABLE we need to be a bit more cautious. I'd think: ALTER TABLE tab POLICY ADD ... Would work though? (note: haven't looked/tested myself) Yes, I just tested it and the following would work from a grammar perspective: ALTER

Re: [HACKERS] RLS Design

2014-07-16 Thread Stephen Frost
Adam, * Brightwell, Adam (adam.brightw...@crunchydatasolutions.com) wrote: Yeah, now that we're trying to bake this into ALTER TABLE we need to be a bit more cautious. I'd think: ALTER TABLE tab POLICY ADD ... Would work though? (note: haven't looked/tested myself) Yes, I just

Re: [HACKERS] Question about src/timezone/zic.c

2014-07-16 Thread Tom Lane
Stephen Frost sfr...@snowman.net writes: * Tom Lane (t...@sss.pgh.pa.us) wrote: One thing that *would* be worth doing is merging upstream's recent updates; for all I know they've already dealt with this. According to the README, we last synced with the 2010c tzcode release, so we're short a

Re: [HACKERS] gaussian distribution pgbench -- part 1/2

2014-07-16 Thread Fabien COELHO
pgbench with gaussian exponential, part 1 of 2. This patch is a subset of the previous patch which only adds the two new \setrandom gaussian and exponantial variants, but not the adapted pgbench test cases, as suggested by Fujii Masao. There is no new code nor code changes. The corresponding

Re: [HACKERS] [BUG?] tuples from file_fdw has strange xids.

2014-07-16 Thread Kyotaro HORIGUCHI
Hello, sorry, it's my bad. Kyotaro HORIGUCHI horiguchi.kyot...@lab.ntt.co.jp writes: Hello, I found that tuples come from file_fdw has strange xmin and xmax. file_fdw isn't documented to return anything useful for xmin/xmax/etc, so I don't find this surprising. The patch attached fixes