Re: [HACKERS] PL/pgSQL 2

2014-09-03 Thread Szymon Guz
On 3 September 2014 01:08, Jan Wieck j...@wi3ck.info wrote: On 09/02/2014 06:56 PM, Andrew Dunstan wrote: People are free to do what they want, but to my mind that would be a massive waste of resources, and probably imposing a substantial extra maintenance burden on the core committers. I

Re: [HACKERS] PL/pgSQL 2

2014-09-03 Thread Joel Jacobson
On Wed, Sep 3, 2014 at 7:54 AM, Pavel Stehule pavel.steh...@gmail.com wrote: I am not against to improve a PL/pgSQL. And I repeat, what can be done and can be done early: a) ASSERT clause -- with some other modification to allow better static analyze of DML statements, and enforces checks in

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

2014-09-03 Thread Jeevan Chalke
Hi Pavel, Here are few more comments on new implementation. 1. /* - * SQL function row_to_json(row) + * SQL function row_to_json(row record, pretty bool, ignore_nulls bool) */ In above comments, parameter name row should changed to rowval. 2. -DATA(insert OID = 3155 ( row_to_json

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

2014-09-03 Thread Pavel Stehule
Hello fixed ECHO, ECHO_HIDDEN, PROPMPT Regards Pavel 2014-09-01 11:52 GMT+02:00 Fujii Masao masao.fu...@gmail.com: 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

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

2014-09-03 Thread Pavel Stehule
Hi 2014-09-03 9:27 GMT+02:00 Jeevan Chalke jeevan.cha...@enterprisedb.com: Hi Pavel, Here are few more comments on new implementation. 1. /* - * SQL function row_to_json(row) + * SQL function row_to_json(row record, pretty bool, ignore_nulls bool) */ In above comments, parameter

Re: [HACKERS] PL/pgSQL 2

2014-09-03 Thread Pavel Stehule
2014-09-03 9:14 GMT+02:00 Joel Jacobson j...@trustly.com: On Wed, Sep 3, 2014 at 7:54 AM, Pavel Stehule pavel.steh...@gmail.com wrote: I am not against to improve a PL/pgSQL. And I repeat, what can be done and can be done early: a) ASSERT clause -- with some other modification to allow

Re: [HACKERS] PL/pgSQL 2

2014-09-03 Thread Joel Jacobson
On Wed, Sep 3, 2014 at 10:07 AM, Pavel Stehule pavel.steh...@gmail.com wrote: When you use name plpgsql2 you say, so plpgsql2 is successor plpgsql. It is very hard to accept it. So any other name is not problem for me - like plpgsql-safe-subset or something else plpgsql2 *is* the successor of

Re: [HACKERS] why after increase the hash table partitions, TPMC decrease

2014-09-03 Thread Amit Kapila
On Wed, Sep 3, 2014 at 8:44 AM, Xiaoyulei xiaoyu...@huawei.com wrote: benchmarSQL has about half reads. So I think it should be effective. I don't think BufFreelistLock take much time, it just get a buffer from list. It should be very fast. Only incase all the data fits in shared buffers,

[HACKERS] Join push-down support for foreign tables

2014-09-03 Thread Shigeru Hanada
Hi all, In 2011 I proposed join push-down support for foreign tables, which would improve performance of queries which contain join between foreign tables in one server, but it has not finished before time-up. This performance improvement would widen application range of foreign tables, so I'd

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

2014-09-03 Thread Heikki Linnakangas
On 09/01/2014 09:14 PM, Alexey Klyukin wrote: 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

[HACKERS] TODO item for protocol revision: Negotiate encryption in connection handshake

2014-09-03 Thread Craig Ringer
Hi all Another thing I keep on wishing Pg's protocol had is an after-connection negotiation for transport encryption, like STARTTLS . Right now, the client has to guess if the server requires, permits, or rejects SSL, and decide whether to start with SSL or !SSL. If that fails, it has to try the

Re: [HACKERS] Commitfest status

2014-09-03 Thread Heikki Linnakangas
We now have 32 patches in Needs Review state, and 7 of those don't have a reviewer assigned. They are: 1. Grouping Sets 2. hash join - dynamic bucket count 3. Enable WAL archiving even in standby 4. Selectivity estimation for inet operators 5. Better syntax for REINDEX 6. pgcrypto: support PGP

Re: [HACKERS] Scaling shared buffer eviction

2014-09-03 Thread Amit Kapila
On Wed, Sep 3, 2014 at 1:45 AM, Robert Haas robertmh...@gmail.com wrote: On Thu, Aug 28, 2014 at 7:11 AM, Amit Kapila amit.kapil...@gmail.com wrote: I have updated the patch to address the feedback. Main changes are: 1. For populating freelist, have a separate process (bgreclaimer)

Re: [HACKERS] Commitfest status

2014-09-03 Thread Pavel Stehule
Hi 2014-09-03 13:18 GMT+02:00 Heikki Linnakangas hlinnakan...@vmware.com: We now have 32 patches in Needs Review state, and 7 of those don't have a reviewer assigned. They are: 1. Grouping Sets I plan to do review of Grouping Sets, but I am afraid so I cannot to do in next two weeks.

Re: [HACKERS] psql \watch versus \timing

2014-09-03 Thread Michael Paquier
On Mon, Sep 1, 2014 at 11:56 PM, Tom Lane t...@sss.pgh.pa.us wrote: 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

Re: [HACKERS] pgcrypto: PGP signatures

2014-09-03 Thread Joel Jacobson
On Wed, Aug 6, 2014 at 2:46 PM, Marko Tiikkaja ma...@joh.to wrote: Hi hackers, Attached is a patch to add support for PGP signatures in encrypted messages into pgcrypto. I noticed Heikki wanted to check if there is any interested for the patches in the current commitfest. Yes, our company

Re: [HACKERS] pgcrypto: PGP signatures

2014-09-03 Thread Heikki Linnakangas
On 09/03/2014 02:51 PM, Joel Jacobson wrote: On Wed, Aug 6, 2014 at 2:46 PM, Marko Tiikkaja ma...@joh.to wrote: Hi hackers, Attached is a patch to add support for PGP signatures in encrypted messages into pgcrypto. I noticed Heikki wanted to check if there is any interested for the patches

Re: [HACKERS] [BUGS] BUG #10823: Better REINDEX syntax.

2014-09-03 Thread Vik Fearing
On 09/02/2014 10:17 PM, Marko Tiikkaja wrote: On 2014-08-29 01:00, Alvaro Herrera wrote: Vik Fearing wrote: Here are two patches for this. The first one, reindex_user_tables.v1.patch, implements the variant that only hits user tables, as suggested by you. The second one,

Re: [HACKERS] Escaping from blocked send() reprised.

2014-09-03 Thread Heikki Linnakangas
On 09/03/2014 12:23 AM, Andres Freund wrote: On 2014-09-02 17:21:03 -0400, Tom Lane wrote: Heikki Linnakangas hlinnakan...@vmware.com writes: I was going to suggest using WaitLatchOrSocket instead of sleeping in 1 second increment, but I see that WaitLatchOrSocket() doesn't currently support

Re: [HACKERS] TODO item for protocol revision: Negotiate encryption in connection handshake

2014-09-03 Thread Magnus Hagander
On Wed, Sep 3, 2014 at 12:17 PM, Craig Ringer cr...@2ndquadrant.com wrote: Hi all Another thing I keep on wishing Pg's protocol had is an after-connection negotiation for transport encryption, like STARTTLS . Right now, the client has to guess if the server requires, permits, or rejects

Re: [HACKERS] GSoC on WAL-logging hash indexes

2014-09-03 Thread Vik Fearing
On 08/20/2014 02:43 AM, Michael Paquier wrote: On Thu, Jun 19, 2014 at 6:40 PM, Vik Fearing vik.fear...@dalibo.com mailto:vik.fear...@dalibo.com wrote: On 04/30/2014 11:41 PM, Tom Lane wrote: We really oughta fix the WAL situation, not just band-aid around it. After

Re: [HACKERS] PL/pgSQL 2

2014-09-03 Thread Joshua D. Drake
On 09/02/2014 03:50 PM, Jan Wieck wrote: PL/pgSQL's syntax was modelled to look like PL/SQL. Which is a Ada/COBOL lookalike. Instead of trying to mimic what it was or a T-SQL thing instead ... maybe it is time to come up with a true PostgreSQL specific PL for a change? Just for the sake of

Re: [HACKERS] PL/pgSQL 2

2014-09-03 Thread Joshua D. Drake
On 09/02/2014 04:01 PM, Álvaro Hernández Tortosa wrote: It's not copying. It's easying a path for others to migrate and come to Postgres. I'm interested why you are more interested in MSSQL. My reasons for being interested in Oracle are: - It has more users (biggest and above all,

Re: [HACKERS] Inverse of pg_get_serial_sequence?

2014-09-03 Thread Robert Haas
On Fri, Aug 29, 2014 at 1:26 PM, Andres Freund and...@2ndquadrant.com wrote: We have pg_get_serial_sequence() mapping (relation, colum) to the sequence. What I'm missing right now is the inverse. I.e. given a sequence tell me the owner. describe.c has a query for that, and it's not too hard to

Re: [HACKERS] PL/pgSQL 2

2014-09-03 Thread Joel Jacobson
On Wed, Sep 3, 2014 at 3:17 PM, Joshua D. Drake j...@commandprompt.com wrote: Well, I don't think PostgreSQL needs its own PL. I mean we already have several (what other database has pl/javascript or pl/python?) PostgreSQL already *have* it's own PL, it's called PL/pgSQL. Besides, the idea of

Re: [HACKERS] Misleading error message in logical decoding for binary plugins

2014-09-03 Thread Robert Haas
On Fri, Aug 29, 2014 at 9:48 AM, Andres Freund and...@2ndquadrant.com wrote: On 2014-08-29 22:42:46 +0900, Michael Paquier wrote: Hi all, Using a plugin producing binary output, I came across this error: =# select data from pg_logical_slot_peek_changes('foo', NULL, NULL); ERROR: 0A000:

Re: [HACKERS] [v9.5] Custom Plan API

2014-09-03 Thread Robert Haas
On Sun, Aug 31, 2014 at 12:54 AM, Kohei KaiGai kai...@kaigai.gr.jp wrote: 2014-08-29 13:33 GMT-04:00 Robert Haas robertmh...@gmail.com: On Wed, Aug 27, 2014 at 6:51 PM, Kouhei Kaigai kai...@ak.jp.nec.com wrote: I'd like to follow this direction, and start stripping the DDL support. ...please

Re: [HACKERS] psql \watch versus \timing

2014-09-03 Thread Greg Stark
On Wed, Sep 3, 2014 at 12:48 PM, Michael Paquier michael.paqu...@gmail.com wrote: OK, then as all the comments are basically addressed, here is an updated patch correcting the comment problems mentioned by Heikki. I just tried this and found it doesn't cooperate well with AUTOCOMMIT = 'off' and

Re: [HACKERS] Enable WAL archiving even in standby

2014-09-03 Thread Alexey Klyukin
On Wed, Aug 13, 2014 at 12:42 PM, Fujii Masao masao.fu...@gmail.com wrote: Hi, I'd propose the attached WIP patch which allows us to enable WAL archiving even in standby. ... I think that this feature is useful for the case, e.g., where large database needs to be replicated between remote

Re: [HACKERS] psql \watch versus \timing

2014-09-03 Thread Fujii Masao
On Wed, Sep 3, 2014 at 10:56 PM, Greg Stark st...@mit.edu wrote: On Wed, Sep 3, 2014 at 12:48 PM, Michael Paquier michael.paqu...@gmail.com wrote: OK, then as all the comments are basically addressed, here is an updated patch correcting the comment problems mentioned by Heikki. Thanks a lot!

Re: [HACKERS] RLS Design

2014-09-03 Thread Robert Haas
On Fri, Aug 29, 2014 at 8:16 PM, Brightwell, Adam adam.brightw...@crunchydatasolutions.com wrote: Attached is a patch for RLS that was create against master at 01363beae52700c7425cb2d2452177133dad3e93 and is ready for review. Overview: This patch provides the capability to create multiple

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

2014-09-03 Thread Robert Haas
On Mon, Sep 1, 2014 at 5:08 AM, Joel Jacobson j...@trustly.com wrote: 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

Re: [HACKERS] RLS Design

2014-09-03 Thread Stephen Frost
Hey Robert, On my phone at the moment but wanted to reply. I'm working through a few of these issues already actually (noticed as I've been going over it with Adam), but certainly appreciate the additional review. We've not posted another update quite yet but plan to shortly. Thanks! Stephen

