Re: [HACKERS] Reduce pinning in btree indexes

2015-02-26 Thread Kyotaro HORIGUCHI
Hello, I measured the performance of this patch considering markpos/restorepos. The loss seems to be up to about 10% unfortunately. At Thu, 26 Feb 2015 17:49:23 + (UTC), Kevin Grittner kgri...@ymail.com wrote in 440831854.629116.1424972963735.javamail.ya...@mail.yahoo.com Heikki Linnakangas

Re: [HACKERS] Reduce pinning in btree indexes

2015-02-26 Thread Andrew Gierth
Kyotaro == Kyotaro HORIGUCHI horiguchi.kyot...@lab.ntt.co.jp writes: Kyotaro ammarkpos/amrestrpos are called in merge joins. By the steps Kyotaro shown below, I had 1M times of markpos and no restorepos for Kyotaro 1M result rows, and had 500k times of markpos and the same Kyotaro number of

Re: [HACKERS] Performance improvement for joins where outer side is unique

2015-02-26 Thread David Rowley
On 3 February 2015 at 22:23, Kyotaro HORIGUCHI horiguchi.kyot...@lab.ntt.co.jp wrote: Hi, I had a look on this patch. Although I haven't understood whole the stuff and all of the related things, I will comment as possible. Great, thank you for taking the time to look and review the patch.

Re: [HACKERS] Reduce pinning in btree indexes

2015-02-26 Thread Kyotaro HORIGUCHI
Hi, At Fri, 27 Feb 2015 05:56:18 +, Andrew Gierth and...@tao11.riddles.org.uk wrote in 874mq77vuu@news-spur.riddles.org.uk Kyotaro == Kyotaro HORIGUCHI horiguchi.kyot...@lab.ntt.co.jp writes: Kyotaro ammarkpos/amrestrpos are called in merge joins. By the steps Kyotaro shown

Re: [HACKERS] Merge compact/non compact commits, make aborts dynamically sized

2015-02-26 Thread Michael Paquier
On Wed, Feb 25, 2015 at 8:10 PM, Andres Freund and...@2ndquadrant.com wrote: On 2015-02-24 20:51:42 +0200, Heikki Linnakangas wrote: On 02/20/2015 05:21 PM, Andres Freund wrote: There's one bit that I'm not so sure about though: To avoid duplication I've added Parse(Commit/Abort)Record(), but

Re: [HACKERS] Reduce pinning in btree indexes

2015-02-26 Thread Andrew Gierth
Kyotaro == Kyotaro HORIGUCHI horiguchi.kyot...@lab.ntt.co.jp writes: You might want to try running the same test, but after patching ExecSupportsMarkRestore to return false for index scans. This will cause the planner to insert a Materialize node to handle the mark/restore. Kyotaro

Re: [HACKERS] New CF app deployment

2015-02-26 Thread Stefan Kaltenbrunner
On 02/26/2015 01:59 PM, Michael Paquier wrote: On Thu, Feb 26, 2015 at 9:15 PM, Asif Naeem anaeem...@gmail.com wrote: This thread seems relevant, Please guide me to how can access older CF pages The MSVC portion of this fix got completely lost in the void:

Re: [HACKERS] Renaming MemoryContextResetAndDeleteChildren to MemoryContextReset

2015-02-26 Thread Andrew Gierth
Tom == Tom Lane t...@sss.pgh.pa.us writes: Tom We've discussed doing $SUBJECT off and on for nearly ten years, Tom the oldest thread I could find about it being here: Tom http://www.postgresql.org/message-id/flat/1186435268.16321.37.ca...@dell.linuxdev.us.dell.com Tom It's come up again

Re: [HACKERS] Providing catalog view to pg_hba.conf file - Patch submission

2015-02-26 Thread Haribabu Kommi
On Sat, Feb 7, 2015 at 8:26 PM, Pavel Stehule pavel.steh...@gmail.com wrote: Hi I am sending a review of this patch. Thanks for the review. sorry for the delay. 4. Regress tests test rules... FAILED -- missing info about new view Thanks. Corrected. My objections:

Re: [HACKERS] Idea: GSoC - Query Rewrite with Materialized Views

2015-02-26 Thread Eric Grinstein
Thank you for your answers. I would be very interested in tracking the staleness of the MV. You see, I work in a research group in database tuning, and we have implemented some solutions to take advantage of MV's and speed up queries. The query rewrite feature would be extremely desirable for us.

Re: [HACKERS] logical column ordering

2015-02-26 Thread Jim Nasby
On 2/26/15 4:34 PM, Andres Freund wrote: On 2015-02-26 16:16:54 -0600, Jim Nasby wrote: On 2/26/15 4:01 PM, Alvaro Herrera wrote: The reason for doing it this way is that changing the underlying architecture is really hard, without having to bear an endless hackers bike shed discussion about

