Re: [HACKERS] CLUSTER FREEZE

2013-10-25 Thread Andres Freund
On 2013-10-24 17:17:22 -0700, Josh Berkus wrote: On 10/24/2013 04:55 PM, Robert Haas wrote: On Thu, Oct 24, 2013 at 1:09 PM, Josh Berkus j...@agliodbs.com wrote: On 10/23/2013 09:58 PM, Amit Kapila wrote: I wonder why anyone would like to freeze during CLUSTER command when they already

Re: [HACKERS] Patch for fail-back without fresh backup

2013-10-25 Thread Michael Paquier
On Fri, Oct 25, 2013 at 5:57 AM, Magnus Hagander mag...@hagander.net wrote: In fact I've been considering suggesting we might want to retire the difference between archive and hot_standby as wal_level, because the difference is usually so small. And the advantage of hot_standby is in almost

Re: [HACKERS] Re: Using indexes for ORDER BY and PARTITION BY clause in windowing functions

2013-10-25 Thread Kyotaro HORIGUCHI
Hello, Agree that windowing function will return all the rows compared to max and group by returing only max rows per group. But even while arriving at the aggregate/sorting windowing function seems to spend more effort than group by/order by. (I'll apologise in advance for possible

[HACKERS] Example query causing param_info to be set in plain rel path

2013-10-25 Thread Ashutosh Bapat
Hi All, In order to test various cases of LATERAL join in Postgres-XC, I am trying to find a query where RelOptInof-lateral_relids would get set for plain base relations. I tried various examples like below. But none of them was able to set lateral_relids in RelOptInfo of the involved relations. I

[HACKERS] Document update in alter_foreign_data_wrapper.sgml

2013-10-25 Thread Etsuro Fujita
Hi, ISTM the document in alter_foreign_data_wrapper.sgml and the comment in foreigncmds.c should be updated. Please find attached a patch. Thanks, Best regards, Etsuro Fujita fdw-doc-update.patch Description: Binary data -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)

Re: [HACKERS] Patch for fail-back without fresh backup

2013-10-25 Thread Andres Freund
On 2013-10-24 13:51:52 -0700, Josh Berkus wrote: On 10/24/2013 01:14 PM, Heikki Linnakangas wrote: One extra WAL record whenever a hint bit is set on a page, for the first time after a checkpoint. In other words, a WAL record needs to be written in the same circumstances as with page

Re: [HACKERS] Patch for fail-back without fresh backup

2013-10-25 Thread Andres Freund
On 2013-10-24 22:57:29 +0200, Magnus Hagander wrote: In fact I've been considering suggesting we might want to retire the difference between archive and hot_standby as wal_level, because the difference is usually so small. And the advantage of hot_standby is in almost every case worth it. Even

Re: [HACKERS] logical changeset generation v6.2

2013-10-25 Thread Andres Freund
On 2013-10-24 10:59:21 -0400, Robert Haas wrote: On Tue, Oct 22, 2013 at 2:13 PM, Andres Freund and...@2ndquadrant.com wrote: On 2013-10-22 13:57:53 -0400, Robert Haas wrote: On Tue, Oct 22, 2013 at 1:08 PM, Andres Freund and...@2ndquadrant.com wrote: That strikes me as a flaw in the

Re: [HACKERS] logical changeset generation v6.2

2013-10-25 Thread Andres Freund
On 2013-10-21 16:15:58 +0200, Andres Freund wrote: I don't think I understand exactly what you have in mind for (2); can you elaborate? I have always thought that having a WaitForDecodingToCatchUp() primitive was a good way of handling changes that were otherwise too difficult to track

Re: [HACKERS] Location for external scripts for Extensions?

2013-10-25 Thread Peter Eisentraut
On 10/24/13, 5:37 PM, Josh Berkus wrote: On 10/24/2013 02:36 PM, Peter Eisentraut wrote: On 10/22/13, 2:27 PM, Josh Berkus wrote: pg_partman has several external (python) scripts which help the extension, located in /extras/ in its source. The problem currently is that if you install

[HACKERS] Detection of nested function calls

2013-10-25 Thread Hugo Mercier
Hi all, The Oslandia team is involved in PostGIS project for years, with a current focus on PostGIS 3D support. With PostGIS queries, nested functions calls that manipulate geometries are quite common, e.g.: SELECT ST_Union(ST_Intersection(a.geom, ST_Buffer(b.geom, 50))) PostGIS functions that