Re: [HACKERS] PL/pgSQL 2

2014-09-03 Thread Jan Wieck
On 09/03/2014 03:14 AM, Joel Jacobson wrote: I'm in favour of Tom's idea. To merely make the plpgsql2 language a way of explicitly saying you want a specific exact combination of features/beaviour/settings which we can implemented in plpgsql's existing codebase. Since it was about 100 posts

Re: [HACKERS] Scaling shared buffer eviction

2014-09-03 Thread Robert Haas
On Wed, Sep 3, 2014 at 7:27 AM, Amit Kapila amit.kapil...@gmail.com wrote: +Background Reclaimer's Processing +- I suggest titling this section Background Reclaim. I don't mind changing it, but currently used title is based on similar title Background

Re: [HACKERS] Audit of logout

2014-09-03 Thread Fujii Masao
On Thu, Aug 28, 2014 at 11:23 PM, Amit Kapila amit.kapil...@gmail.com wrote: On Wed, Aug 27, 2014 at 5:19 PM, Fujii Masao masao.fu...@gmail.com wrote: On Sat, Aug 23, 2014 at 3:44 PM, Amit Kapila amit.kapil...@gmail.com wrote: On Tue, Aug 5, 2014 at 8:04 PM, Fujii Masao masao.fu...@gmail.com

