Re: [HACKERS] PostgreSQL 9.4 InterlockedCompareExchange appearing in mingw64-w32 causing issue with PostGIS win32 load

2014-05-23 Thread Paragon Corporation
-- REVISED NOTE -- Hm. s_lock.h does define TAS() in terms of InterlockedCompareExchange() if WIN32_ONLY_COMPILER is defined ... but that code hasn't changed in quite a long time. It seems like the combination of an extension built with WIN32_ONLY_COMPILER and a core built without that flag

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

2014-05-23 Thread David Rowley
On Mon, May 19, 2014 at 5:47 PM, Dilip kumar dilip.ku...@huawei.com wrote: So I think now when you are considering this join removal for subqueries then this can consider other case also like unique index inside subquery, because in attached patch unique index is considered only if its

Re: [HACKERS] uuid-ossp (Re: [pgsql-packagers] Postgresapp 9.4 beta build ready)

2014-05-23 Thread Matteo Beccati
On 22/05/2014 21:55, Matteo Beccati wrote: On 22/05/2014 17:07, Tom Lane wrote: Well, *I* don't want to do that work. I was hoping to find a volunteer, but the silence has been notable. I think deprecation is the next step. This sounds an easy enough task to try and submit a patch, if I'm

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

2014-05-23 Thread Dilip kumar
On 23 May 2014 12:43 David Rowley Wrote, I'm hitting a bit of a roadblock on point 1. Here's a snipped from my latest attempt: if (bms_membership(innerrel-relids) == BMS_SINGLETON) { int subqueryrelid =

[HACKERS] fix worker_spi to run as non-dynamic background worker

2014-05-23 Thread Shigeru Hanada
Hi all, I noticed that contrib/worker_spi can't run as non-dynamic background worker (IOW, load via shared_preload_libraries), because of uninitialized bgw_notify_pid. I got log lines below when starting PostgreSQL with shared_preload_libraries = 'worker_spi'. $ pg_ctl start -w waiting for

[HACKERS] postgres_fdw and connection management

2014-05-23 Thread Sandro Santilli
I'm evaluating use of the postgres FDW to keep in sync a central database to changes made in thousand other databases, via triggers. But as long as postgres_fdw keeps connections open for the whole lifetime of a session this conflicts with large use of poolers which make sessions virtually never

Re: [HACKERS] -DDISABLE_ENABLE_ASSERT

2014-05-23 Thread Robert Haas
On Thu, May 22, 2014 at 5:00 PM, Alvaro Herrera alvhe...@2ndquadrant.com wrote: Andres Freund wrote: On 2014-05-22 16:37:35 -0400, Tom Lane wrote: We could do that ... but I wonder if we shouldn't remove assert_enabled altogether. What's the use case for turning it off? Not matching the

Re: [HACKERS] SKIP LOCKED DATA (work in progress)

2014-05-23 Thread Robert Haas
On Sat, May 17, 2014 at 1:02 AM, Craig Ringer cr...@2ndquadrant.com wrote: We have a long tradition of trying to allow noise keywords where it's harmless. So the clause should probably be SKIP LOCKED [DATA] in much the same way we have BEGIN [ WORK | TRANSACTION ] ... There

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

2014-05-23 Thread David Rowley
On Fri, May 23, 2014 at 8:28 PM, Dilip kumar dilip.ku...@huawei.com wrote: On 23 May 2014 12:43 David Rowley Wrote, I'm hitting a bit of a roadblock on point 1. Here's a snipped from my latest attempt: if (bms_membership(innerrel-relids) == BMS_SINGLETON)

Re: [HACKERS] -DDISABLE_ENABLE_ASSERT

2014-05-23 Thread Andres Freund
On 2014-05-23 07:20:12 -0400, Robert Haas wrote: On Thu, May 22, 2014 at 5:00 PM, Alvaro Herrera alvhe...@2ndquadrant.com wrote: Andres Freund wrote: On 2014-05-22 16:37:35 -0400, Tom Lane wrote: We could do that ... but I wonder if we shouldn't remove assert_enabled altogether.

Re: [HACKERS] HEAD crashes with assertion and LWLOCK_STATS enabled

2014-05-23 Thread Robert Haas
On Tue, May 20, 2014 at 4:02 AM, Yuto HAYAMIZU y.hayam...@gmail.com wrote: The failing assertion is for prohibiting memory allocation in a critical section, which is introduced by commit 4a170ee9 on 2014-04-04. In my understanding, the root cause of the assertion failure is on-demand

Re: [HACKERS] -DDISABLE_ENABLE_ASSERT

2014-05-23 Thread Robert Haas
On Fri, May 23, 2014 at 8:15 AM, Andres Freund and...@2ndquadrant.com wrote: I've used it once or twice to avoid having to recompile postgres when I wanted things not to be *that* slow (AtEOXactBuffers() I am looking at you). But I wouldn't be very sad if it'd go. Anybody against that?

Re: [HACKERS] btree_gist macaddr valgrind woes

2014-05-23 Thread Alvaro Herrera
Heikki Linnakangas wrote: On 05/18/2014 12:23 AM, Tom Lane wrote: A larger issue is that we evidently have no buildfarm animals that are picky about alignment, or at least none that are running a modern-enough buildfarm script to be running the contrib/logical_decoding test. That seems like a

Re: [HACKERS] pg_upgrade fails: Mismatch of relation OID in database 8.4 - 9.3

2014-05-23 Thread Bruce Momjian
On Thu, May 22, 2014 at 09:20:38AM -0600, Jeff Ross wrote: I just tested ALTER TABLE in 8.4 and it does create a toast table for this case in 9.4: CREATE TABLE test (x CHAR(10)); ALTER TABLE test ALTER COLUMN x TYPE CHAR(8000); I just tried this on the problem table and it did

[HACKERS] Re: pg_upgrade fails: Mismatch of relation OID in database 8.4 - 9.3

2014-05-23 Thread David G Johnston
Bruce Momjian wrote On Thu, May 22, 2014 at 09:20:38AM -0600, Jeff Ross wrote: I just tested ALTER TABLE in 8.4 and it does create a toast table for this case in 9.4: CREATE TABLE test (x CHAR(10)); ALTER TABLE test ALTER COLUMN x TYPE CHAR(8000); I just tried this on the problem

Re: [HACKERS] pg_upgrade fails: Mismatch of relation OID in database 8.4 - 9.3

2014-05-23 Thread Andres Freund
On 2014-05-22 09:20:38 -0600, Jeff Ross wrote: On 5/21/14, 2:37 PM, Bruce Momjian wrote: The only item I can think of that would cause this is someone changing the length of a string. Did someone modify pg_attribute directly to increase the length of one of the character columns? I don't

Re: [HACKERS] Re: popen and pclose redefinitions causing many warning in Windows build

2014-05-23 Thread Alvaro Herrera
Heikki Linnakangas wrote: On 05/15/2014 04:15 PM, Michael Paquier wrote: On Thu, May 15, 2014 at 6:20 PM, Heikki Linnakangas hlinnakan...@vmware.com wrote: Ok, I committed #undefs. I don't have a Mingw(-w64) environment to test with, so let's see if the buildfarm likes it. There does not

Re: [HACKERS] -DDISABLE_ENABLE_ASSERT

2014-05-23 Thread Tom Lane
Robert Haas robertmh...@gmail.com writes: On Fri, May 23, 2014 at 8:15 AM, Andres Freund and...@2ndquadrant.com wrote: That means you're for a (differently named) disable macro? Or is it not recent enough that you don't care? I'm leaning toward thinking we should just rip it out. The fact

Re: [HACKERS] -DDISABLE_ENABLE_ASSERT

2014-05-23 Thread Andres Freund
On 2014-05-23 09:56:03 -0400, Tom Lane wrote: Robert Haas robertmh...@gmail.com writes: On Fri, May 23, 2014 at 8:15 AM, Andres Freund and...@2ndquadrant.com wrote: That means you're for a (differently named) disable macro? Or is it not recent enough that you don't care? I'm leaning

Re: [HACKERS] -DDISABLE_ENABLE_ASSERT

2014-05-23 Thread Tom Lane
Andres Freund and...@2ndquadrant.com writes: The next question is whether to wait till after the branching with this? +1 for waiting (it's only a couple weeks anyway). This isn't a user-facing feature in any way, so I feel no urgency to ship it in 9.4. regards, tom lane

Re: [HACKERS] pg_upgrade fails: Mismatch of relation OID in database 8.4 - 9.3

2014-05-23 Thread Bruce Momjian
On Thu, May 22, 2014 at 09:55:10AM -0400, Alvaro Herrera wrote: Bruce Momjian wrote: Moving forward, I think you need to add a dummy column to each problem table and drop the column that will create a toast table and allow you to do the upgrade. I could have pg_upgrade detect this

Re: [HACKERS] wrapping in extended mode doesn't work well with default pager

2014-05-23 Thread Alvaro Herrera
Sergey Muraviov wrote: I found some new bugs and fix them. And I had to make many changes. This version fixes some bugs I had noticed in expanded mode too. For instance, the original looked like this (five lines plus header): -[ RECORD 49

Re: [HACKERS] postgres_fdw and connection management

2014-05-23 Thread Fabrízio de Royes Mello
On Fri, May 23, 2014 at 8:09 AM, Sandro Santilli s...@keybit.net wrote: I'm evaluating use of the postgres FDW to keep in sync a central database to changes made in thousand other databases, via triggers. But as long as postgres_fdw keeps connections open for the whole lifetime of a session

Re: [HACKERS] pg_upgrade fails: Mismatch of relation OID in database 8.4 - 9.3

2014-05-23 Thread Jeff Ross
On 5/23/14, 7:36 AM, Andres Freund wrote: Any chance you could, *before* you create the toast table, do a: SELECT attrelid::regclass, attname, attnum, attlen, * FROM pg_attribute WHERE attrelid = 'a'::regclass ORDER BY attnum ASC; Where 'a' is replaced by the affected table? Greetings,

Re: [HACKERS] Congrats Andres Freund, the newest PostgreSQL Commiter!

2014-05-23 Thread Mike Blackwell
​Congrats Andres! Mike​ __ *Mike Blackwell | Technical Analyst, Distribution Services/Rollout Management | RR Donnelley* 1750 Wallace Ave | St Charles, IL 60174-3401 Office: 630.313.7818 mike.blackw...@rrd.com

Re: [HACKERS] pg_upgrade fails: Mismatch of relation OID in database 8.4 - 9.3

2014-05-23 Thread Jeff Ross
On 5/23/14, 7:21 AM, Bruce Momjian wrote: On Thu, May 22, 2014 at 09:20:38AM -0600, Jeff Ross wrote: I just tested ALTER TABLE in 8.4 and it does create a toast table for this case in 9.4: CREATE TABLE test (x CHAR(10)); ALTER TABLE test ALTER COLUMN x TYPE CHAR(8000); I

Re: [HACKERS] fix worker_spi to run as non-dynamic background worker

2014-05-23 Thread Michael Paquier
On Fri, May 23, 2014 at 6:29 PM, Shigeru Hanada shigeru.han...@gmail.com wrote: I noticed that contrib/worker_spi can't run as non-dynamic background worker (IOW, load via shared_preload_libraries), because of uninitialized bgw_notify_pid. That's actually the case of all the bgworkers that have

Re: [HACKERS] SKIP LOCKED DATA (work in progress)

2014-05-23 Thread Tom Lane
Robert Haas robertmh...@gmail.com writes: On Sat, May 17, 2014 at 1:02 AM, Craig Ringer cr...@2ndquadrant.com wrote: We have a long tradition of trying to allow noise keywords where it's harmless. So the clause should probably be SKIP LOCKED [DATA] in much the same way we have BEGIN

Re: [HACKERS] postgres_fdw and connection management

2014-05-23 Thread Sandro Santilli
On Fri, May 23, 2014 at 11:13:50AM -0300, Fabrízio de Royes Mello wrote: On Fri, May 23, 2014 at 8:09 AM, Sandro Santilli s...@keybit.net wrote: I'm evaluating use of the postgres FDW to keep in sync a central database to changes made in thousand other databases, via triggers. But as

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

2014-05-23 Thread Tom Lane
David Rowley dgrowle...@gmail.com writes: I've just had a bit of a look at implementing checks allowing subqueries with unique indexes on the join cols being removed, I'm a bit confused by this statement of the problem. I thought the idea was to recognize that subqueries with DISTINCT or GROUP

Re: [HACKERS] uuid-ossp (Re: [pgsql-packagers] Postgresapp 9.4 beta build ready)

2014-05-23 Thread Matteo Beccati
On 23/05/2014 10:05, Matteo Beccati wrote: You can find the code here: https://github.com/mbeccati/uuid # NetBSD variant https://github.com/mbeccati/uuid/tree/linux # Ubuntu variant For now, I've forked just RhodiumToad's uuid-freebsd extension, but I've made sure make works fine when

Re: [HACKERS] Wait free LW_SHARED acquisition - v0.2

2014-05-23 Thread Amit Kapila
On Fri, Jan 31, 2014 at 3:24 PM, Andres Freund and...@2ndquadrant.com wrote: I've pushed a rebased version of the patchset to http://git.postgresql.org/gitweb/?p=users/andresfreund/postgres.git branch rwlock contention. 220b34331f77effdb46798ddd7cca0cffc1b2858 actually was the small problem,

Re: [HACKERS] SKIP LOCKED DATA (work in progress)

2014-05-23 Thread Thomas Munro
On 23 May 2014 15:40, Tom Lane t...@sss.pgh.pa.us wrote: A different concern is that this patch adds not one but two new unreserved keywords, ie SKIP and LOCKED. That bloats our parser tables, which are too darn large already, and it has a nonzero compatibility cost (since we only allow

Re: [HACKERS] Re: pg_upgrade fails: Mismatch of relation OID in database 8.4 - 9.3

2014-05-23 Thread Bruce Momjian
On Fri, May 23, 2014 at 06:28:28AM -0700, David G Johnston wrote: Bruce Momjian wrote On Thu, May 22, 2014 at 09:20:38AM -0600, Jeff Ross wrote: I just tested ALTER TABLE in 8.4 and it does create a toast table for this case in 9.4: CREATE TABLE test (x CHAR(10)); ALTER TABLE

Re: [HACKERS] pg_upgrade fails: Mismatch of relation OID in database 8.4 - 9.3

2014-05-23 Thread Bruce Momjian
On Fri, May 23, 2014 at 08:32:35AM -0600, Jeff Ross wrote: On 5/23/14, 7:21 AM, Bruce Momjian wrote: On Thu, May 22, 2014 at 09:20:38AM -0600, Jeff Ross wrote: I just tested ALTER TABLE in 8.4 and it does create a toast table for this case in 9.4: CREATE TABLE test (x CHAR(10));

Re: [HACKERS] pg_upgrade fails: Mismatch of relation OID in database 8.4 - 9.3

2014-05-23 Thread Bruce Momjian
On Fri, May 23, 2014 at 03:36:20PM +0200, Andres Freund wrote: On 2014-05-22 09:20:38 -0600, Jeff Ross wrote: On 5/21/14, 2:37 PM, Bruce Momjian wrote: The only item I can think of that would cause this is someone changing the length of a string. Did someone modify pg_attribute directly to

Re: [HACKERS] 9.4 release notes

2014-05-23 Thread Bruce Momjian
On Fri, May 23, 2014 at 10:11:37AM +0900, Tomonari Katsumata wrote: Hi, I have two comments about 9.4 release notes. 1. typo Pg_upgrade now uses -U to specify the user name (Bruce Momjian) It should be pg_upgrade. 2. undesirable link Allow pg_recvlogical to receive data logical

Re: [HACKERS] SKIP LOCKED DATA (work in progress)

2014-05-23 Thread Simon Riggs
On 23 May 2014 10:40, Tom Lane t...@sss.pgh.pa.us wrote: If we're pulling syntax out of the air it'd be nice if we could avoid adding new keywords to the grammar. Oracle, SQLServer and DB2 have this capability. MySQL does not. SQLServer implements that using the table hint of READPAST. Since

Re: [HACKERS] SKIP LOCKED DATA (work in progress)

2014-05-23 Thread Pavel Stehule
2014-05-23 21:24 GMT+02:00 Simon Riggs si...@2ndquadrant.com: On 23 May 2014 10:40, Tom Lane t...@sss.pgh.pa.us wrote: If we're pulling syntax out of the air it'd be nice if we could avoid adding new keywords to the grammar. Oracle, SQLServer and DB2 have this capability. MySQL does not.

Re: [HACKERS] SKIP LOCKED DATA (work in progress)

2014-05-23 Thread Robert Haas
On Fri, May 23, 2014 at 3:24 PM, Simon Riggs si...@2ndquadrant.com wrote: PostgreSQL already chose to follow the Oracle syntax when we implemented NOWAIT. So my proposal is that we follow the Oracle syntax again and use the words SKIP LOCKED. I don't see any advantage in inventing new syntax

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

2014-05-23 Thread David Rowley
On Sat, May 24, 2014 at 3:13 AM, Tom Lane t...@sss.pgh.pa.us wrote: David Rowley dgrowle...@gmail.com writes: I've just had a bit of a look at implementing checks allowing subqueries with unique indexes on the join cols being removed, I'm a bit confused by this statement of the problem. I

[HACKERS] SQL access to database attributes

2014-05-23 Thread Vik Fearing
We try to tell our clients not to update the catalogs directly, but there are at least two instances where it's not possible to do otherwise (pg_database.datistemplate and .datallowconn). This patch aims to remedy that. For example, it is now possible to say ALTER DATABASE d ALLOW

Re: [HACKERS] SQL access to database attributes

2014-05-23 Thread Jaime Casanova
On Fri, May 23, 2014 at 10:53 PM, Vik Fearing vik.fear...@dalibo.com wrote: It was suggested to me that these options should either error out if there are existing connections or terminate said connections. I don't agree with that because there is no harm in connecting to a template database

Re: [HACKERS] SQL access to database attributes

2014-05-23 Thread Vik Fearing
On 05/24/2014 12:03 AM, Jaime Casanova wrote: On Fri, May 23, 2014 at 10:53 PM, Vik Fearing vik.fear...@dalibo.com wrote: It was suggested to me that these options should either error out if there are existing connections or terminate said connections. I don't agree with that because there is

Re: [HACKERS] SQL access to database attributes

2014-05-23 Thread Jaime Casanova
On Fri, May 23, 2014 at 11:06 PM, Vik Fearing vik.fear...@dalibo.com wrote: On 05/24/2014 12:03 AM, Jaime Casanova wrote: On Fri, May 23, 2014 at 10:53 PM, Vik Fearing vik.fear...@dalibo.com wrote: It was suggested to me that these options should either error out if there are existing