Re: [HACKERS] Detection of nested function calls

2013-10-25 Thread Pavel Stehule
Hello 2013/10/25 Hugo Mercier hugo.merc...@oslandia.com Hi all, The Oslandia team is involved in PostGIS project for years, with a current focus on PostGIS 3D support. With PostGIS queries, nested functions calls that manipulate geometries are quite common, e.g.: SELECT

[HACKERS] New committer

2013-10-25 Thread Tatsuo Ishii
Hi pgpool hackers, Muhammad Usama did great job in restructuring pgpool source code. And now he is working on incorporating PostgreSQL's exception and memory manager. I believe now is the time to add him to our one of committers and I just have done so. Please welcome Muhammad Usama as our new

Re: [HACKERS] Detection of nested function calls

2013-10-25 Thread Hugo Mercier
Le 25/10/2013 14:29, Pavel Stehule a écrit : Hello 2013/10/25 Hugo Mercier hugo.merc...@oslandia.com mailto:hugo.merc...@oslandia.com. I am quite new to postgresql hacking, so I'm sure there is room for improvements. But, what about this first proposal ? I am not sure, if

Re: [HACKERS] Detection of nested function calls

2013-10-25 Thread Pavel Stehule
2013/10/25 Hugo Mercier hugo.merc...@oslandia.com Le 25/10/2013 14:29, Pavel Stehule a écrit : Hello 2013/10/25 Hugo Mercier hugo.merc...@oslandia.com mailto:hugo.merc...@oslandia.com. I am quite new to postgresql hacking, so I'm sure there is room for improvements. But,

Re: [HACKERS] CLUSTER FREEZE

2013-10-25 Thread Robert Haas
On Fri, Oct 25, 2013 at 2:12 AM, Andres Freund and...@2ndquadrant.com wrote: On 2013-10-24 17:17:22 -0700, Josh Berkus wrote: On 10/24/2013 04:55 PM, Robert Haas wrote: On Thu, Oct 24, 2013 at 1:09 PM, Josh Berkus j...@agliodbs.com wrote: On 10/23/2013 09:58 PM, Amit Kapila wrote: I wonder

Re: [HACKERS] CLUSTER FREEZE

2013-10-25 Thread Andres Freund
On 2013-10-25 09:13:20 -0400, Robert Haas wrote: On Fri, Oct 25, 2013 at 2:12 AM, Andres Freund and...@2ndquadrant.com wrote: On 2013-10-24 17:17:22 -0700, Josh Berkus wrote: On 10/24/2013 04:55 PM, Robert Haas wrote: On Thu, Oct 24, 2013 at 1:09 PM, Josh Berkus j...@agliodbs.com wrote:

Re: [HACKERS] CLUSTER FREEZE

2013-10-25 Thread Robert Haas
On Thu, Oct 24, 2013 at 10:19 PM, Tom Lane t...@sss.pgh.pa.us wrote: Robert Haas robertmh...@gmail.com writes: I wonder if we should go so far as to make this the default behavior, instead of just making it an option. In that case you'd have to invent a NOFREEZE keyword, no? Ick. Only if we

Re: [HACKERS] UNION ALL on partitioned tables won't use indices.

2013-10-25 Thread Robert Haas
On Thu, Oct 24, 2013 at 6:39 AM, Kyotaro HORIGUCHI horiguchi.kyot...@lab.ntt.co.jp wrote: Hello, Sorry that it's been a while.. 1. Observed symptom As you know, UNION ALL accompanied with ORDER BY uses indexes if available. uniontest=# EXPLAIN SELECT * FROM c11 UNION ALL SELECT * FROM c12

Re: [HACKERS] proposal: lob conversion functionality

2013-10-25 Thread Pavel Stehule
fixed documentation Regards Pavel 2013/10/24 Heikki Linnakangas hlinnakan...@vmware.com On 22.10.2013 13:55, Pavel Stehule wrote: 2013/10/21 Noah Mischn...@leadboat.com If you're prepared to change the function names and add the subset-oriented functions, I would appreciate that.

Re: [HACKERS] Example query causing param_info to be set in plain rel path