Re: [HACKERS] RLS Design

2014-09-03 Thread Stephen Frost
Robert, Alright, I can't help it so I'll try and reply from my phone for a couple of these. :) On Wednesday, September 3, 2014, Robert Haas robertmh...@gmail.com wrote: On Fri, Aug 29, 2014 at 8:16 PM, Brightwell, Adam adam.brightw...@crunchydatasolutions.com javascript:; wrote: Attached is

Re: [HACKERS] pg_receivexlog and replication slots

2014-09-03 Thread Robert Haas
On Sun, Aug 31, 2014 at 9:45 AM, Magnus Hagander mag...@hagander.net wrote: Do we really want those Asserts? There is not a single Assert in bin/pg_basebackup today - as is the case for most things in bin/. We typically use regular if statements for things that can happen, and just ignore the

Re: [HACKERS] Inverse of pg_get_serial_sequence?

2014-09-03 Thread Andres Freund
On 2014-09-03 09:31:50 -0400, Robert Haas wrote: On Fri, Aug 29, 2014 at 1:26 PM, Andres Freund and...@2ndquadrant.com wrote: We have pg_get_serial_sequence() mapping (relation, colum) to the sequence. What I'm missing right now is the inverse. I.e. given a sequence tell me the owner.

Re: [HACKERS] Misleading error message in logical decoding for binary plugins