Re: [HACKERS] MemoryContext reset/delete callbacks

2015-02-26 Thread Andres Freund
On 2015-02-27 01:54:27 +0100, Andres Freund wrote: On 2015-02-26 19:28:50 -0500, Tom Lane wrote: /* *** typedef struct MemoryContextData *** 59,72 MemoryContext firstchild; /* head of linked list of children */ MemoryContext nextchild;/* next

Re: [HACKERS] New CF app deployment

2015-02-26 Thread Michael Paquier
On Thu, Feb 26, 2015 at 9:15 PM, Asif Naeem anaeem...@gmail.com wrote: This thread seems relevant, Please guide me to how can access older CF pages The MSVC portion of this fix got completely lost in the void: https://commitfest.postgresql.org/action/patch_view?id=1330 Above link result in

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

2015-02-26 Thread David Steele
On 2/25/15 11:40 PM, Alvaro Herrera wrote: Fujii Masao wrote: On Tue, Feb 24, 2015 at 1:29 AM, David Steele da...@pgmasters.net wrote: 1) Follow Oracle's as session option and only log each statement type against an object the first time it happens in a session. This would greatly reduce

Re: [HACKERS] mogrify and indent features for jsonb

2015-02-26 Thread Thom Brown
On 26 February 2015 at 15:09, Dmitry Dolgov 9erthali...@gmail.com wrote: Hi, Thom. Would this support deleting type and the value 'dd' With this patch you can delete them one by one: select '{a: 1, b: 2, c: {type: json, stuff: test}, d: [aa,bb,cc,dd]}'::jsonb - '{c, type}'::text[] -

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

2015-02-26 Thread David Steele
On 2/25/15 10:42 PM, Fujii Masao wrote: On Tue, Feb 24, 2015 at 1:29 AM, David Steele da...@pgmasters.net wrote: On 2/18/15 10:25 AM, David Steele wrote: On 2/18/15 6:11 AM, Fujii Masao wrote: The pg_audit doesn't log BIND parameter values when prepared statement is used. Seems this is an

Re: [HACKERS] [RFC: bug fix?] Connection attempt block forever when the synchronous standby is not running

2015-02-26 Thread Alvaro Herrera
FWIW a fix for this has been posted to all active branches: Author: Andres Freund and...@anarazel.de Branch: master [fd6a3f3ad] 2015-02-26 12:50:07 +0100 Branch: REL9_4_STABLE [d72115112] 2015-02-26 12:50:07 +0100 Branch: REL9_3_STABLE [abce8dc7d] 2015-02-26 12:50:07 +0100 Branch: REL9_2_STABLE

Re: [HACKERS] Precedence of standard comparison operators

2015-02-26 Thread Tom Lane
Simon Riggs si...@2ndquadrant.com writes: On 20 February 2015 at 20:44, Tom Lane t...@sss.pgh.pa.us wrote: Well, assuming that we're satisfied with just having a way to warn when the behavior changed (and not, in particular, a switch that can select old or new behavior) I'm in favour of your

Re: [HACKERS] mogrify and indent features for jsonb

2015-02-26 Thread Dmitry Dolgov
Hi, Thom. Would this support deleting type and the value 'dd' With this patch you can delete them one by one: select '{a: 1, b: 2, c: {type: json, stuff: test}, d: [aa,bb,cc,dd]}'::jsonb - '{c, type}'::text[] - '{d, -1}'::text[]; ?column?

Re: [HACKERS] Primary not sending to synchronous standby

2015-02-26 Thread Thom Brown
On 26 February 2015 at 13:08, Andres Freund and...@2ndquadrant.com wrote: On 2015-02-23 17:09:24 +, Thom Brown wrote: On 23 February 2015 at 16:53, Andres Freund and...@2ndquadrant.com wrote: Comments? This is obviously just a POC, but I think something like this does make a great

Re: [HACKERS] Primary not sending to synchronous standby

2015-02-26 Thread Andres Freund
On 2015-02-23 17:09:24 +, Thom Brown wrote: On 23 February 2015 at 16:53, Andres Freund and...@2ndquadrant.com wrote: Comments? This is obviously just a POC, but I think something like this does make a great deal of sense. Thom, does that help? Yeah, this appears to eliminate the

Re: [HACKERS] Partitioning WIP patch

2015-02-26 Thread Jim Nasby
On 2/26/15 3:22 AM, Andres Freund wrote: On 2015-02-26 02:20:21 -0600, Jim Nasby wrote: The reason I'd like to do this with partitioning vs plain inheritance is presumably as we build out partitioning we'll get very useful things like the ability to have FKs to properly partitioned tables.

Re: [HACKERS] Partitioning WIP patch

2015-02-26 Thread Jim Nasby
On 2/26/15 3:09 AM, Amit Langote wrote: Yes. If it helps, the exact use-case I have in mind is using list-based partitioning + additional columns in some/all children (different between children). For example, if you need to track different types of customer payment methods, you'd have a payment

Re: [HACKERS] plpgsql versus domains

2015-02-26 Thread Pavel Stehule
Hi 2015-02-26 18:31 GMT+01:00 Tom Lane t...@sss.pgh.pa.us: At the behest of Salesforce, I've been looking into improving plpgsql's handling of variables of domain types, which is currently pretty awful. It's really slow, because any assignment to a domain variable goes through the slow

Re: [HACKERS] mogrify and indent features for jsonb

2015-02-26 Thread Josh Berkus
On 02/26/2015 07:25 AM, Thom Brown wrote: Yeah, I think that may be problematic. I agree with Josh that there's probably no sane mix of operators for this, as I would expect your example to replace d: [aa,bb,cc,dd] with d: [ee] rather than append to it. Hmm... unless we used a + operator,

Re: [HACKERS] Partitioning WIP patch

2015-02-26 Thread Josh Berkus
On 02/25/2015 07:15 PM, Amit Langote wrote: On 26-02-2015 AM 05:15, Josh Berkus wrote: On 02/24/2015 12:13 AM, Amit Langote wrote: Here is an experimental patch that attempts to implement this. This looks awesome. Thanks! I would love to have it for 9.5, but I guess the patch isn't

Re: [HACKERS] Reduce pinning in btree indexes

2015-02-26 Thread Kevin Grittner
Heikki Linnakangas hlinnakan...@vmware.com wrote: On 02/15/2015 02:19 AM, Kevin Grittner wrote: Interestingly, the btree README points out that using the old TID with a new tuple poses no hazard for a scan using an MVCC snapshot, because the new tuple would not be visible to a snapshot created

Re: [HACKERS] Partitioning WIP patch

2015-02-26 Thread Andres Freund
On 2015-02-26 12:15:17 +0900, Amit Langote wrote: On 26-02-2015 AM 05:15, Josh Berkus wrote: On 02/24/2015 12:13 AM, Amit Langote wrote: Here is an experimental patch that attempts to implement this. I would love to have it for 9.5, but I guess the patch isn't nearly baked enough for

Re: [HACKERS] How to create virtual indexes on postgres

2015-02-26 Thread Jim Nasby
On 2/26/15 6:17 AM, Sreerama Manoj wrote: But, it runs with Postgres 9.1 version...But I use 9.4..I think I cant use that. Or as an alternative Is there any provision in postgres to know use(Increase in Performance) of an index before creating that index. No. It might not be too hard to port

Re: [HACKERS] plpgsql versus domains

2015-02-26 Thread Andres Freund
On 2015-02-26 13:53:18 -0500, Tom Lane wrote: Andres Freund and...@2ndquadrant.com writes: Hm. A bit sad to open code that in plpgsql instead of making it available more generally. The actual checking wouldn't be open-coded, it would come from domain_check() (or possibly a modified

Re: [HACKERS] plpgsql versus domains

2015-02-26 Thread Andres Freund
Hi, On 2015-02-26 12:31:46 -0500, Tom Lane wrote: It's really slow, because any assignment to a domain variable goes through the slow double-I/O-conversion path in exec_cast_value, even if no actual work is needed. Hm, that's surely not nice for some types. Doing syscache lookups every time

Re: [HACKERS] plpgsql versus domains

2015-02-26 Thread Pavel Stehule
2015-02-26 19:53 GMT+01:00 Tom Lane t...@sss.pgh.pa.us: Andres Freund and...@2ndquadrant.com writes: On 2015-02-26 12:31:46 -0500, Tom Lane wrote: 2. In plpgsql, explicitly model a domain type as being its base type plus some constraints --- that is, stop depending on domain_in() to

Re: [HACKERS] logical column ordering

2015-02-26 Thread Jim Nasby
On 2/23/15 5:09 PM, Tomas Vondra wrote: Over the time I've heard various use cases for this patch, but in most cases it was quite speculative. If you have an idea where this might be useful, can you explain it here, or maybe point me to a place where it's described? For better or worse, table

Re: [HACKERS] plpgsql versus domains

2015-02-26 Thread Tom Lane
Andres Freund and...@2ndquadrant.com writes: On 2015-02-26 12:31:46 -0500, Tom Lane wrote: 2. In plpgsql, explicitly model a domain type as being its base type plus some constraints --- that is, stop depending on domain_in() to enforce the constraints, and do it ourselves. This would mean

Re: [HACKERS] Composite index and min()

2015-02-26 Thread Jim Nasby
On 2/26/15 1:34 AM, James Sewell wrote: I have the following table: I'm moving this discussion to -general. -- Jim Nasby, Data Architect, Blue Treble Consulting Data in Trouble? Get it in Treble! http://BlueTreble.com -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To

Re: [HACKERS] [REVIEW] Re: Compression of full-page-writes

2015-02-26 Thread Fujii Masao
On Tue, Feb 24, 2015 at 6:46 PM, Syed, Rahila rahila.s...@nttdata.com wrote: Hello , I've not read this logic yet, but ISTM there is a bug in that new WAL format because I got the following error and the startup process could not replay any WAL records when I set up replication and enabled

Re: [HACKERS] Partitioning WIP patch

2015-02-26 Thread Amit Langote
On 26-02-2015 PM 05:20, Jim Nasby wrote: On 2/25/15 7:57 PM, Amit Langote wrote: AIUI, as far as we stay with a design where partitions (children) are individually planned, that might be OK. But, I guess things will get more complicated. I think the role of a parent in planning would remain

[HACKERS] How to create virtual indexes on postgres

2015-02-26 Thread Sreerama Manoj
Hi, I use Postgres 9.4 database.Now,I am optimizing the queries by using the results of explain and explain analyze,Sometimes I am creating Indexes to optimize them. But, I was not successful sometimes as even I create Index to optimize them, the planner is not using them . So my question

Re: [HACKERS] Transactions involving multiple postgres foreign servers

2015-02-26 Thread Ashutosh Bapat
Added to 2015-06 commitfest to attract some reviews and comments. On Tue, Feb 17, 2015 at 2:56 PM, Ashutosh Bapat ashutosh.ba...@enterprisedb.com wrote: Hi All, Here are the steps and infrastructure for achieving atomic commits across multiple foreign servers. I have tried to address most

Re: [HACKERS] Partitioning WIP patch

2015-02-26 Thread Andres Freund
On 2015-02-26 02:20:21 -0600, Jim Nasby wrote: The reason I'd like to do this with partitioning vs plain inheritance is presumably as we build out partitioning we'll get very useful things like the ability to have FKs to properly partitioned tables. Insert tuple routing could also be useful.

Re: [HACKERS] INSERT ... ON CONFLICT UPDATE and RLS

2015-02-26 Thread Dean Rasheed
On 26 February 2015 at 05:41, Stephen Frost sfr...@snowman.net wrote: Dean, * Dean Rasheed (dean.a.rash...@gmail.com) wrote: Here's an updated patch with a new test for this bug. I've been developing the fixes for these RLS issues as one big patch, but I suppose it would be easy to split up,

Re: [HACKERS] INSERT ... ON CONFLICT UPDATE and RLS

2015-02-26 Thread Dean Rasheed
On 26 February 2015 at 05:43, Stephen Frost sfr...@snowman.net wrote: Dean, * Dean Rasheed (dean.a.rash...@gmail.com) wrote: Attached is a patch to make RLS checks run before attempting to insert/update any data rather than afterwards. Excellent, this I really like and it's a pretty

Re: [HACKERS] Refactoring GUC unit conversions

2015-02-26 Thread Fujii Masao
On Fri, Feb 13, 2015 at 10:26 PM, Heikki Linnakangas hlinnakan...@vmware.com wrote: In the redesign checkpoint_segments patch, Robert suggested keeping the settings' base unit as number of segments, but allow conversions from MB, GB etc. I started looking into that and found that adding a new

Re: [HACKERS] Review of GetUserId() Usage

2015-02-26 Thread Jeevan Chalke
The following review has been posted through the commitfest application: make installcheck-world: tested, passed Implements feature: tested, passed Spec compliant: tested, passed Documentation:tested, passed I have reviewed the patch. Patch is excellent in shape and

Re: [HACKERS] How about to have relnamespace and relrole?

2015-02-26 Thread Kyotaro HORIGUCHI
Hello, thank you for reviewing. The attatched are the third version of this patch. 0001-Add-regrole_v3.patch 0002-Add-regnamespace_v3.patch - Rearranged into regrole patch and regnamespace patch as seen above, each of them consists of changes for code, docs, regtests. regnamespace patch

Re: [HACKERS] How about to have relnamespace and relrole?

2015-02-26 Thread Kyotaro HORIGUCHI
Sorry, I fixed a silly typo in documentation in the previous version. - of theses types has a significance... + of these types has a significance... # My fingers frequently slip as above.. I incremented the version of this revised patch to get rid of confusion. === Hello, thank

Re: [HACKERS] Bug in pg_dump

2015-02-26 Thread Michael Paquier
On Wed, Feb 25, 2015 at 7:46 AM, Gilles Darold gilles.dar...@dalibo.com wrote: This is a far better patch and the test to export/import of the postgis_topology extension works great for me. Thanks for the work. Attached is a patch that uses an even better approach by querying only once all

[HACKERS] BDR Multiple database

2015-02-26 Thread Jirayut Nimsaeng
Hi all, I'm using PostgreSQL BDR 9.4.1 to test BDR capability right now $ psql --version psql (PostgreSQL) 9.4.1 We want to use BDR with multiple database but now all the document didn't show any example how to config BDR with multiple database. We've tried with many combination as below but

Re: [HACKERS] Partitioning WIP patch

2015-02-26 Thread Jim Nasby
On 2/25/15 7:57 PM, Amit Langote wrote: On 26-02-2015 AM 10:31, Jim Nasby wrote: On 2/25/15 7:24 PM, Amit Langote wrote: Does ALTER TABLE parent_monthly_x_201401 ADD COLUMN foo still operate the same as today? I'd like to see us continue to support that, but perhaps it would be wise to not

Re: [HACKERS] How to create virtual indexes on postgres

2015-02-26 Thread Michael Paquier
On Thu, Feb 26, 2015 at 6:20 PM, Sreerama Manoj manoj.sreerama...@gmail.com wrote: So my question was can we know whether the planner will use the index before actually creating a real Index..or can we create virtual or Hypothetical Index those can only be known to the planner and not the user

Re: [HACKERS] New CF app deployment

2015-02-26 Thread Asif Naeem
Hi, This thread seems relevant, Please guide me to how can access older CF pages e.g. Thread http://www.postgresql.org/message-id/flat/51f19059.7050...@pgexperts.com#51f19059.7050...@pgexperts.com mentions following link i.e. The MSVC portion of this fix got completely lost in the void:

Re: [HACKERS] How to create virtual indexes on postgres

2015-02-26 Thread Sreerama Manoj
But, it runs with Postgres 9.1 version...But I use 9.4..I think I cant use that. Or as an alternative Is there any provision in postgres to know use(Increase in Performance) of an index before creating that index. On Thu, Feb 26, 2015 at 5:37 PM, Michael Paquier michael.paqu...@gmail.com wrote:

Re: [HACKERS] Renaming MemoryContextResetAndDeleteChildren to MemoryContextReset

2015-02-26 Thread Alvaro Herrera
Tom Lane wrote: Thoughts? Any objections to pushing this? Is there any reason at all to keep MemoryContextResetButPreserveChildren()? Since your patch doesn't add any callers, it seems pretty likely that there's none anywhere. -- Álvaro Herrerahttp://www.2ndQuadrant.com/

[HACKERS] GSoC idea - Simulated annealing to search for query plans

2015-02-26 Thread Grzegorz Parka
Dear Hackers, I'm Grzegorz Parka, BSc Engineer of Technical Physics and student of Computer Science at WUT, Poland. Last year I've been a bit into evolutionary algorithms and during my research I found out about GEQO in Postgres. I also found out that there are plans to try a different attempt to

Re: [HACKERS] Precedence of standard comparison operators

2015-02-26 Thread Tom Lane
Andres Freund and...@anarazel.de writes: On February 26, 2015 10:29:18 PM CET, Peter Eisentraut pete...@gmx.net wrote: My suggestion was to treat this like the standard_conforming_string change. That is, warn for many years before changing. I don't think scs is a good example to follow.

Re: [HACKERS] logical column ordering

2015-02-26 Thread Tom Lane
Jim Nasby jim.na...@bluetreble.com writes: On 2/26/15 4:01 PM, Alvaro Herrera wrote: Josh Berkus wrote: Oh, I didn't realize there weren't commands to change the LCO. Without at least SQL syntax for LCO, I don't see why we'd take it; this sounds more like a WIP patch. The reason for doing

Re: [HACKERS] Precedence of standard comparison operators

2015-02-26 Thread Jim Nasby
On 2/26/15 4:09 PM, Tom Lane wrote: Andres Freund and...@anarazel.de writes: On February 26, 2015 10:29:18 PM CET, Peter Eisentraut pete...@gmx.net wrote: My suggestion was to treat this like the standard_conforming_string change. That is, warn for many years before changing. I don't think

Re: [HACKERS] Renaming MemoryContextResetAndDeleteChildren to MemoryContextReset

2015-02-26 Thread Tom Lane
Andres Freund and...@2ndquadrant.com writes: On 2015-02-26 17:01:53 -0500, Tom Lane wrote: We've discussed doing $SUBJECT off and on for nearly ten years, the oldest thread I could find about it being here:

Re: [HACKERS] [REVIEW] Re: Compression of full-page-writes

2015-02-26 Thread Michael Paquier
On Fri, Feb 27, 2015 at 6:54 AM, Rahila Syed rahilasye...@gmail.com wrote: Hello, Even this patch doesn't work fine. The standby emit the following error messages. Yes this bug remains unsolved. I am still working on resolving this. Following chunk IDs have been added in the attached patch

Re: [HACKERS] Precedence of standard comparison operators

2015-02-26 Thread Andres Freund
On 2015-02-26 20:13:34 +, Simon Riggs wrote: On 26 February 2015 at 15:56, Tom Lane t...@sss.pgh.pa.us wrote: I think the way to do this is to have a pluggable parser, so users can choose 1) old parser, 2) new, better parser, 3) any other parser they fancy that they maintain to ensure

Re: [HACKERS] logical column ordering

2015-02-26 Thread Jim Nasby
On 2/26/15 4:01 PM, Alvaro Herrera wrote: Josh Berkus wrote: On 02/26/2015 01:54 PM, Alvaro Herrera wrote: This patch decouples these three things so that they can changed freely -- but provides no user interface to do so. I think that trying to only decouple the thing we currently have in

Re: [HACKERS] Renaming MemoryContextResetAndDeleteChildren to MemoryContextReset

2015-02-26 Thread Andres Freund
Hi, On 2015-02-26 17:01:53 -0500, Tom Lane wrote: We've discussed doing $SUBJECT off and on for nearly ten years, the oldest thread I could find about it being here: http://www.postgresql.org/message-id/flat/1186435268.16321.37.ca...@dell.linuxdev.us.dell.com It's come up again every time we

Re: [HACKERS] Renaming MemoryContextResetAndDeleteChildren to MemoryContextReset

2015-02-26 Thread Tom Lane
Andres Freund and...@2ndquadrant.com writes: I'd really not even be surprised if a committer backpatches a MemoryContextReset() addition, not realizing it behaves differently in the back branches. As far as that goes, the only consequence would be a possible memory leak in the back branches;

Re: [HACKERS] Renaming MemoryContextResetAndDeleteChildren to MemoryContextReset

2015-02-26 Thread Tom Lane
Andres Freund and...@2ndquadrant.com writes: On 2015-02-26 17:45:26 -0500, Tom Lane wrote: With all due respect, that's utterly wrong. I have looked at every single MemoryContextReset call in the codebase, and as far as I can see the *only* one that is in an error path is elog.c:336, which

Re: [HACKERS] Partitioning WIP patch

2015-02-26 Thread Michael Paquier
On Fri, Feb 27, 2015 at 3:24 AM, Andres Freund and...@2ndquadrant.com wrote: On 2015-02-26 12:15:17 +0900, Amit Langote wrote: On 26-02-2015 AM 05:15, Josh Berkus wrote: On 02/24/2015 12:13 AM, Amit Langote wrote: Here is an experimental patch that attempts to implement this. I would love

[HACKERS] Renaming MemoryContextResetAndDeleteChildren to MemoryContextReset

2015-02-26 Thread Tom Lane
We've discussed doing $SUBJECT off and on for nearly ten years, the oldest thread I could find about it being here: http://www.postgresql.org/message-id/flat/1186435268.16321.37.ca...@dell.linuxdev.us.dell.com It's come up again every time we found another leak of dead child contexts, which

Re: [HACKERS] json_populate_record issue - TupleDesc reference leak

2015-02-26 Thread Tom Lane
Andrew Dunstan and...@dunslane.net writes: This doesn't look quite right. Shouldn't we unconditionally release the Tupledesc before the returns at lines 2118 and 2127, just as we do at the bottom of the function at line 2285? I think Pavel's patch is probably OK as-is, because the tupdesc

Re: [HACKERS] logical column ordering

2015-02-26 Thread Andres Freund
On 2015-02-26 16:16:54 -0600, Jim Nasby wrote: On 2/26/15 4:01 PM, Alvaro Herrera wrote: The reason for doing it this way is that changing the underlying architecture is really hard, without having to bear an endless hackers bike shed discussion about the best userland syntax to use. It seems

Re: [HACKERS] Renaming MemoryContextResetAndDeleteChildren to MemoryContextReset

2015-02-26 Thread Andres Freund
On 2015-02-26 18:05:46 -0500, Tom Lane wrote: Andres Freund and...@2ndquadrant.com writes: On 2015-02-26 17:45:26 -0500, Tom Lane wrote: If the changes breaks some code it's likely actually a good thing: Because, as you say, using MemoryContextReset() will likely be the wrong thing, and

[HACKERS] MemoryContext reset/delete callbacks

2015-02-26 Thread Tom Lane
We discussed this idea a couple weeks ago. The core of it is that when a memory context is being deleted, you might want something extra to happen beyond just pfree'ing everything in the context. I'm thinking in particular that this might provide a nice solution to the problem we discussed

Re: [HACKERS] Partitioning WIP patch

2015-02-26 Thread Amit Langote
On 27-02-2015 AM 03:18, Josh Berkus wrote: On 02/25/2015 07:15 PM, Amit Langote wrote: I'm not quite sure what would qualify as baked enough for 9.5 though we can surely try to reach some consensus on various implementation aspects and perhaps even get it ready in time for 9.5. Well, we

Re: [HACKERS] logical column ordering

2015-02-26 Thread Alvaro Herrera
Josh Berkus wrote: On 02/26/2015 01:54 PM, Alvaro Herrera wrote: This patch decouples these three things so that they can changed freely -- but provides no user interface to do so. I think that trying to only decouple the thing we currently have in two pieces, and then have a subsequent

Re: [HACKERS] Renaming MemoryContextResetAndDeleteChildren to MemoryContextReset

2015-02-26 Thread Tom Lane
Alvaro Herrera alvhe...@2ndquadrant.com writes: Tom Lane wrote: Thoughts? Any objections to pushing this? Is there any reason at all to keep MemoryContextResetButPreserveChildren()? Since your patch doesn't add any callers, it seems pretty likely that there's none anywhere. The only

Re: [HACKERS] Renaming MemoryContextResetAndDeleteChildren to MemoryContextReset

2015-02-26 Thread Andres Freund
On 2015-02-26 23:31:16 +0100, Andres Freund wrote: Without a compiler erroring out people won't notice that suddenly MemoryContextReset deletes much more; leading to possibly hard to find errors. Context resets frequently are in error paths, and those won't necessarily be hit when running with

Re: [HACKERS] logical column ordering

2015-02-26 Thread Kevin Grittner
Tomas Vondra tomas.von...@2ndquadrant.com wrote: Over the time I've heard various use cases for this patch, but in most cases it was quite speculative. If you have an idea where this might be useful, can you explain it here, or maybe point me to a place where it's described? One use case is

Re: [HACKERS] Renaming MemoryContextResetAndDeleteChildren to MemoryContextReset

2015-02-26 Thread Andres Freund
On 2015-02-26 17:45:26 -0500, Tom Lane wrote: Andres Freund and...@2ndquadrant.com writes: Or are you arguing for an alternative proposal in which we remove MemoryContextReset (or at least rename it to something new) and thereby intentionally break all code that uses MemoryContextReset? Yes,

Re: [HACKERS] Renaming MemoryContextResetAndDeleteChildren to MemoryContextReset

2015-02-26 Thread Tom Lane
Andres Freund and...@2ndquadrant.com writes: ... Without a compiler erroring out people won't notice that suddenly MemoryContextReset deletes much more; leading to possibly hard to find errors. BTW, so far as *data* is concerned, the existing call deletes all data in the child contexts

Re: [HACKERS] Partitioning WIP patch

2015-02-26 Thread Amit Langote
On 27-02-2015 AM 03:24, Andres Freund wrote: On 2015-02-26 12:15:17 +0900, Amit Langote wrote: On 26-02-2015 AM 05:15, Josh Berkus wrote: I would love to have it for 9.5, but I guess the patch isn't nearly baked enough for that? I'm not quite sure what would qualify as baked enough for 9.5

Re: [HACKERS] MemoryContext reset/delete callbacks

2015-02-26 Thread Andres Freund
Hi, On 2015-02-26 19:28:50 -0500, Tom Lane wrote: We discussed this idea a couple weeks ago. Hm, didn't follow that discussion. The core of it is that when a memory context is being deleted, you might want something extra to happen beyond just pfree'ing everything in the context. I've

Re: [HACKERS] logical column ordering

2015-02-26 Thread David Steele
On 2/26/15 1:49 PM, Jim Nasby wrote: On 2/23/15 5:09 PM, Tomas Vondra wrote: Over the time I've heard various use cases for this patch, but in most cases it was quite speculative. If you have an idea where this might be useful, can you explain it here, or maybe point me to a place where it's

Re: [HACKERS] GSoC idea - Simulated annealing to search for query plans

2015-02-26 Thread Josh Berkus
On 02/26/2015 01:59 PM, Grzegorz Parka wrote: Dear Hackers, I'm Grzegorz Parka, BSc Engineer of Technical Physics and student of Computer Science at WUT, Poland. Last year I've been a bit into evolutionary algorithms and during my research I found out about GEQO in Postgres. I also found

Re: [HACKERS] GSoC idea - Simulated annealing to search for query plans

2015-02-26 Thread Tom Lane
Josh Berkus j...@agliodbs.com writes: On 02/26/2015 01:59 PM, Grzegorz Parka wrote: I'm interested in one of old TODO items related to the optimizer - 'Consider compressed annealing to search for query plans'. You might look at the earlier attempt to make the GEQO replacement pluggable.

Re: [HACKERS] contrib/fuzzystrmatch/dmetaphone.c license

2015-02-26 Thread Michael Paquier
On Thu, Feb 26, 2015 at 8:56 AM, Stephen Frost sfr...@snowman.net wrote: * Jim Nasby (jim.na...@bluetreble.com) wrote: On 2/25/15 4:10 PM, Andrew Dunstan wrote: On 02/25/2015 11:59 AM, Joe Conway wrote: It's largely because of such uncertainties that I have been advised in the past (by

Re: [HACKERS] GSoC idea - Simulated annealing to search for query plans

2015-02-26 Thread Fabrízio de Royes Mello
On Thu, Feb 26, 2015 at 10:27 PM, Andres Freund and...@2ndquadrant.com wrote: On 2015-02-26 20:23:33 -0500, Tom Lane wrote: Josh Berkus j...@agliodbs.com writes: On 02/26/2015 01:59 PM, Grzegorz Parka wrote: I'm interested in one of old TODO items related to the optimizer - 'Consider

Re: [HACKERS] Partitioning WIP patch

2015-02-26 Thread Amit Langote
On 27-02-2015 AM 03:01, Jim Nasby wrote: On 2/26/15 3:09 AM, Amit Langote wrote: Unless I'm missing something again, isn't allowing partitions to have heterogeneous rowtypes a problem in the long run? I'm afraid I'm confused as to your stand regarding inheritance vs. new partitioning. To be

Re: [HACKERS] Odd behavior of updatable security barrier views on foreign tables

2015-02-26 Thread Etsuro Fujita
On 2015/02/26 11:38, Stephen Frost wrote: I've pushed an update for this to master and 9.4 and improved the comments and the commit message as discussed. Would be great if you could test and let me know if you run into any issues! OK, thanks! Best regards, Etsuro Fujita -- Sent via

[HACKERS] Add CINE for ALTER TABLE ... ADD COLUMN

2015-02-26 Thread Fabrízio de Royes Mello
Hi all, This simple patch add CINE for ALTER TABLE ... ADD COLUMN. So now we can: ALTER TABLE foo ADD COLUMN IF NOT EXISTS c1 integer; and/or ... ALTER TABLE foo ADD COLUMN IF NOT EXISTS c1 integer, ADD COLUMN c2 integer; Regards, -- Fabrízio de Royes Mello Consultoria/Coaching

Re: [HACKERS] GSoC idea - Simulated annealing to search for query plans

2015-02-26 Thread Josh Berkus
On 02/26/2015 05:50 PM, Fabrízio de Royes Mello wrote: On Thu, Feb 26, 2015 at 10:27 PM, Andres Freund and...@2ndquadrant.com mailto:and...@2ndquadrant.com wrote: On 2015-02-26 20:23:33 -0500, Tom Lane wrote: Josh Berkus j...@agliodbs.com mailto:j...@agliodbs.com writes: On 02/26/2015

Re: [HACKERS] [REVIEW] Re: Compression of full-page-writes

2015-02-26 Thread Michael Paquier
On Fri, Feb 27, 2015 at 8:01 AM, Michael Paquier michael.paqu...@gmail.com wrote: On Fri, Feb 27, 2015 at 6:54 AM, Rahila Syed rahilasye...@gmail.com wrote: Even this patch doesn't work fine. The standby emit the following error messages. Yes this bug remains unsolved. I am still working on

Re: [HACKERS] GSoC idea - Simulated annealing to search for query plans

2015-02-26 Thread Andres Freund
On 2015-02-26 20:23:33 -0500, Tom Lane wrote: Josh Berkus j...@agliodbs.com writes: On 02/26/2015 01:59 PM, Grzegorz Parka wrote: I'm interested in one of old TODO items related to the optimizer - 'Consider compressed annealing to search for query plans'. You might look at the earlier

Re: [HACKERS] logical column ordering

2015-02-26 Thread Gavin Flower
On 27/02/15 14:08, David Steele wrote: [...] I agree with Jim's comments. I've generally followed column ordering that goes something like: 1) primary key 2) foreign keys 3) flags 4) other programmatic data fields (type, order, etc.) 5) non-programmatic data fields (name, description, etc.)

Re: [HACKERS] MemoryContext reset/delete callbacks

2015-02-26 Thread Tom Lane
Andres Freund and...@2ndquadrant.com writes: It's a bit sad to push AllocSetContextData onto four cachelines from the current three... That stuff is hot. But I don't really see a way around it right now. And it seems like it'd give us more amunition to improve things than the small loss of