2013-10-25 Thread Tom Lane
Ashutosh Bapat ashutosh.ba...@enterprisedb.com writes: In order to test various cases of LATERAL join in Postgres-XC, I am trying to find a query where RelOptInof-lateral_relids would get set for plain base relations. I think you need a lateral reference in a function or VALUES FROM-item. As

Re: [HACKERS] RULE regression test fragility?

2013-10-25 Thread Alvaro Herrera
Andres Freund wrote: On 2013-10-24 09:22:52 -0400, Tom Lane wrote: Andres Freund and...@2ndquadrant.com writes: FWIW, I've repeatedly now thought that it'd make maintaining/updating patches easier if we switched that query into unaligned tuple only (\a \t) mode. That would remove the

Re: [HACKERS] Detection of nested function calls

2013-10-25 Thread Tom Lane
Hugo Mercier hugo.merc...@oslandia.com writes: PostGIS functions that manipulate geometries have to unserialize their input geometries from the 'flat' varlena representation to their own, and serialize the processed geometries back when returning. But in such nested call queries, this

Re: [HACKERS] New committer

2013-10-25 Thread Tom Lane
Tatsuo Ishii is...@postgresql.org writes: Hi pgpool hackers, Muhammad Usama did great job in restructuring pgpool source code. And now he is working on incorporating PostgreSQL's exception and memory manager. I believe now is the time to add him to our one of committers and I just have done

Re: [HACKERS] Detection of nested function calls

2013-10-25 Thread Andres Freund
On 2013-10-25 10:18:27 -0400, Tom Lane wrote: I think the right way to attack it is to create some way for a Datum value to indicate, at runtime, whether it's a flat value or an in-memory representation. Any given function returning the type could choose to return either representation. The

Re: [HACKERS] logical changeset generation v6.4

2013-10-25 Thread Andres Freund
Hi, On 2013-10-22 16:07:16 +0200, Andres Freund wrote: On 2013-10-21 20:16:29 +0200, Andres Freund wrote: Current draft is: ALTER TABLE ... REPLICA IDENTITY NOTHING|FULL|DEFAULT ALTER TABLE ... REPLICA IDENTITY USING INDEX ...; which leaves the door open for ALTER TABLE ...

Re: [HACKERS] Detection of nested function calls

2013-10-25 Thread Tom Lane
Andres Freund and...@2ndquadrant.com writes: On 2013-10-25 10:18:27 -0400, Tom Lane wrote: I think the right way to attack it is to create some way for a Datum value to indicate, at runtime, whether it's a flat value or an in-memory representation. That sounds reasonable, and we have most of

Re: [HACKERS] Detection of nested function calls

2013-10-25 Thread Hugo Mercier
Le 25/10/2013 16:18, Tom Lane a écrit : Hugo Mercier hugo.merc...@oslandia.com writes: PostGIS functions that manipulate geometries have to unserialize their input geometries from the 'flat' varlena representation to their own, and serialize the processed geometries back when returning. But

Re: [HACKERS] Detection of nested function calls

2013-10-25 Thread Andres Freund
On 2013-10-25 11:01:28 -0400, Tom Lane wrote: Andres Freund and...@2ndquadrant.com writes: On 2013-10-25 10:18:27 -0400, Tom Lane wrote: I think the right way to attack it is to create some way for a Datum value to indicate, at runtime, whether it's a flat value or an in-memory

Re: [HACKERS] Detection of nested function calls

2013-10-25 Thread Tom Lane
Hugo Mercier hugo.merc...@oslandia.com writes: Le 25/10/2013 16:18, Tom Lane a écrit : However, this seems like a completely wrong way to go at it. In the first place, it wouldn't help for situations like a complex value stored in a plpgsql variable. In the second, I don't think that what

Re: [HACKERS] Detection of nested function calls

2013-10-25 Thread Hugo Mercier
Le 25/10/2013 17:20, Tom Lane a écrit : Hugo Mercier hugo.merc...@oslandia.com writes: Le 25/10/2013 16:18, Tom Lane a écrit : How do you tell the difference between foo(col1, bar(col2)) foo(bar(col1), col2) Still not sure to understand ... I assume foo() takes two

[HACKERS] LISTEN / NOTIFY enhancement request for Postgresql

2013-10-25 Thread Sev Zaslavsky
Hi pgsql-hackers, The LISTEN / NOTIFY feature (along with the pg_notify() function) is a unique feature that differentiates Postgresql from nearly all other relational database systems. With the exception of SQL Server, I know of no other RDBMSs that allow a client to be asynchronously