2014-09-03 Thread Andres Freund
On 2014-09-03 09:36:32 -0400, Robert Haas wrote: On Fri, Aug 29, 2014 at 9:48 AM, Andres Freund and...@2ndquadrant.com wrote: On 2014-08-29 22:42:46 +0900, Michael Paquier wrote: Hi all, Using a plugin producing binary output, I came across this error: =# select data from

Re: [HACKERS] LIMIT for UPDATE and DELETE

2014-09-03 Thread Robert Haas
On Mon, Sep 1, 2014 at 8:06 AM, Marko Tiikkaja ma...@joh.to wrote: Ideally? Yeah, that would be great. But I don't see anyone volunteering to do that work, and I think holding back a useful feature (ORDER BY with UPDATE/DELETE) in hopes of getting someone to volunteer to do it is insane.

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

2014-09-03 Thread Robert Haas
On Mon, Sep 1, 2014 at 5:30 AM, Andres Freund and...@2ndquadrant.com wrote: Hi, 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

Re: [HACKERS] Misleading error message in logical decoding for binary plugins

2014-09-03 Thread Robert Haas
On Wed, Sep 3, 2014 at 10:45 AM, Andres Freund and...@2ndquadrant.com wrote: On 2014-09-03 09:36:32 -0400, Robert Haas wrote: On Fri, Aug 29, 2014 at 9:48 AM, Andres Freund and...@2ndquadrant.com wrote: On 2014-08-29 22:42:46 +0900, Michael Paquier wrote: Hi all, Using a plugin

Re: [HACKERS] Inverse of pg_get_serial_sequence?

2014-09-03 Thread Robert Haas
On Wed, Sep 3, 2014 at 10:44 AM, Andres Freund and...@2ndquadrant.com wrote: On 2014-09-03 09:31:50 -0400, Robert Haas wrote: On Fri, Aug 29, 2014 at 1:26 PM, Andres Freund and...@2ndquadrant.com wrote: We have pg_get_serial_sequence() mapping (relation, colum) to the sequence. What I'm

Re: [HACKERS] PL/pgSQL 2

2014-09-03 Thread Bruce Momjian
On Tue, Sep 2, 2014 at 08:46:36PM -0400, Christopher Browne wrote: 3.  Is there anything to be learned from Tutorial D?  That is, Date Darwen's would-be alternative to SQL of their Third Manifesto? What would a set-oriented-language PL look like, such as APL? I guess Perl has arrays, so it

Re: [HACKERS] LIMIT for UPDATE and DELETE

2014-09-03 Thread Marko Tiikkaja
On 9/3/14 4:46 PM, Robert Haas wrote: Making it suck more because you don't think it's as important as your feature is, in my opinion, not cool. I really can't see how that would make inheritance suck *more*. You can't do UPDATE .. ORDER BY now, and you wouldn't be able to do it after the

Re: [HACKERS] Misleading error message in logical decoding for binary plugins

2014-09-03 Thread Andres Freund
On 2014-09-03 10:59:17 -0400, Robert Haas wrote: On Wed, Sep 3, 2014 at 10:45 AM, Andres Freund and...@2ndquadrant.com wrote: On 2014-09-03 09:36:32 -0400, Robert Haas wrote: On Fri, Aug 29, 2014 at 9:48 AM, Andres Freund and...@2ndquadrant.com wrote: On 2014-08-29 22:42:46 +0900,

Re: [HACKERS] PL/pgSQL 2

2014-09-03 Thread Bruce Momjian
On Wed, Sep 3, 2014 at 07:54:09AM +0200, Pavel Stehule wrote: I am not against to improve a PL/pgSQL. And I repeat, what can be done and can be done early: a) ASSERT clause -- with some other modification to allow better static analyze of DML statements, and enforces checks in runtime.

Re: [HACKERS] PL/pgSQL 2

2014-09-03 Thread Marko Tiikkaja
On 9/3/14 5:05 PM, Bruce Momjian wrote: On Wed, Sep 3, 2014 at 07:54:09AM +0200, Pavel Stehule wrote: I am not against to improve a PL/pgSQL. And I repeat, what can be done and can be done early: a) ASSERT clause -- with some other modification to allow better static analyze of DML

Re: [HACKERS] PL/pgSQL 2

2014-09-03 Thread Pavel Stehule
2014-09-03 17:05 GMT+02:00 Bruce Momjian br...@momjian.us: On Wed, Sep 3, 2014 at 07:54:09AM +0200, Pavel Stehule wrote: I am not against to improve a PL/pgSQL. And I repeat, what can be done and can be done early: a) ASSERT clause -- with some other modification to allow better static

Re: [HACKERS] RLS Design

2014-09-03 Thread Robert Haas
On Wed, Sep 3, 2014 at 10:40 AM, Stephen Frost sfr...@snowman.net wrote: This is not a full review of this patch; as we're mid-CommitFest, I assume this will get added to the next CommitFest. As per usual, the expectation is that the patch is reviewed and updated during the commitfest. Given

Re: [HACKERS] Misleading error message in logical decoding for binary plugins

