Re: [HACKERS] Immediate standby promotion

2014-09-01 Thread Amit Kapila
On Thu, Aug 14, 2014 at 1:49 PM, Fujii Masao masao.fu...@gmail.com wrote: Hi, I'd like to propose to add new option --immediate to pg_ctl promote. When this option is set, recovery ignores any WAL data which have not been replayed yet and exits immediately. Patch attached. This promotion

[HACKERS] Better support of exported snapshots with pg_dump

2014-09-01 Thread Michael Paquier
Hi all, Currently pg_dump does not allow a user to specify an exported snapshot name that he would like to use for a dump using SET TRANSACTION SNAPSHOT (now pg_export_snapshot is only used for parallel pg_dump within it). I imagine that this would be handy to take a consistent dump of a given

Re: [HACKERS] What in the world is happening with castoroides and protosciurus?

2014-09-01 Thread Dave Page
On Sat, Aug 30, 2014 at 11:32 PM, Noah Misch n...@leadboat.com wrote: On Tue, Aug 26, 2014 at 10:17:05AM +0100, Dave Page wrote: On Tue, Aug 26, 2014 at 1:46 AM, Tom Lane t...@sss.pgh.pa.us wrote: For the last month or so, these two buildfarm animals (which I believe are the same physical

Re: [HACKERS] Better support of exported snapshots with pg_dump

2014-09-01 Thread Bernd Helmle
--On 1. September 2014 17:00:32 +0900 Michael Paquier michael.paqu...@gmail.com wrote: Currently pg_dump does not allow a user to specify an exported snapshot name that he would like to use for a dump using SET TRANSACTION SNAPSHOT (now pg_export_snapshot is only used for parallel pg_dump

Re: [HACKERS] implement subject alternative names support for SSL connections

2014-09-01 Thread Alexey Klyukin
On Fri, Aug 29, 2014 at 11:22 AM, Heikki Linnakangas hlinnakan...@vmware.com wrote: On 08/28/2014 07:28 PM, Alexey Klyukin wrote: On Mon, Aug 25, 2014 at 12:02 PM, Heikki Linnakangas hlinnakan...@vmware.com wrote: On 08/24/2014 03:11 PM, Alexey Klyukin wrote: On Wed, Aug 20, 2014 at

[HACKERS] PL/pgSQL 2

2014-09-01 Thread Joel Jacobson
Hi, For those of you who use PL/pgSQL every day, I'm quite certain you all feel there are a number of things you would like to change in the language, but realize it cannot be achieved without possibly breaking compatibility, at least in theory. Even though you own code would survive the change,

Re: [HACKERS] PL/PgSQL: EXIT USING ROLLBACK

2014-09-01 Thread Joel Jacobson
On Sat, Jul 26, 2014 at 8:39 PM, Tom Lane t...@sss.pgh.pa.us wrote: Basically my point is that this just seems like inventing another way to do what one can already do with RAISE, and it doesn't have much redeeming social value to justify the cognitive load of inventing another construct. The

Re: [HACKERS] PL/pgSQL 2

2014-09-01 Thread Andres Freund
On 2014-09-01 11:04:53 +0200, Joel Jacobson wrote: For those of you who use PL/pgSQL every day, I'm quite certain you all feel there are a number of things you would like to change in the language, but realize it cannot be achieved without possibly breaking compatibility, at least in theory.

Re: [HACKERS] Better support of exported snapshots with pg_dump

2014-09-01 Thread Andres Freund
Hi, On 2014-09-01 10:25:58 +0200, Bernd Helmle wrote: --On 1. September 2014 17:00:32 +0900 Michael Paquier michael.paqu...@gmail.com wrote: Currently pg_dump does not allow a user to specify an exported snapshot name that he would like to use for a dump using SET TRANSACTION SNAPSHOT (now

Re: [Fwd: Re: [HACKERS] proposal: new long psql parameter --on-error-stop]

2014-09-01 Thread Fujii Masao
On Thu, Aug 28, 2014 at 9:34 PM, Pavel Stehule pavel.steh...@gmail.com wrote: 2014-08-28 14:22 GMT+02:00 Fujii Masao masao.fu...@gmail.com: On Thu, Aug 28, 2014 at 5:48 AM, Pavel Stehule pavel.steh...@gmail.com wrote: comments? +fprintf(output, _( ECHO control what

Re: [HACKERS] PL/pgSQL 2

2014-09-01 Thread Hannu Krosing
On 09/01/2014 11:24 AM, Andres Freund wrote: On 2014-09-01 11:04:53 +0200, Joel Jacobson wrote: For those of you who use PL/pgSQL every day, I'm quite certain you all feel there are a number of things you would like to change in the language, but realize it cannot be achieved without possibly

Re: [HACKERS] Make LWLockAcquireCommon() inline?

2014-09-01 Thread Andres Freund
On 2014-08-30 14:22:40 +0200, Andres Freund wrote: Hi, when profiling optimized builds (linux, gcc 4.9) it's currently LWLockAcquireCommon() showing up, not it's callers. Instruction level profiles show that the tests for valptr show up in profiles to some extent. Since most callers don't

Re: [HACKERS] PL/pgSQL 2

2014-09-01 Thread Marko Tiikkaja
On 9/1/14 11:53 AM, Hannu Krosing wrote: On 09/01/2014 11:24 AM, Andres Freund wrote: Look at the *disaster* the few minor changes in python3 were. It's now, years after, only starting to get used again. You're going to have to find a more gradual way of doing this. Probably a better way (and

Re: [HACKERS] PL/pgSQL 2

2014-09-01 Thread Joel Jacobson
On Mon, Sep 1, 2014 at 11:24 AM, Andres Freund and...@2ndquadrant.com wrote: -many. Look at the *disaster* the few minor changes in python3 were. It's now, years after, only starting to get used again. You're going to have to find a more gradual way of doing this. I agree this is a valid

Re: [HACKERS] PL/pgSQL 2

2014-09-01 Thread Andres Freund
On 2014-09-01 12:00:48 +0200, Marko Tiikkaja wrote: On 9/1/14 11:53 AM, Hannu Krosing wrote: You're going to have to find a more gradual way of doing this. Probably a better way (and there has been some talk of it) is having some kind of PRAGMA functionality, or pl/pgsql specific LOCAL SET to

Re: [HACKERS] ALTER SYSTEM RESET?

2014-09-01 Thread Fujii Masao
On Sat, Aug 30, 2014 at 12:27 PM, Amit Kapila amit.kapil...@gmail.com wrote: On Wed, Aug 27, 2014 at 7:16 PM, Fujii Masao masao.fu...@gmail.com wrote: The patch looks good to me. One minor comment is; probably you need to update the tab-completion code. Thanks for the review. I have updated

Re: [HACKERS] PL/pgSQL 2

2014-09-01 Thread Hannu Krosing
On 09/01/2014 12:00 PM, Marko Tiikkaja wrote: On 9/1/14 11:53 AM, Hannu Krosing wrote: On 09/01/2014 11:24 AM, Andres Freund wrote: Look at the *disaster* the few minor changes in python3 were. It's now, years after, only starting to get used again. You're going to have to find a more

Re: [HACKERS] Re: proposal: ignore null fields in not relation type composite type based constructors

2014-09-01 Thread Jeevan Chalke
Hi Pavel, Patch does look good to me. And found no issues as such. However here are my optional suggestions: 1. Frankly, I did not like name of the function row_to_json_pretty_choosy. Something like row_to_json_pretty_ignore_nulls seems better to me. 2. To use ignore nulls feature, I have to

Re: [HACKERS] PL/pgSQL 2

2014-09-01 Thread Marko Tiikkaja
On 9/1/14 12:12 PM, Andres Freund wrote: On 2014-09-01 12:00:48 +0200, Marko Tiikkaja wrote: On 9/1/14 11:53 AM, Hannu Krosing wrote: You're going to have to find a more gradual way of doing this. Probably a better way (and there has been some talk of it) is having some kind of PRAGMA

Re: [HACKERS] PL/pgSQL 2

2014-09-01 Thread Joel Jacobson
On Mon, Sep 1, 2014 at 12:32 PM, Hannu Krosing ha...@2ndquadrant.com wrote: it would be ... [ WITH ( [LOCAL] attribute [, ...] ) ] where LOCAL attributes are _not_ inherited by nested functions but the LOCALs would shadow globals in the function definitions that have them. I know it

Re: [HACKERS] PL/pgSQL 2

2014-09-01 Thread Craig Ringer
On 09/01/2014 05:24 PM, Andres Freund wrote: Look at the *disaster* the few minor changes in python3 were. It's now, years after, only starting to get used again. While that's valid, I'd like to point out that Python2 and Python3 don't share a runtime and can't easily use each others' modules

Re: [HACKERS] PL/pgSQL 2

2014-09-01 Thread Andres Freund
On 2014-09-01 12:49:22 +0200, Marko Tiikkaja wrote: On 9/1/14 12:12 PM, Andres Freund wrote: On 2014-09-01 12:00:48 +0200, Marko Tiikkaja wrote: On 9/1/14 11:53 AM, Hannu Krosing wrote: You're going to have to find a more gradual way of doing this. Probably a better way (and there has been

[HACKERS] Adding 'crosstab' variants returning refcursor?

2014-09-01 Thread Craig Ringer
Hi all Before I have a go at hacking it together I wanted to check: Has anyone explored modifying crosstab to return a refcursor, so you can FETCH the results w/o having to specify an explicit result type/descriptor? Consuming the input in another query is more of a pain, but it'd be infinitely

Re: [HACKERS] Concurrently option for reindexdb

2014-09-01 Thread Sawada Masahiko
On Wed, Aug 27, 2014 at 11:02 AM, Michael Paquier michael.paqu...@gmail.com wrote: On Tue, Aug 26, 2014 at 5:12 PM, Andres Freund and...@anarazel.de wrote: On 2014-08-26 12:44:43 +0900, Michael Paquier wrote: I always was of the opinion that a exclusive lock is still *MUCH* better than what we

Re: [HACKERS] Immediate standby promotion

2014-09-01 Thread Fujii Masao
On Mon, Sep 1, 2014 at 3:23 PM, Amit Kapila amit.kapil...@gmail.com wrote: On Thu, Aug 14, 2014 at 1:49 PM, Fujii Masao masao.fu...@gmail.com wrote: Hi, I'd like to propose to add new option --immediate to pg_ctl promote. When this option is set, recovery ignores any WAL data which have not

[HACKERS] postgres_fdw behaves oddly

2014-09-01 Thread Etsuro Fujita
While working on [1], I've found that postgres_fdw behaves oddly: postgres=# create foreign table ft (a int) server loopback options (table_name 't'); CREATE FOREIGN TABLE postgres=# select tableoid, * from ft; tableoid | a --+--- 16400 | 1 (1 row) postgres=# select tableoid, * from

Re: [HACKERS] PL/pgSQL 2

2014-09-01 Thread Joel Jacobson
On Mon, Sep 1, 2014 at 12:55 PM, Andres Freund and...@2ndquadrant.com wrote: The likelihood of us now knowing all the things that we want to break rigth now seems about zero. There *will* be further ones. If we go with the approach of creating new language versions for all of them we'll end up

Re: [HACKERS] PL/pgSQL 2

2014-09-01 Thread Pavel Stehule
Hi 2014-09-01 11:04 GMT+02:00 Joel Jacobson j...@trustly.com: Hi, For those of you who use PL/pgSQL every day, I'm quite certain you all feel there are a number of things you would like to change in the language, but realize it cannot be achieved without possibly breaking compatibility,

Re: [HACKERS] PL/pgSQL 2

2014-09-01 Thread Pavel Stehule
2014-09-01 13:30 GMT+02:00 Joel Jacobson j...@trustly.com: On Mon, Sep 1, 2014 at 12:55 PM, Andres Freund and...@2ndquadrant.com wrote: The likelihood of us now knowing all the things that we want to break rigth now seems about zero. There *will* be further ones. If we go with the

Re: [HACKERS] Adding 'crosstab' variants returning refcursor?

2014-09-01 Thread Pavel Stehule
Hi 2014-09-01 13:08 GMT+02:00 Craig Ringer cr...@2ndquadrant.com: Hi all Before I have a go at hacking it together I wanted to check: Has anyone explored modifying crosstab to return a refcursor, so you can FETCH the results w/o having to specify an explicit result type/descriptor? +1

Re: [HACKERS] alter user set local_preload_libraries.

2014-09-01 Thread Kyotaro HORIGUCHI
Hello, I found this issue when trying per-pg_user (role) loading of auto_analyze and some tweaking tool. It is not necessarily set by the user by own, but the function to decide whether to load some module by the session-user would be usable, at least, as for me:) I think we could just

Re: [HACKERS] pg_receivexlog and replication slots

2014-09-01 Thread Michael Paquier
On Sun, Aug 31, 2014 at 10:45 PM, Magnus Hagander mag...@hagander.net wrote: As this is a number of patches rolled into one - do you happen to keep them separate in your local repo? If so can you send them as separate ones (refactor identify_system should be quite unrelated to supporting

Re: [HACKERS] pg_receivexlog and replication slots

2014-09-01 Thread Andres Freund
On 2014-09-01 20:58:29 +0900, Michael Paquier wrote: On Sun, Aug 31, 2014 at 10:45 PM, Magnus Hagander mag...@hagander.net wrote: As this is a number of patches rolled into one - do you happen to keep them separate in your local repo? If so can you send them as separate ones (refactor

Re: [HACKERS] LIMIT for UPDATE and DELETE

2014-09-01 Thread Marko Tiikkaja
On 8/29/14 4:33 PM, Tom Lane wrote: So either it has to be inside ModifyTable or the ModifyTable has to somehow pass something to a Limit node on top of it ... or we add a LockRows node below the Limit node. Yeah, that would make UPDATE/LIMIT a tad slower, but I think that might be preferable

Re: [HACKERS] PL/pgSQL 2

2014-09-01 Thread Joel Jacobson
On Mon, Sep 1, 2014 at 1:30 PM, Pavel Stehule pavel.steh...@gmail.com wrote: I agree with Andres - it is not a good for plpgsql and for plpgsql users. The benefit must be significant for 90% of users. ... Official implementation of plpgsql2 can be very wrong and dangerous signal - so we should

Re: [HACKERS] PL/pgSQL 2

2014-09-01 Thread Pavel Stehule
2014-09-01 14:27 GMT+02:00 Joel Jacobson j...@trustly.com: On Mon, Sep 1, 2014 at 1:30 PM, Pavel Stehule pavel.steh...@gmail.com wrote: I agree with Andres - it is not a good for plpgsql and for plpgsql users. The benefit must be significant for 90% of users. ... Official implementation

Re: [HACKERS] Better support of exported snapshots with pg_dump

2014-09-01 Thread Michael Paquier
On Mon, Sep 1, 2014 at 6:30 PM, Andres Freund and...@2ndquadrant.com wrote: On 2014-09-01 10:25:58 +0200, Bernd Helmle wrote: There was a discussion of this kind of feature some time ago here:

Re: [HACKERS] PL/pgSQL 2

2014-09-01 Thread Hannu Krosing
On 09/01/2014 12:55 PM, Andres Freund wrote: On 2014-09-01 12:49:22 +0200, Marko Tiikkaja wrote: On 9/1/14 12:12 PM, Andres Freund wrote: On 2014-09-01 12:00:48 +0200, Marko Tiikkaja wrote: On 9/1/14 11:53 AM, Hannu Krosing wrote: You're going to have to find a more gradual way of doing this.

Re: [HACKERS] Better support of exported snapshots with pg_dump

2014-09-01 Thread Andres Freund
On 2014-09-01 21:54:24 +0900, Michael Paquier wrote: On Mon, Sep 1, 2014 at 6:30 PM, Andres Freund and...@2ndquadrant.com wrote: I was never convinced of the reasoning in that thread. Possibly things have changed enough now that logical decoding is in core... Well, the test case I got in

Re: [HACKERS] PL/pgSQL 2

2014-09-01 Thread Marko Tiikkaja
On 9/1/14 2:53 PM, Pavel Stehule wrote: 2014-09-01 14:27 GMT+02:00 Joel Jacobson j...@trustly.com: On Mon, Sep 1, 2014 at 1:30 PM, Pavel Stehule pavel.steh...@gmail.com wrote: I agree with Andres - it is not a good for plpgsql and for plpgsql users. The benefit must be significant for 90% of

Re: [HACKERS] PL/pgSQL 2

2014-09-01 Thread Joel Jacobson
On Mon, Sep 1, 2014 at 2:53 PM, Pavel Stehule pavel.steh...@gmail.com wrote: It bad signal to have two languages plpgsql and plpgsql2. Who will believe to us so we will continue development of plpgsql? Depends on how you define development. Bugfixes of plpgsql? Yes, of course. New features? No,

Re: [HACKERS] PL/pgSQL 2

2014-09-01 Thread Andres Freund
On 2014-09-01 15:19:41 +0200, Joel Jacobson wrote: On Mon, Sep 1, 2014 at 2:53 PM, Pavel Stehule pavel.steh...@gmail.com wrote: It bad signal to have two languages plpgsql and plpgsql2. Who will believe to us so we will continue development of plpgsql? Depends on how you define

Re: [HACKERS] psql \watch versus \timing

2014-09-01 Thread Michael Paquier
On Fri, Aug 29, 2014 at 6:33 PM, Heikki Linnakangas hlinnakan...@vmware.com wrote: On 08/28/2014 02:46 PM, Fujii Masao wrote: On Tue, Aug 26, 2014 at 4:55 AM, Heikki Linnakangas hlinnakan...@vmware.com wrote: On 08/25/2014 10:48 PM, Heikki Linnakangas wrote: Actually, perhaps it would be

Re: [HACKERS] Concurrently option for reindexdb

2014-09-01 Thread Craig Ringer
On 08/25/2014 02:36 PM, Sawada Masahiko wrote: Hi all, Attached WIP patch adds -C (--concurrently) option for reindexdb command for concurrently reindexing. If we specify -C option with any table then reindexdb do reindexing concurrently with minimum lock necessary. Note that we cannot use

Re: [HACKERS] PL/pgSQL 2

2014-09-01 Thread Craig Ringer
On 09/01/2014 05:04 PM, Joel Jacobson wrote: Just like with plpgsql, once released, plpgsql2 cannot break compatibility with future versions, so we only have one chance to carefully think though what we would like to change in the language. You're not proposing to copy plpgsql's runtime

Re: [HACKERS] PL/pgSQL 2

2014-09-01 Thread Craig Ringer
On 09/01/2014 05:04 PM, Joel Jacobson wrote: From the top of my head, these are Things I personally would want to see in plpgsql2: Oh, also, I'd *love* to improve how non-plannable statements with PL/PgSQL variable subsitutions behave. *I* understand why the following is wrong: DO $$ DECLARE

Re: [HACKERS] ALTER SYSTEM RESET?

2014-09-01 Thread Amit Kapila
On Mon, Sep 1, 2014 at 3:57 PM, Fujii Masao masao.fu...@gmail.com wrote: On Sat, Aug 30, 2014 at 12:27 PM, Amit Kapila amit.kapil...@gmail.com wrote: On Wed, Aug 27, 2014 at 7:16 PM, Fujii Masao masao.fu...@gmail.com wrote: The patch looks good to me. One minor comment is; probably you need

Re: [HACKERS] PL/pgSQL 2

2014-09-01 Thread Pavel Stehule
2014-09-01 15:12 GMT+02:00 Marko Tiikkaja ma...@joh.to: On 9/1/14 2:53 PM, Pavel Stehule wrote: 2014-09-01 14:27 GMT+02:00 Joel Jacobson j...@trustly.com: On Mon, Sep 1, 2014 at 1:30 PM, Pavel Stehule pavel.steh...@gmail.com wrote: I agree with Andres - it is not a good for plpgsql and

Re: [HACKERS] PL/pgSQL 2

2014-09-01 Thread Pavel Stehule
2014-09-01 15:52 GMT+02:00 Craig Ringer cr...@2ndquadrant.com: On 09/01/2014 05:04 PM, Joel Jacobson wrote: From the top of my head, these are Things I personally would want to see in plpgsql2: Oh, also, I'd *love* to improve how non-plannable statements with PL/PgSQL variable

Re: [HACKERS] PL/pgSQL 2

2014-09-01 Thread Craig Ringer
On 09/01/2014 09:58 PM, Pavel Stehule wrote: It is in ToDo - allow parametrization for COMMANDs. But this is one point, when I am not sure if we would it. Now - situation is very simply. Variables should not be used as table or column name. With your proposal, the situation will by much

Re: [HACKERS] PL/pgSQL 2

2014-09-01 Thread Pavel Stehule
2014-09-01 16:01 GMT+02:00 Craig Ringer cr...@2ndquadrant.com: On 09/01/2014 09:58 PM, Pavel Stehule wrote: It is in ToDo - allow parametrization for COMMANDs. But this is one point, when I am not sure if we would it. Now - situation is very simply. Variables should not be used as

Re: [HACKERS] PL/pgSQL 2

2014-09-01 Thread Andres Freund
On 2014-09-01 22:01:33 +0800, Craig Ringer wrote: On 09/01/2014 09:58 PM, Pavel Stehule wrote: It is in ToDo - allow parametrization for COMMANDs. But this is one point, when I am not sure if we would it. Now - situation is very simply. Variables should not be used as table or

Re: [HACKERS] PL/pgSQL 2

2014-09-01 Thread Craig Ringer
On 09/01/2014 10:11 PM, Pavel Stehule wrote: It can be solution, but I dislike it .. It increase a language complexity .. vars with or without prefix .. and more, hidden dynamic SQL Nothing what I like - I have a mental barrier to this concept. Yeah - the question is whether it's better

Re: [HACKERS] PL/pgSQL 2

2014-09-01 Thread Craig Ringer
On 09/01/2014 10:17 PM, Andres Freund wrote: Imo this is still something that's more dynamic SQL (i.e. EXECUTE's remit) than something that shouldn't be doable implicitly. So perhaps the solution is to extend EXECUTE to allow specifying tablenames as variables more conveniently? With

Re: [HACKERS] PL/pgSQL 2

2014-09-01 Thread Pavel Stehule
2014-09-01 16:18 GMT+02:00 Craig Ringer cr...@2ndquadrant.com: On 09/01/2014 10:11 PM, Pavel Stehule wrote: It can be solution, but I dislike it .. It increase a language complexity .. vars with or without prefix .. and more, hidden dynamic SQL Nothing what I like - I have a mental

Re: [HACKERS] PL/pgSQL 2

2014-09-01 Thread Andres Freund
On 2014-09-01 22:20:37 +0800, Craig Ringer wrote: On 09/01/2014 10:17 PM, Andres Freund wrote: Imo this is still something that's more dynamic SQL (i.e. EXECUTE's remit) than something that shouldn't be doable implicitly. So perhaps the solution is to extend EXECUTE to allow specifying

Re: [HACKERS] PL/pgSQL 2

2014-09-01 Thread Craig Ringer
On 09/01/2014 10:24 PM, Andres Freund wrote: I know of format(), but it doesn't allow you to pass parameters as actual query variables unfortunately. I'm wondering if there's a way to marry USING and format()... Well, the idiom: EXECUTE format(SELECT %I FROM %I WHERE $1, col, tbl) USING

Re: [HACKERS] PL/pgSQL 2

2014-09-01 Thread Joel Jacobson
On Mon, Sep 1, 2014 at 3:25 PM, Andres Freund and...@2ndquadrant.com wrote: On 2014-09-01 15:19:41 +0200, Joel Jacobson wrote: On Mon, Sep 1, 2014 at 2:53 PM, Pavel Stehule pavel.steh...@gmail.com wrote: It bad signal to have two languages plpgsql and plpgsql2. Who will believe to us so we

Re: [HACKERS] PL/pgSQL 2

2014-09-01 Thread Joel Jacobson
+1 I use underscore for *all* variables and input parameters in all functions. Making that a requirement in plpgsql2 wouldn't break any of my code. On Mon, Sep 1, 2014 at 3:52 PM, Craig Ringer cr...@2ndquadrant.com wrote: On 09/01/2014 05:04 PM, Joel Jacobson wrote: From the top of my head,

Re: [HACKERS] PL/pgSQL 2

2014-09-01 Thread Pavel Stehule
2014-09-01 16:26 GMT+02:00 Craig Ringer cr...@2ndquadrant.com: On 09/01/2014 10:24 PM, Andres Freund wrote: I know of format(), but it doesn't allow you to pass parameters as actual query variables unfortunately. I'm wondering if there's a way to marry USING and format()... Well, the

Re: [HACKERS] PL/pgSQL 2

2014-09-01 Thread Hannu Krosing
On 09/01/2014 03:45 PM, Craig Ringer wrote: On 09/01/2014 05:04 PM, Joel Jacobson wrote: Just like with plpgsql, once released, plpgsql2 cannot break compatibility with future versions, so we only have one chance to carefully think though what we would like to change in the language. You're

Re: [HACKERS] PL/pgSQL 2

2014-09-01 Thread Joel Jacobson
On Mon, Sep 1, 2014 at 4:26 PM, Craig Ringer cr...@2ndquadrant.com wrote: Well, the idiom: EXECUTE format(SELECT %I FROM %I WHERE $1, col, tbl) USING val; is not lovely. It works, but it's clumsy. This is exactly why we need a new language. All the clumsy stuff we cannot fix in plpgsql,

Re: [HACKERS] PL/pgSQL 2

2014-09-01 Thread Andres Freund
On 2014-09-01 16:29:18 +0200, Joel Jacobson wrote: On Mon, Sep 1, 2014 at 3:25 PM, Andres Freund and...@2ndquadrant.com wrote: On 2014-09-01 15:19:41 +0200, Joel Jacobson wrote: On Mon, Sep 1, 2014 at 2:53 PM, Pavel Stehule pavel.steh...@gmail.com wrote: It bad signal to have two

Re: [HACKERS] PL/pgSQL 2

2014-09-01 Thread Heikki Linnakangas
On 09/01/2014 05:41 PM, Joel Jacobson wrote: On Mon, Sep 1, 2014 at 4:26 PM, Craig Ringer cr...@2ndquadrant.com wrote: Well, the idiom: EXECUTE format(SELECT %I FROM %I WHERE $1, col, tbl) USING val; is not lovely. It works, but it's clumsy. This is exactly why we need a new language.

Re: [HACKERS] PL/pgSQL 2

2014-09-01 Thread Pavel Stehule
2014-09-01 16:39 GMT+02:00 Hannu Krosing ha...@2ndquadrant.com: On 09/01/2014 03:45 PM, Craig Ringer wrote: On 09/01/2014 05:04 PM, Joel Jacobson wrote: Just like with plpgsql, once released, plpgsql2 cannot break compatibility with future versions, so we only have one chance to

Re: [HACKERS] PL/pgSQL 2

2014-09-01 Thread Pavel Stehule
2014-09-01 16:41 GMT+02:00 Joel Jacobson j...@trustly.com: On Mon, Sep 1, 2014 at 4:26 PM, Craig Ringer cr...@2ndquadrant.com wrote: Well, the idiom: EXECUTE format(SELECT %I FROM %I WHERE $1, col, tbl) USING val; is not lovely. It works, but it's clumsy. This is exactly why we

Re: [HACKERS] psql \watch versus \timing

2014-09-01 Thread Tom Lane
Michael Paquier michael.paqu...@gmail.com writes: I just tested the patch and this feature works as expected if timing is on and it displays the individual run time of each query kicked by \watch. Note that --echo-hidden does not display the query run during each loop and that this is contrary

Re: [HACKERS] PL/pgSQL 2

2014-09-01 Thread Joel Jacobson
On Mon, Sep 1, 2014 at 4:41 PM, Andres Freund and...@2ndquadrant.com wrote: I'm just saying it's much less probable you can add new features to plpgsql than to plpgsql2, as you have to take into account the risk of breaking compatibility. That's just a difference of one release. The release

Re: [HACKERS] PL/pgSQL 2

2014-09-01 Thread Craig Ringer
On 09/01/2014 10:41 PM, Joel Jacobson wrote: This is exactly why we need a new language. All the clumsy stuff we cannot fix in plpgsql, can easily be fixed in plpgsql2, with the most beautiful syntax we can come up with. I guess it's a question if we want to support things like this. If we

Re: [HACKERS] PL/pgSQL 2

2014-09-01 Thread Joel Jacobson
On Mon, Sep 1, 2014 at 5:16 PM, Craig Ringer cr...@2ndquadrant.com wrote: On 09/01/2014 10:41 PM, Joel Jacobson wrote: This is exactly why we need a new language. All the clumsy stuff we cannot fix in plpgsql, can easily be fixed in plpgsql2, with the most beautiful syntax we can come up with.

Re: [HACKERS] PL/pgSQL 2

2014-09-01 Thread David G Johnston
Joel Jacobson-2 wrote On Mon, Sep 1, 2014 at 4:26 PM, Craig Ringer lt; craig@ gt; wrote: Well, the idiom: EXECUTE format(SELECT %I FROM %I WHERE $1, col, tbl) USING val; is not lovely. It works, but it's clumsy. This is exactly why we need a new language. All the clumsy stuff we

[HACKERS] Patch for psql History Display on MacOSX

2014-09-01 Thread Stepan Rutz
Hi everbody, My first mail to this one, so please be mild. I fired up the debugger to get this item going, which is also on the Todo List. Attached is a very trivial patch as a basis for discussion that at least makes \s (show history) work in psql on Macs. Macs uses libedit, which has a

Re: [HACKERS] PL/pgSQL 2

2014-09-01 Thread Tom Lane
Andres Freund and...@2ndquadrant.com writes: On 2014-09-01 15:19:41 +0200, Joel Jacobson wrote: On Mon, Sep 1, 2014 at 2:53 PM, Pavel Stehule pavel.steh...@gmail.com wrote: It bad signal to have two languages plpgsql and plpgsql2. Who will believe to us so we will continue development of

Re: [HACKERS] On partitioning

2014-09-01 Thread Greg Stark
On Sun, Aug 31, 2014 at 9:03 PM, Tom Lane t...@sss.pgh.pa.us wrote: Aside from costing planning time, most likely that would forever prevent us from pushing some types of intelligence about partitioning into the executor. How would it affect this calculus if there were partitioned indexes

Re: [HACKERS] On partitioning

2014-09-01 Thread Andres Freund
On 2014-08-29 20:12:16 +0200, Hannu Krosing wrote: It would need to replace plain tid (pagenr, tupnr) with triple of (partid, pagenr, tupnr). Cross-partition indexes are especially needed if we want to allow putting UNIQUE constraints on non-partition-key columns. I actually don't think

Re: [HACKERS] On partitioning

2014-09-01 Thread Tom Lane
Greg Stark st...@mit.edu writes: On Sun, Aug 31, 2014 at 9:03 PM, Tom Lane t...@sss.pgh.pa.us wrote: Aside from costing planning time, most likely that would forever prevent us from pushing some types of intelligence about partitioning into the executor. How would it affect this calculus if

Re: [HACKERS] [BUGS] BUG #9652: inet types don't support min/max

2014-09-01 Thread Haribabu Kommi
On Fri, Aug 29, 2014 at 12:39 PM, Tom Lane t...@sss.pgh.pa.us wrote: Haribabu Kommi kommi.harib...@gmail.com writes: Thanks for your review. Please find the rebased patch to latest HEAD. Committed with minor (mostly cosmetic) alterations. Thanks. Regards, Hari Babu Fujitsu Australia --

Re: [HACKERS] On partitioning

2014-09-01 Thread Andres Freund
On 2014-08-31 16:03:30 -0400, Tom Lane wrote: Another thought about this general topic: Alvaro Herrera alvhe...@2ndquadrant.com writes: ... Allowed actions on a RELKIND_PARTITION: * CREATE INDEX .. ON PARTITION n ON TABLE xyz ... Still To Be Designed * Are

Re: [HACKERS] On partitioning

2014-09-01 Thread Greg Stark
On Mon, Sep 1, 2014 at 4:59 PM, Tom Lane t...@sss.pgh.pa.us wrote: The push into executor idea I was alluding to is that we might invent plan constructs like a ModifyTable node that applies to a whole inheritance^H^H^Hpartitioning tree and leaves the tuple routing to be done at runtime.

Re: [HACKERS] On partitioning

2014-09-01 Thread Andres Freund
On 2014-09-01 11:59:37 -0400, Tom Lane wrote: Greg Stark st...@mit.edu writes: On Sun, Aug 31, 2014 at 9:03 PM, Tom Lane t...@sss.pgh.pa.us wrote: Aside from costing planning time, most likely that would forever prevent us from pushing some types of intelligence about partitioning into the

Re: [HACKERS] On partitioning

2014-09-01 Thread Heikki Linnakangas
On 09/01/2014 06:59 PM, Tom Lane wrote: Greg Stark st...@mit.edu writes: On Sun, Aug 31, 2014 at 9:03 PM, Tom Lane t...@sss.pgh.pa.us wrote: Aside from costing planning time, most likely that would forever prevent us from pushing some types of intelligence about partitioning into the executor.

Re: [HACKERS] Tips/advice for implementing integrated RESTful HTTP API

2014-09-01 Thread Dobes Vandermeer
Hmm yes I am learning that the BG worker system isn't as helpful as I had hoped due to the single database restriction. As for a writing a frontend this might be the best solution. A java frontend would be easy but pointless because the whole point here is to provide a lightweight access method

Re: [HACKERS] delta relations in AFTER triggers

2014-09-01 Thread Heikki Linnakangas
On 08/30/2014 12:15 AM, Kevin Grittner wrote: Heikki Linnakangas hlinnakan...@vmware.com wrote: On 08/28/2014 12:03 AM, Kevin Grittner wrote: Heikki Linnakangas hlinnakan...@vmware.com wrote: I suggest adding a new hook to the ParseState struct, (p_rangevar_hook ?). The planner calls it

Re: [HACKERS] On partitioning

2014-09-01 Thread Hannu Krosing
On 09/01/2014 05:52 PM, Andres Freund wrote: On 2014-08-29 20:12:16 +0200, Hannu Krosing wrote: It would need to replace plain tid (pagenr, tupnr) with triple of (partid, pagenr, tupnr). Cross-partition indexes are especially needed if we want to allow putting UNIQUE constraints on

Re: [HACKERS] Patch for psql History Display on MacOSX

2014-09-01 Thread Tom Lane
Stepan Rutz stepan.r...@gmx.de writes: Attached is a very trivial patch as a basis for discussion that at least makes \s (show history) work in psql on Macs. Macs uses libedit, which has a libreadline interface. Hm. The $64 question here is whether we can assume that history_get() exists

Re: [HACKERS] delta relations in AFTER triggers

2014-09-01 Thread Tom Lane
Heikki Linnakangas hlinnakan...@vmware.com writes: On 08/30/2014 12:15 AM, Kevin Grittner wrote: If we were to go with the hooks as you propose, we would still need to take the information from TriggerData and put it somewhere else for the hook to reference. Sure. FWIW, I agree with Heikki

Re: [HACKERS] implement subject alternative names support for SSL connections

2014-09-01 Thread Alexey Klyukin
On Mon, Sep 1, 2014 at 10:39 AM, Alexey Klyukin al...@hintbits.com wrote: On Fri, Aug 29, 2014 at 11:22 AM, Heikki Linnakangas hlinnakan...@vmware.com wrote: Yeah, I think a certificate without CN should be supported. See also RFC 6125, section 4.1. Rules [for issuers of certificates]:

Re: [HACKERS] PL/pgSQL 2

2014-09-01 Thread Joel Jacobson
On Mon, Sep 1, 2014 at 5:45 PM, Tom Lane t...@sss.pgh.pa.us wrote: What is actually being proposed, AFAICS, is a one-shot fix for a bunch of unfortunate choices. That might be worth doing, but let's not fool ourselves about whether it's one-shot or not. I'm glad to hear you think it *might*

Re: [HACKERS] Re: proposal: ignore null fields in not relation type composite type based constructors

2014-09-01 Thread Pavel Stehule
2014-09-01 12:33 GMT+02:00 Jeevan Chalke jeevan.cha...@enterprisedb.com: Hi Pavel, Patch does look good to me. And found no issues as such. However here are my optional suggestions: 1. Frankly, I did not like name of the function row_to_json_pretty_choosy. Something like

Re: [HACKERS] PL/pgSQL 2

2014-09-01 Thread Álvaro Hernández Tortosa
On 01/09/14 14:27, Joel Jacobson wrote: On Mon, Sep 1, 2014 at 1:30 PM, Pavel Stehule pavel.steh...@gmail.com wrote: I agree with Andres - it is not a good for plpgsql and for plpgsql users. The benefit must be significant for 90% of users. ... Official implementation of plpgsql2 can be very

Re: [HACKERS] PL/pgSQL 2

2014-09-01 Thread Pavel Stehule
2014-09-01 20:23 GMT+02:00 Joel Jacobson j...@trustly.com: On Mon, Sep 1, 2014 at 5:45 PM, Tom Lane t...@sss.pgh.pa.us wrote: What is actually being proposed, AFAICS, is a one-shot fix for a bunch of unfortunate choices. That might be worth doing, but let's not fool ourselves about

Re: [HACKERS] PL/pgSQL 2

2014-09-01 Thread Tom Lane
Joel Jacobson j...@trustly.com writes: I see two possible approaches of a plpgsql2 project, both aiming to require minimal/no changes of most existing best-practice plpgsql code: a) fork plpgsql code base and implement changes with as few lines of code as possible, making it easier to

Re: [HACKERS] PL/pgSQL 2

2014-09-01 Thread Tom Lane
=?UTF-8?B?w4FsdmFybyBIZXJuw6FuZGV6IFRvcnRvc2E=?= a...@nosys.es writes: What I can add is that, if Postgres is to devote resources to a new language, I would plan it with a broader scope. What would attract most users? Would it bring non postgres users to Postgres? What could be one of

Re: [HACKERS] PL/pgSQL 2

2014-09-01 Thread Álvaro Hernández Tortosa
On 01/09/14 20:42, Tom Lane wrote: =?UTF-8?B?w4FsdmFybyBIZXJuw6FuZGV6IFRvcnRvc2E=?= a...@nosys.es writes: What I can add is that, if Postgres is to devote resources to a new language, I would plan it with a broader scope. What would attract most users? Would it bring non postgres users

Re: [HACKERS] PL/pgSQL 2

2014-09-01 Thread Pavel Stehule
2014-09-01 20:58 GMT+02:00 Álvaro Hernández Tortosa a...@nosys.es: On 01/09/14 20:42, Tom Lane wrote: =?UTF-8?B?w4FsdmFybyBIZXJuw6FuZGV6IFRvcnRvc2E=?= a...@nosys.es writes: What I can add is that, if Postgres is to devote resources to a new language, I would plan it with a broader

Re: [HACKERS] Built-in binning functions

2014-09-01 Thread Petr Jelinek
On 01/09/14 01:42, Tom Lane wrote: BTW, was there a reason for not noticing the case of exact match in the search loop, and falling out early? As it stands the code will reliably choose the leftmost match if there are multiple equal items in the search array, but do we care about such cases?

Re: [HACKERS] PL/pgSQL 2

2014-09-01 Thread Joel Jacobson
On Mon, Sep 1, 2014 at 8:38 PM, Tom Lane t...@sss.pgh.pa.us wrote: c) plpgsql and plpgsql2 are the same code base, with a small number of places that act differently depending on the language version. +1 to the idea -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To

Re: [HACKERS] Patch for psql History Display on MacOSX

2014-09-01 Thread Stepan Rutz
Thanks Tom. This would help the poor mac-osx guys like me. I guess this is not that important because no one runs a production server on OS-X. Back patching to 9.3 won’t work as is, some minor conflict was there. Anyway, I am sure the iteration used in encode_history and decode_history in

Re: [HACKERS] PL/pgSQL 2

2014-09-01 Thread Joel Jacobson
On Mon, Sep 1, 2014 at 8:34 PM, Álvaro Hernández Tortosa a...@nosys.es wrote: What I can add is that, if Postgres is to devote resources to a new language, I would plan it with a broader scope. What would attract most users? Would it bring non postgres users to Postgres? What could be one

Re: [HACKERS] Re: [BUGS] Re: BUG #9555: pg_dump for tables with inheritance recreates the table with the wrong order of columns

2014-09-01 Thread Bruce Momjian
On Sun, Aug 31, 2014 at 02:10:33PM -0400, Tom Lane wrote: David G Johnston david.g.johns...@gmail.com writes: Would it be proper to issue an additional top-level warning with the column moved notification? Thus there would be NOTICE, NOTICE, WARNING in the above example? Or, more

  1   2   >