Re: [HACKERS] Detection of nested function calls

2013-10-25 Thread Tom Lane
Hugo Mercier hugo.merc...@oslandia.com writes: Le 25/10/2013 17:20, Tom Lane a écrit : How do you tell the difference between foo(col1, bar(col2)) foo(bar(col1), col2) Still not sure to understand ... I assume foo() takes two argument of type A. bar() can take one argument of A or

Re: [HACKERS] CLUSTER FREEZE

2013-10-25 Thread Josh Berkus
On 10/24/2013 07:19 PM, Tom Lane wrote: In any case, it's very far from obvious to me that CLUSTER ought to throw away information by default, which is what you're proposing. The problem here is that you're thinking of the 1/10 of 1% of our users who have a serious PostgreSQL failure and post

Re: [HACKERS] psql should show disabled internal triggers

2013-10-25 Thread fabriziomello
On 2013-09-18 15:15:55 +0200, Bernd Helmle wrote: On 2013-09-18 15:15:55 +0200, Bernd Helmle wrote: --On 18. September 2013 13:52:29 +0200 Andres Freund lt;andres@gt; wrote: If you do ALTER TABLE ... DISABLE TRIGGER ALL; and then individually re-enable the disabled triggers it's easy

Re: [HACKERS] Detection of nested function calls

2013-10-25 Thread Robert Haas
On Fri, Oct 25, 2013 at 10:18 AM, Tom Lane t...@sss.pgh.pa.us wrote: Hugo Mercier hugo.merc...@oslandia.com writes: PostGIS functions that manipulate geometries have to unserialize their input geometries from the 'flat' varlena representation to their own, and serialize the processed

[HACKERS] Additional information on log_line_prefix

2013-10-25 Thread Emanuel Calvo
Hi guys, I'm working on a quick convertion script for query reviews and I wonder if a feature request to add the following values will be possible: %D = duration %L = lock_time (lock only for this query) %E = estimated rows %R = total rows returned %B = total bytes sent %T = temporal

Re: [HACKERS] Additional information on log_line_prefix

2013-10-25 Thread David Johnston
emanuel_calvo wrote %E = estimated rows How would you expect this to work? This information seems mostly useless without the context of a full EXPLAIN output. %T = temporal tables used I am guessing you mean temporary, not temporal - the later also being known as time oriented David J.

Re: [HACKERS] Additional information on log_line_prefix

2013-10-25 Thread Andrew Dunstan
On 10/25/2013 01:50 PM, Emanuel Calvo wrote: Hi guys, I'm working on a quick convertion script for query reviews and I wonder if a feature request to add the following values will be possible: %D = duration %L = lock_time (lock only for this query) %E = estimated rows %R = total rows

Re: [HACKERS] Failure while inserting parent tuple to B-tree is not fun

2013-10-25 Thread Heikki Linnakangas
On 22.10.2013 19:55, Heikki Linnakangas wrote: I fixed the the same problem in GiST a few years back, by making it tolerate missing downlinks, and inserting them lazily. The B-tree code tolerates them already on scans, but gets confused on insertion, as seen above. I propose that we use the same

Re: [HACKERS] CLUSTER FREEZE

2013-10-25 Thread Thomas Munro
On 25 October 2013 01:17, Josh Berkus j...@agliodbs.com wrote: On 10/24/2013 04:55 PM, Robert Haas wrote: I wonder if we should go so far as to make this the default behavior, instead of just making it an option. +1 from me. Can you think of a reason you *wouldn't* want to freeze? Ok, I

Re: [HACKERS] logical changeset generation v6.4

2013-10-25 Thread Robert Haas
On Fri, Oct 25, 2013 at 10:58 AM, Andres Freund and...@2ndquadrant.com wrote: So, I am currently wondering about how to store the old tuple, based on this. Currently it is stored using the TupleDesc of the index the old tuple is based on. But if we want to allow transporting the entire tuple

[HACKERS] dsm use of uint64

2013-10-25 Thread Robert Haas
When I wrote the dynamic shared memory patch, I used uint64 everywhere to measure sizes - rather than, as we do for the main shared memory segment, Size. This now seems to me to have been the wrong decision; I'm finding that it's advantageous to make dynamic shared memory behave as much like the