2014-09-03 Thread Robert Haas
On Wed, Sep 3, 2014 at 11:06 AM, Andres Freund and...@2ndquadrant.com wrote: Maybe: ERROR: pg_logical_slot_peek_changes cannot be used with a plugin that produces only binary output HINT: Use pg_logical_slot_peek_binary_changes instead. That level has no knowledge of what it's used

Re: [HACKERS] LIMIT for UPDATE and DELETE

2014-09-03 Thread Robert Haas
On Wed, Sep 3, 2014 at 11:02 AM, Marko Tiikkaja ma...@joh.to wrote: On 9/3/14 4:46 PM, Robert Haas wrote: Making it suck more because you don't think it's as important as your feature is, in my opinion, not cool. I really can't see how that would make inheritance suck *more*. You can't do

Re: [HACKERS] Misleading error message in logical decoding for binary plugins

2014-09-03 Thread Andres Freund
On 2014-09-03 11:23:21 -0400, Robert Haas wrote: On Wed, Sep 3, 2014 at 11:06 AM, Andres Freund and...@2ndquadrant.com wrote: Maybe: ERROR: pg_logical_slot_peek_changes cannot be used with a plugin that produces only binary output HINT: Use pg_logical_slot_peek_binary_changes

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

2014-09-03 Thread Bruce Momjian
On Mon, Sep 1, 2014 at 04:40:11PM -0400, Bruce Momjian wrote: On Mon, Sep 1, 2014 at 04:06:58PM -0400, Tom Lane wrote: Bruce Momjian br...@momjian.us writes: NOTICE: moving and merging column c with inherited definition DETAIL: user-specified column moved to the location of the

Re: [HACKERS] INSERT ... ON CONFLICT {UPDATE | IGNORE}

2014-09-03 Thread Robert Haas
On Wed, Aug 27, 2014 at 10:43 PM, Peter Geoghegan p...@heroku.com wrote: Example usage: INSERT INTO upsert(key, val) VALUES(1, 'insert') ON CONFLICT UPDATE SET val = 'update'; I think that syntax is a dramatic improvement over your previous proposals. The only part I don't entire like is

Re: [HACKERS] Immediate standby promotion

2014-09-03 Thread Robert Haas
On Mon, Sep 1, 2014 at 7:14 AM, Fujii Masao masao.fu...@gmail.com wrote: I think there is one downside as well for this proposal that apart from data loss, it can lead to uncommitted data occupying space in database which needs to be later cleaned by vacuum. This can happen with non-immediate

Re: [HACKERS] pgcrypto: PGP armor headers

2014-09-03 Thread Jeff Janes
On Fri, Aug 15, 2014 at 1:55 AM, Marko Tiikkaja ma...@joh.to wrote: Hi, On 8/8/14 3:18 PM, I wrote: Currently there's no way to generate or extract armor headers from the PGP armored format in pgcrypto. I've written a patch to add the support. Latest version of the patch here, having

Re: [HACKERS] PL/pgSQL 2

2014-09-03 Thread Álvaro Hernández Tortosa
On 03/09/14 15:24, Joshua D. Drake wrote: On 09/02/2014 04:01 PM, Álvaro Hernández Tortosa wrote: It's not copying. It's easying a path for others to migrate and come to Postgres. I'm interested why you are more interested in MSSQL. My reasons for being interested in Oracle are:

Re: [HACKERS] INSERT ... ON CONFLICT {UPDATE | IGNORE}

2014-09-03 Thread Peter Geoghegan
On Wed, Sep 3, 2014 at 9:51 AM, Robert Haas robertmh...@gmail.com wrote: Essentially, the implementation has all stages of query processing During the execution of the parent ModifyTable, a special auxiliary subquery (the UPDATE ModifyTable) is considered as a special case. This is not a

Re: [HACKERS] PL/pgSQL 2

2014-09-03 Thread Robert Haas
On Tue, Sep 2, 2014 at 5:47 PM, Álvaro Hernández Tortosa a...@nosys.es wrote: Yeah, we differ there. I think having an Oracle compatibility layer in PostgreSQL would be the-next-big-thing we could have. Oracle is has orders of magnitude bigger user base than postgres has; and having the

Re: [HACKERS] PL/pgSQL 2

2014-09-03 Thread David G Johnston
This is more of an SQL request the pl/pgsql but is/has there been thought to adding the ternary if/then opeator? Something like: boolean_exp ? val_if_true : val_if_false using ? by itself would be OK but not ideal - and the addition of the doesn't seem hateful... Sorry if this is deemed

Re: [HACKERS] PL/pgSQL 2

2014-09-03 Thread Pavel Stehule
2014-09-03 21:01 GMT+02:00 David G Johnston david.g.johns...@gmail.com: This is more of an SQL request the pl/pgsql but is/has there been thought to adding the ternary if/then opeator? Something like: boolean_exp ? val_if_true : val_if_false using ? by itself would be OK but not ideal -

[HACKERS] xslt_process deprecated?

2014-09-03 Thread Mark
Hi, I'd like to use the xslt_process function but it is in part of the documentation that is deprecated. I don't want to use something that is going to disappear and if there is a better alternative I'd like to use it, however I cannot find an equivalent in the documentation. I could well

Re: [HACKERS] pgcrypto: PGP signatures

2014-09-03 Thread Jeff Janes
On Fri, Aug 15, 2014 at 12:55 AM, Marko Tiikkaja ma...@joh.to wrote: Hi, On 8/7/14 12:15 PM, I wrote: Here's v2 of the patch. I've changed the info-extracting code to not look for signatures beyond the data, which also meant that it had to parse one-pass signatures (which it didn't do

Re: [HACKERS] pgcrypto: PGP signatures

2014-09-03 Thread Marko Tiikkaja
On 2014-09-03 9:36 PM, Jeff Janes wrote: I wanted to start simple so I have a file which is signed, but not encrypted. I can't figure out what to do with it. All of the functions seem to require that it also be encrypted. I tried providing an empty password for pgp_sym_signatures but it

Re: [HACKERS] On partitioning

2014-09-03 Thread Robert Haas
On Tue, Sep 2, 2014 at 4:18 PM, Martijn van Oosterhout klep...@svana.org wrote: On Tue, Sep 02, 2014 at 09:44:17AM -0400, Bruce Momjian wrote: On Sun, Aug 31, 2014 at 10:45:29PM +0200, Martijn van Oosterhout wrote: There is one situation where you need to be more flexible, and that is if you

Re: [HACKERS] delta relations in AFTER triggers

2014-09-03 Thread Kevin Grittner
Marti Raudsepp ma...@juffo.org wrote: On Mon, Sep 1, 2014 at 9:09 PM, Tom Lane t...@sss.pgh.pa.us wrote: The concept of lightweight relations that pop into existence when a certain kind of trigger definition is used somewhere in the function stack, without a CREATE TABLE, without being

Re: [HACKERS] Display of timestamp in pg_dump custom format

2014-09-03 Thread Bruce Momjian
On Thu, May 1, 2014 at 12:09:34PM -0400, Bruce Momjian wrote: On Thu, May 1, 2014 at 12:33:51PM +1200, Gavin Flower wrote: On 01/05/14 12:04, Bruce Momjian wrote: On Thu, May 1, 2014 at 08:27:49AM +1200, Gavin Flower wrote: On 01/05/14 02:51, Bruce Momjian wrote: The table of contents

Re: [HACKERS] delta relations in AFTER triggers

2014-09-03 Thread Kevin Grittner
Kevin Grittner kgri...@ymail.com wrote: Marti Raudsepp ma...@juffo.org wrote: What are the interactions with search_path? Pretty much the same as the interactions of RTEs with search_path. If the apparent relation name is not schema-qualified, parse analysis first tries to resolve the

Re: [HACKERS] pgcrypto: PGP signatures

2014-09-03 Thread Jeff Janes
On Wed, Sep 3, 2014 at 12:43 PM, Marko Tiikkaja ma...@joh.to wrote: On 2014-09-03 9:36 PM, Jeff Janes wrote: I wanted to start simple so I have a file which is signed, but not encrypted. I can't figure out what to do with it. All of the functions seem to require that it also be encrypted.

Re: [HACKERS] delta relations in AFTER triggers

2014-09-03 Thread Marti Raudsepp
On Wed, Sep 3, 2014 at 10:49 PM, Kevin Grittner kgri...@ymail.com wrote: Marti Raudsepp ma...@juffo.org wrote: The concept of lightweight relations that pop into existence when a certain kind of trigger definition is used somewhere in the function stack, without a CREATE TABLE, without being

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

2014-09-03 Thread Stepan Rutz
Hello again, just my thoughts… in psql \s without a file is nice for me iff going through less (e.g. pager), but for the most part it doesn't work at all on mac-osx. so nothing to lose for the mac psql users. regards, stepan Am 03.09.2014 um 07:45 schrieb Noah Misch n...@leadboat.com: On

Re: [HACKERS] postgresql latency bgwriter not doing its job

2014-09-03 Thread Robert Haas
On Sat, Aug 30, 2014 at 2:04 PM, Andres Freund and...@2ndquadrant.com wrote: If the sort buffer is allocated when the checkpointer is started, not everytime we sort, as you've done in your version of the patch I think that risk is pretty manageable. If we really want to be sure nothing is

Re: [HACKERS] COPY and heap_sync

2014-09-03 Thread Robert Haas
On Sat, Aug 30, 2014 at 2:26 AM, Jeff Janes jeff.ja...@gmail.com wrote: If you insert tuples with COPY into a table created or truncated in the same transaction, at the end of the COPY it calls heap_sync. But there cases were people use COPY in a loop with a small amount of data in each

Re: [HACKERS] INSERT ... ON CONFLICT {UPDATE | IGNORE}

2014-09-03 Thread Peter Geoghegan
On Wed, Sep 3, 2014 at 9:51 AM, Robert Haas robertmh...@gmail.com wrote: INSERT INTO upsert(key, val) VALUES(1, 'insert') ON CONFLICT WITHIN upsert_pkey UPDATE SET val = 'update'; It seems to me that it would be better to specify a conflicting column set rather than a conflicting index name.

Re: [HACKERS] pgcrypto: PGP signatures

2014-09-03 Thread Marko Tiikkaja
On 2014-09-03 10:33 PM, Jeff Janes wrote: On Wed, Sep 3, 2014 at 12:43 PM, Marko Tiikkaja ma...@joh.to wrote: Right. This patch only adds support for signing data when encrypting it at the same time. There's no support for detached signatures, nor is there support for anything other than

Re: [HACKERS] delta relations in AFTER triggers

2014-09-03 Thread Kevin Grittner
Marti Raudsepp ma...@juffo.org wrote: On Wed, Sep 3, 2014 at 10:49 PM, Kevin Grittner kgri...@ymail.com wrote: Marti Raudsepp ma...@juffo.org wrote: The concept of lightweight relations that pop into existence when a certain kind of trigger definition is used somewhere in the function stack,

Re: [HACKERS] Need Multixact Freezing Docs

2014-09-03 Thread Robert Haas
On Tue, Sep 2, 2014 at 8:18 PM, Bruce Momjian br...@momjian.us wrote: On Thu, Aug 28, 2014 at 09:32:17AM -0700, Josh Berkus wrote: On 08/28/2014 09:09 AM, Alvaro Herrera wrote: Josh Berkus wrote: On 04/16/2014 01:30 PM, Alvaro Herrera wrote: Josh Berkus wrote: You can see the current

Re: [HACKERS] B-Tree support function number 3 (strxfrm() optimization)

2014-09-03 Thread Robert Haas
On Tue, Sep 2, 2014 at 4:41 PM, Peter Geoghegan p...@heroku.com wrote: HyperLogLog isn't sample-based - it's useful for streaming a set and accurately tracking its cardinality with fixed overhead. OK. Is it the right decision to suppress the abbreviated-key optimization unconditionally on

Re: [HACKERS] PL/pgSQL 1.2

2014-09-03 Thread Hannu Krosing
On 09/03/2014 05:09 PM, Marko Tiikkaja wrote: On 9/3/14 5:05 PM, Bruce Momjian wrote: On Wed, Sep 3, 2014 at 07:54:09AM +0200, Pavel Stehule wrote: I am not against to improve a PL/pgSQL. And I repeat, what can be done and can be done early: a) ASSERT clause -- with some other modification

Re: [HACKERS] B-Tree support function number 3 (strxfrm() optimization)

2014-09-03 Thread Robert Haas
On Tue, Sep 2, 2014 at 7:51 PM, Peter Geoghegan p...@heroku.com wrote: On Tue, Sep 2, 2014 at 12:22 PM, Robert Haas robertmh...@gmail.com wrote: Maybe we should get rid of the tiebreak case altogether: the second SortSupport object is just containing all the same values as the first one, with

Re: [HACKERS] postgresql latency bgwriter not doing its job

2014-09-03 Thread Andres Freund
On 2014-09-03 17:08:12 -0400, Robert Haas wrote: On Sat, Aug 30, 2014 at 2:04 PM, Andres Freund and...@2ndquadrant.com wrote: If the sort buffer is allocated when the checkpointer is started, not everytime we sort, as you've done in your version of the patch I think that risk is pretty

Re: [HACKERS] PL/pgSQL 1.2

2014-09-03 Thread Kevin Grittner
Hannu Krosing ha...@2ndquadrant.com wrote: [suggested syntax] Interesting. The only one that really offends me is: SELECT * FROM `tablename` WHERE `idcolumn` = idvalue; I think that should be: SELECT * FROM `tablename` WHERE `idcolumn` = idvalue; i.e., I think the backticks belong on the

Re: [HACKERS] B-Tree support function number 3 (strxfrm() optimization)

2014-09-03 Thread Peter Geoghegan
On Wed, Sep 3, 2014 at 2:18 PM, Robert Haas robertmh...@gmail.com wrote: My suggestion is to remove the special cases for Darwin and 32-bit systems and see how it goes. I guess it should still be a configure option, then. Or maybe there should just be a USE_ABBREV_KEYS macro within

Re: [HACKERS] PL/pgSQL 1.2

2014-09-03 Thread Marko Tiikkaja
On 2014-09-03 23:19, Hannu Krosing wrote: 1. Conditions for number of rows returned by SELECT or touched by UPDATE or DELETE - Enforcing number of rows returned/affected could be done using

Re: [HACKERS] PQputCopyEnd doesn't adhere to its API contract

2014-09-03 Thread Bruce Momjian
On Fri, May 9, 2014 at 12:03:36PM -0400, Robert Haas wrote: On Thu, May 8, 2014 at 5:21 PM, Tom Lane t...@sss.pgh.pa.us wrote: Perhaps the text should be like this: The result is 1 if the termination message was sent; or in nonblocking mode, this may only indicate that the termination

Re: [HACKERS] 9.5: Memory-bounded HashAgg

2014-09-03 Thread Tomas Vondra
On 4.9.2014 00:42, Tomas Vondra wrote: Attached are two CSV files contain both raw results (4 runs per query), and aggregated results (average of the runs), logs with complete logs and explain (analyze) plans of the queries for inspection. Of course, I forgot to attach the CSV files ... here

Re: [HACKERS] PL/pgSQL 2

2014-09-03 Thread Joshua D. Drake
On 09/03/2014 11:48 AM, Robert Haas wrote: Anyway, to get back around to the topic of PL/SQL compatibility specifically, if you care about that issue, pick one thing that exists in PL/SQL but not in PL/pgsql and try to do something about it. Maybe it'll be something that EnterpiseDB has

Re: [HACKERS] Pg_upgrade and toast tables bug discovered

2014-09-03 Thread Noah Yetter
I'm not sure it's fixed. I am attempting a pg_upgrade from 9.2.8 to 9.3.5 and it dies like so: (...many relations restoring successfully snipped...) pg_restore: creating SEQUENCE address_address_id_seq pg_restore: [archiver (db)] Error while PROCESSING TOC: pg_restore: [archiver (db)] Error from

Re: [HACKERS] 9.5: Memory-bounded HashAgg

2014-09-03 Thread Tomas Vondra
On 20.8.2014 20:32, Robert Haas wrote: On Sun, Aug 17, 2014 at 1:17 PM, Tomas Vondra t...@fuzzy.cz wrote: Being able to batch inner and outer relations in a matching way is certainly one of the reasons why hashjoin uses that particular scheme. There are other reasons, though - for example

Re: [HACKERS] 9.5: Memory-bounded HashAgg

2014-09-03 Thread Tomas Vondra
On 4.9.2014 01:34, Tomas Vondra wrote: On 20.8.2014 20:32, Robert Haas wrote: As I see it, the advantage of Jeff's approach is that it doesn't really matter whether our estimates are accurate or not. We don't have to decide at the beginning how many batches to do, and then possibly end up

Re: [HACKERS] Pg_upgrade and toast tables bug discovered

2014-09-03 Thread David G Johnston
Based upon the dates the noted patch is not in 9.3.5; which was released a couple of weeks previous to it being committed. David J. nyetter wrote I'm not sure it's fixed. I am attempting a pg_upgrade from 9.2.8 to 9.3.5 and it dies like so: (...many relations restoring successfully

Re: [HACKERS] Display of timestamp in pg_dump custom format

2014-09-03 Thread Gavin Flower
On 04/09/14 08:13, Bruce Momjian wrote: On Thu, May 1, 2014 at 12:09:34PM -0400, Bruce Momjian wrote: On Thu, May 1, 2014 at 12:33:51PM +1200, Gavin Flower wrote: On 01/05/14 12:04, Bruce Momjian wrote: On Thu, May 1, 2014 at 08:27:49AM +1200, Gavin Flower wrote: On 01/05/14 02:51, Bruce

Re: [HACKERS] Pg_upgrade and toast tables bug discovered

2014-09-03 Thread Bruce Momjian
On Wed, Sep 3, 2014 at 05:12:30PM -0600, Noah Yetter wrote: I'm not sure it's fixed.  I am attempting a pg_upgrade from 9.2.8 to 9.3.5 and it dies like so: (...many relations restoring successfully snipped...) pg_restore: creating SEQUENCE address_address_id_seq pg_restore: [archiver (db)]

Re: [HACKERS] PL/pgSQL 1.2

2014-09-03 Thread Hannu Krosing
On 09/04/2014 12:17 AM, Marko Tiikkaja wrote: On 2014-09-03 23:19, Hannu Krosing wrote: 1. Conditions for number of rows returned by SELECT or touched by UPDATE or DELETE - Enforcing

Re: [HACKERS] B-tree descend for insertion locking

2014-09-03 Thread Peter Geoghegan
On Tue, Mar 18, 2014 at 4:12 AM, Heikki Linnakangas hlinnakan...@vmware.com wrote: When inserting into a B-tree index, all the pages are read-locked when descending the tree. When we reach the leaf page, the read-lock is exchanged for a write-lock. There's nothing wrong with that, but why

Re: [HACKERS] Display of timestamp in pg_dump custom format

2014-09-03 Thread Bruce Momjian
On Thu, Sep 4, 2014 at 12:02:19PM +1200, Gavin Flower wrote: I would prefer the date in a sane numeric format to the left of the time (similar to what I suggested above), easier to sort (if a sort is required) - it is also easier to use regular expressions to select statement in an arbitrary

Re: [HACKERS] WAL format and API changes (9.5)

2014-09-03 Thread Michael Paquier
On Tue, Sep 2, 2014 at 9:23 PM, Heikki Linnakangas hlinnakan...@vmware.com wrote: I committed the redo-routine refactoring patch. I kept the XLog prefix in the XLogReadBufferForRedo name; it's redundant, but all the other similar functions in xlogutils.c use the XLog prefix so it would seem

Re: [HACKERS] WAL format and API changes (9.5)

2014-09-03 Thread Michael Paquier
On Tue, Sep 2, 2014 at 9:23 PM, Heikki Linnakangas hlinnakan...@vmware.com wrote: I committed the redo-routine refactoring patch. I kept the XLog prefix in the XLogReadBufferForRedo name; it's redundant, but all the other similar functions in xlogutils.c use the XLog prefix so it would seem

  1   2   >