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

2014-09-04 Thread Pavel Stehule
I am sory too much patches Regards Pavel 2014-09-04 7:35 GMT+02:00 Jeevan Chalke jeevan.cha...@enterprisedb.com: Hi Pavel, You have attached wrong patch. Thanks -- Jeevan B Chalke Principal Software Engineer, Product Development EnterpriseDB Corporation The Enterprise PostgreSQL

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

2014-09-04 Thread David G Johnston
On Wed, Sep 3, 2014 at 6:25 PM, Bruce Momjian [via PostgreSQL] ml-node+s1045698n5817646...@n5.nabble.com wrote: On Fri, May 9, 2014 at 12:03:36PM -0400, Robert Haas wrote: On Thu, May 8, 2014 at 5:21 PM, Tom Lane [hidden email] http://user/SendEmail.jtp?type=nodenode=5817646i=0 wrote:

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

2014-09-04 Thread Ants Aasma
On Sat, Aug 30, 2014 at 8:50 PM, Tom Lane t...@sss.pgh.pa.us wrote: Andres Freund and...@2ndquadrant.com writes: On 2014-08-27 19:23:04 +0300, Heikki Linnakangas wrote: A long time ago, Itagaki Takahiro wrote a patch sort the buffers and write them out in order

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

2014-09-04 Thread Ants Aasma
On Thu, Sep 4, 2014 at 12:36 AM, Andres Freund and...@2ndquadrant.com wrote: It's imo quite clearly better to keep it allocated. For one after postmaster started the checkpointer successfully you don't need to be worried about later failures to allocate memory if you allocate it once (unless

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

2014-09-04 Thread Pavel Stehule
Hi here is a second variant with support --help=variables Regards Pavel 2014-09-04 4:25 GMT+02:00 Robert Haas robertmh...@gmail.com: On Thu, Aug 28, 2014 at 11:20 AM, Andres Freund and...@2ndquadrant.com wrote: * How about making it --help=variables instead of --help-variables? -1,

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

2014-09-04 Thread Alexey Klyukin
On Wed, Sep 3, 2014 at 11:50 AM, Heikki Linnakangas hlinnakan...@vmware.com wrote: * It's ugly that the caller does the malloc and memcpy, and the certificate_name_entry_validate_match function then modifies its name argument. Move the malloc+memcpy inside the function. For the case of CN the

Re: [HACKERS] PL/pgSQL 1.2

2014-09-04 Thread Joel Jacobson
On Wed, Sep 3, 2014 at 11:19 PM, Hannu Krosing ha...@2ndquadrant.com wrote: SELECT[1] - select exactly one row, anything else raises error SELECT[0:1] - select zero or one rows, anything else raises error SELECT[1:] - select one or more rows plain SELECT is equivalent to SELECT[0:] same

Re: [HACKERS] PL/pgSQL 1.2

2014-09-04 Thread Pavel Stehule
2014-09-04 9:37 GMT+02:00 Joel Jacobson j...@trustly.com: On Wed, Sep 3, 2014 at 11:19 PM, Hannu Krosing ha...@2ndquadrant.com wrote: SELECT[1] - select exactly one row, anything else raises error SELECT[0:1] - select zero or one rows, anything else raises error SELECT[1:] - select

Re: [HACKERS] PL/pgSQL 1.2

2014-09-04 Thread Joel Jacobson
On Thu, Sep 4, 2014 at 9:39 AM, Pavel Stehule pavel.steh...@gmail.com wrote: we have totally different opinion what is good Can you elaborate on that? Your ASSERT CHECK ROWCOUNT = 1; is lengthly, which is why I don't like it. Imagine if having to type my $var === 'foo';

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

2014-09-04 Thread Heikki Linnakangas
On 09/04/2014 10:33 AM, Alexey Klyukin wrote: On Wed, Sep 3, 2014 at 11:50 AM, Heikki Linnakangas hlinnakan...@vmware.com wrote: * It's ugly that the caller does the malloc and memcpy, and the certificate_name_entry_validate_match function then modifies its name argument. Move the

Re: [HACKERS] PL/pgSQL 1.2

2014-09-04 Thread Marko Tiikkaja
On 9/4/14 2:10 AM, Hannu Krosing wrote: On 09/04/2014 12:17 AM, Marko Tiikkaja wrote: I'm not sure how much I like that syntax in cases like: WITH t AS ( -- multi-line query here ) SELECT[0:] foo, bar INTO _bat, _man FROM foo JOIN .. JOIN .. WHERE .. -- etc. It

Re: [HACKERS] PL/pgSQL 1.2

2014-09-04 Thread Pavel Stehule
2014-09-04 10:06 GMT+02:00 Joel Jacobson j...@trustly.com: On Thu, Sep 4, 2014 at 9:39 AM, Pavel Stehule pavel.steh...@gmail.com wrote: we have totally different opinion what is good Can you elaborate on that? I would to elaborate on enhancing plpgsql - but my primary target is

Re: [HACKERS] PL/pgSQL 1.2

2014-09-04 Thread Marko Tiikkaja
On 9/4/14 10:42 AM, Pavel Stehule wrote: 2014-09-04 10:06 GMT+02:00 Joel Jacobson j...@trustly.com: *) but there are probably equally who prefer to handle business logics outside the database It is maybe main difference between me and you. Usually I don't write CRUD applications, and I am not

Re: [HACKERS] PL/pgSQL 1.2

2014-09-04 Thread Joel Jacobson
On Thu, Sep 4, 2014 at 10:42 AM, Pavel Stehule pavel.steh...@gmail.com wrote: I am strong in opinion so PLpgSQL is targeted primary for implementation business logic in server side. CRUD is only one from possible use cases - and without any special importance to others. Just curious, what

Re: [HACKERS] PL/pgSQL 1.2

2014-09-04 Thread Pavel Stehule
2014-09-04 10:53 GMT+02:00 Marko Tiikkaja ma...@joh.to: On 9/4/14 10:42 AM, Pavel Stehule wrote: 2014-09-04 10:06 GMT+02:00 Joel Jacobson j...@trustly.com: *) but there are probably equally who prefer to handle business logics outside the database It is maybe main difference between me

Re: [HACKERS] PL/pgSQL 1.2

2014-09-04 Thread Pavel Stehule
2014-09-04 10:57 GMT+02:00 Joel Jacobson j...@trustly.com: On Thu, Sep 4, 2014 at 10:42 AM, Pavel Stehule pavel.steh...@gmail.com wrote: I am strong in opinion so PLpgSQL is targeted primary for implementation business logic in server side. CRUD is only one from possible use cases - and

Re: [HACKERS] PL/pgSQL 1.2

2014-09-04 Thread Joel Jacobson
On Thu, Sep 4, 2014 at 11:07 AM, Pavel Stehule pavel.steh...@gmail.com wrote: it is different semantic - returns composite or set of composites --- it is not row or rows The point was, RETURNS returns 1 while RETURNS SETOF returns 0 .. n. Actually BL is usually processed oriented, so PL

Re: [HACKERS] PL/pgSQL 1.2

2014-09-04 Thread Pavel Stehule
2014-09-04 11:22 GMT+02:00 Joel Jacobson j...@trustly.com: On Thu, Sep 4, 2014 at 11:07 AM, Pavel Stehule pavel.steh...@gmail.com wrote: it is different semantic - returns composite or set of composites --- it is not row or rows The point was, RETURNS returns 1 while RETURNS SETOF

Re: [HACKERS] Scaling shared buffer eviction

2014-09-04 Thread Amit Kapila
On Wed, Sep 3, 2014 at 8:03 PM, Robert Haas robertmh...@gmail.com wrote: On Wed, Sep 3, 2014 at 7:27 AM, Amit Kapila amit.kapil...@gmail.com wrote: +while (tmp_num_to_free 0) I am not sure it's a good idea for this value to be fixed at loop start and then just decremented. It is

Re: [HACKERS] PL/pgSQL 1.2

2014-09-04 Thread Marko Tiikkaja
Everyone, I've started a wiki page with the list of the things I could think of at this very moment. I probably got the most annoying ones in there, but I also might have forgotten about some things. I invite discussion of every suggestion on -HACKERS.

Re: [HACKERS] PL/pgSQL 1.2

2014-09-04 Thread Pavel Stehule
2014-09-04 13:37 GMT+02:00 Marko Tiikkaja ma...@joh.to: Everyone, I've started a wiki page with the list of the things I could think of at this very moment. I probably got the most annoying ones in there, but I also might have forgotten about some things. I invite discussion of every

Re: [HACKERS] PL/pgSQL 1.2

2014-09-04 Thread Marko Tiikkaja
On 9/4/14 1:47 PM, Pavel Stehule wrote: 2014-09-04 13:37 GMT+02:00 Marko Tiikkaja ma...@joh.to: I've started a wiki page with the list of the things I could think of at this very moment. I probably got the most annoying ones in there, but I also might have forgotten about some things. I

Re: [HACKERS] Scaling shared buffer eviction

2014-09-04 Thread Amit Kapila
On Wed, Sep 3, 2014 at 9:45 AM, Amit Kapila amit.kapil...@gmail.com wrote: Performance Data: --- Configuration and Db Details IBM POWER-7 16 cores, 64 hardware threads RAM = 64GB Database Locale =C checkpoint_segments=256 checkpoint_timeout=15min

Re: [HACKERS] PL/pgSQL 1.2

2014-09-04 Thread Pavel Stehule
2014-09-04 13:54 GMT+02:00 Marko Tiikkaja ma...@joh.to: On 9/4/14 1:47 PM, Pavel Stehule wrote: 2014-09-04 13:37 GMT+02:00 Marko Tiikkaja ma...@joh.to: I've started a wiki page with the list of the things I could think of at this very moment. I probably got the most annoying ones in

Re: [HACKERS] PL/pgSQL 1.2

2014-09-04 Thread Robert Haas
On Thu, Sep 4, 2014 at 4:06 AM, Joel Jacobson j...@trustly.com wrote: Your ASSERT CHECK ROWCOUNT = 1; is lengthly, which is why I don't like it. Imagine if having to type my $var === 'foo'; instead of my $var = 'foo'; on every single line of could where you want to

Re: [HACKERS] Scaling shared buffer eviction

2014-09-04 Thread Robert Haas
On Thu, Sep 4, 2014 at 7:25 AM, Amit Kapila amit.kapil...@gmail.com wrote: Its not difficult to handle such cases, but it can have downside also for the cases where demand from backends is not high. Consider in above case if instead of 500 more allocations, it just does 5 more allocations,

Re: [HACKERS] Spinlocks and compiler/memory barriers

2014-09-04 Thread Robert Haas
On Tue, Aug 5, 2014 at 11:55 AM, Robert Haas robertmh...@gmail.com wrote: On Sun, Jul 6, 2014 at 3:12 PM, Andres Freund and...@2ndquadrant.com wrote: If you want to do that, it's fine with me. What I would do is: - Back-patch the addition of the sparcv8+ stuff all the way. If anyone's

Re: [HACKERS] Spinlocks and compiler/memory barriers

2014-09-04 Thread Andres Freund
On September 4, 2014 2:18:37 PM CEST, Robert Haas robertmh...@gmail.com wrote: On Tue, Aug 5, 2014 at 11:55 AM, Robert Haas robertmh...@gmail.com wrote: On Sun, Jul 6, 2014 at 3:12 PM, Andres Freund and...@2ndquadrant.com wrote: If you want to do that, it's fine with me. What I would do is:

Re: [HACKERS] PL/pgSQL 1.2

2014-09-04 Thread Marko Tiikkaja
On 9/4/14 2:04 PM, Pavel Stehule wrote: for example best practices for PL/SQL by Steven Feuerstein I'll spend some time with that book to have a better idea on where you're coming from. Also, *please* don't try and extrapolate what I do based on the code examples on the wiki page; they're

Re: [HACKERS] Join push-down support for foreign tables

2014-09-04 Thread Robert Haas
On Wed, Sep 3, 2014 at 5:16 AM, Shigeru Hanada shigeru.han...@gmail.com wrote: 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

Re: [HACKERS] PL/pgSQL 1.2

2014-09-04 Thread Joel Jacobson
On 4 sep 2014, at 11:42, Pavel Stehule pavel.steh...@gmail.com wrote: 2014-09-04 11:22 GMT+02:00 Joel Jacobson j...@trustly.com: The point was, RETURNS returns 1 while RETURNS SETOF returns 0 .. n. no RETURNS return VALUE (it is not a row) .. and in combination with SELECT - value will be a

Re: [HACKERS] xslt_process deprecated?

2014-09-04 Thread Robert Haas
On Wed, Sep 3, 2014 at 6:23 AM, Mark ma...@alienmuppet.co.uk wrote: 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

Re: [HACKERS] PL/pgSQL 1.2

2014-09-04 Thread Pavel Stehule
2014-09-04 14:37 GMT+02:00 Joel Jacobson j...@trustly.com: On 4 sep 2014, at 11:42, Pavel Stehule pavel.steh...@gmail.com wrote: 2014-09-04 11:22 GMT+02:00 Joel Jacobson j...@trustly.com: The point was, RETURNS returns 1 while RETURNS SETOF returns 0 .. n. no RETURNS return VALUE (it is

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

2014-09-04 Thread Robert Haas
On Tue, Sep 2, 2014 at 3:01 PM, Andres Freund and...@2ndquadrant.com wrote: I'm slightly worried about the added overhead due to the latch code. In my implementation I only use latches after a nonblocking read, but still. Every WaitLatchOrSocket() does a drainSelfPipe(). I wonder if that can

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

2014-09-04 Thread Heikki Linnakangas
On 09/04/2014 03:49 PM, Robert Haas wrote: On Tue, Sep 2, 2014 at 3:01 PM, Andres Freund and...@2ndquadrant.com wrote: I'm slightly worried about the added overhead due to the latch code. In my implementation I only use latches after a nonblocking read, but still. Every WaitLatchOrSocket() does

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

2014-09-04 Thread Robert Haas
On Tue, Sep 2, 2014 at 11:02 PM, 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. You're wrong. That list is usually empty right

Re: [HACKERS] PL/pgSQL 2

2014-09-04 Thread Shaun Thomas
On 09/01/2014 04:04 AM, Joel Jacobson wrote: + Make UPDATE/INSERT/DELETE throw error if they didnt' modify exactly 1 row, as that's the most common use-case, and provide alternative syntax to modify multiple or zero rows. What? No. The whole point of SQL is that it's set-based and can modify

Re: [HACKERS] PL/pgSQL 1.2

2014-09-04 Thread Jan Wieck
On 09/04/2014 01:14 AM, Pavel Stehule wrote: 2014-09-03 23:19 GMT+02:00 Hannu Krosing ha...@2ndquadrant.com A more SQL-ish way of doing the same could probably be called COMMAND CONSTRAINTS and look something like this SELECT ... CHECK (ROWCOUNT BETWEEN 0 AND 1); It is

Re: [HACKERS] missing tab-completion for relation options

2014-09-04 Thread Michael Paquier
On Thu, Sep 4, 2014 at 1:53 PM, Fujii Masao masao.fu...@gmail.com wrote: Attached patch adds the missing tab-completion for the relation options like autovacuum_multixact_freeze_max_age. That's a nice catch. Multixact parameters are present since 9.3. user_catalog_table since 9.4. Regards, --

Re: [HACKERS] PL/pgSQL 1.2

2014-09-04 Thread Pavel Stehule
2014-09-04 15:24 GMT+02:00 Jan Wieck j...@wi3ck.info: On 09/04/2014 01:14 AM, Pavel Stehule wrote: 2014-09-03 23:19 GMT+02:00 Hannu Krosing ha...@2ndquadrant.com A more SQL-ish way of doing the same could probably be called COMMAND CONSTRAINTS and look something like this

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

2014-09-04 Thread Robert Haas
On Thu, Sep 4, 2014 at 9:05 AM, Heikki Linnakangas hlinnakan...@vmware.com wrote: Hmm. Perhaps we should call drainSelfPipe() only after poll/select returns saying that there is something in the self-pipe. That would be a win assuming it's more common for the self-pipe to be empty. Couldn't

Re: [HACKERS] PL/pgSQL 1.2

2014-09-04 Thread Jan Wieck
On 09/04/2014 09:31 AM, Pavel Stehule wrote: 2014-09-04 15:24 GMT+02:00 Jan Wieck j...@wi3ck.info I think I like the COMMAND CONSTRAINT the best so far. I not, because when it will not be part of SQL, than parser in plpgsql will be more complex. You have to inject SELECT, UPDATE, INSERT,

Re: [HACKERS] PL/pgSQL 1.2

2014-09-04 Thread Pavel Stehule
2014-09-04 15:38 GMT+02:00 Jan Wieck j...@wi3ck.info: On 09/04/2014 09:31 AM, Pavel Stehule wrote: 2014-09-04 15:24 GMT+02:00 Jan Wieck j...@wi3ck.info I think I like the COMMAND CONSTRAINT the best so far. I not, because when it will not be part of SQL, than parser in plpgsql will

Re: [HACKERS] psql \watch versus \timing

2014-09-04 Thread Michael Paquier
On Thu, Sep 4, 2014 at 1:44 PM, Fujii Masao masao.fu...@gmail.com wrote: On Thu, Aug 28, 2014 at 8:46 PM, Fujii Masao masao.fu...@gmail.com wrote: Good catch. So I will remove start_xact code later. Attached patch removes start_xact from PSQLexec. Nothing negative to say here :) Patch simply

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

2014-09-04 Thread Heikki Linnakangas
On 09/04/2014 04:37 PM, Robert Haas wrote: Hrm. So we'd have to block SIGUSR1, check the flag, then use pselect() to temporarily unblock SIGUSR1 and wait, then on return again unblock SIGUSR1? Doesn't seem very appealing. I think changing the signal mask is fast on Linux, but quite slow on at

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

2014-09-04 Thread Robert Haas
On Wed, Sep 3, 2014 at 12:35 AM, Noah Misch n...@leadboat.com wrote: On Tue, Sep 02, 2014 at 01:56:34AM -0400, Tom Lane wrote: Noah Misch n...@leadboat.com writes: On Mon, Sep 01, 2014 at 10:22:57PM -0400, Tom Lane wrote: Also, as best I can tell, .psql_history files from older libedit

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

2014-09-04 Thread Robert Haas
On Thu, Sep 4, 2014 at 9:53 AM, Heikki Linnakangas hlinnakan...@vmware.com wrote: On 09/04/2014 04:37 PM, Robert Haas wrote: Hrm. So we'd have to block SIGUSR1, check the flag, then use pselect() to temporarily unblock SIGUSR1 and wait, then on return again unblock SIGUSR1? Doesn't seem very

Re: [HACKERS] PL/pgSQL 1.2

2014-09-04 Thread Shaun Thomas
On 09/03/2014 04:19 PM, Hannu Krosing wrote: 1. Conditions for number of rows returned by SELECT or touched by UPDATE or DELETE Now that I think upon this... don't we already have it? SELECT ... LIMIT 1 That already solves the purported problem of multiple results in SELECT INTO as well.

Re: [HACKERS] PL/pgSQL 1.2

2014-09-04 Thread Marko Tiikkaja
On 9/4/14 4:09 PM, Shaun Thomas wrote: On 09/03/2014 04:19 PM, Hannu Krosing wrote: 1. Conditions for number of rows returned by SELECT or touched by UPDATE or DELETE Now that I think upon this... don't we already have it? SELECT ... LIMIT 1 No, that just hides any bugs. We want the

Re: [HACKERS] Scaling shared buffer eviction

2014-09-04 Thread Kevin Grittner
Robert Haas robertmh...@gmail.com wrote: On Thu, Sep 4, 2014 at 7:25 AM, Amit Kapila amit.kapil...@gmail.com wrote: Its not difficult to handle such cases, but it can have downside also for the cases where demand from backends is not high. Consider in above case if instead of 500 more

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

2014-09-04 Thread Michael Paquier
On Wed, Sep 3, 2014 at 11:57 PM, Robert Haas robertmh...@gmail.com wrote: I didn't find that option to be terribly important then, but I don't see how we can possibly get by without it now, unless our goal is to make logical decoding as hard to use as we possibly can. Yes. With 9.4 it is

Re: [HACKERS] PL/pgSQL 1.2

2014-09-04 Thread Hannu Krosing
On 09/04/2014 02:40 PM, Pavel Stehule wrote: 2014-09-04 14:37 GMT+02:00 Joel Jacobson j...@trustly.com mailto:j...@trustly.com: On 4 sep 2014, at 11:42, Pavel Stehule pavel.steh...@gmail.com mailto:pavel.steh...@gmail.com wrote: 2014-09-04 11:22 GMT+02:00 Joel Jacobson

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

2014-09-04 Thread Tom Lane
Noah Misch n...@leadboat.com writes: I tried your patches against libedit-28. Wherever a command contains a newline, unpatched psql writes the three bytes \^A to the history file, and patched psql writes the four bytes \012. Unpatched psql correctly reads either form of the history file.

Re: [HACKERS] Join push-down support for foreign tables

2014-09-04 Thread Bruce Momjian
On Thu, Sep 4, 2014 at 08:37:08AM -0400, Robert Haas wrote: The main problem I see here is that accurate costing may require a round-trip to the remote server. If there is only one path that is probably OK; the cost of asking the question will usually be more than paid for by hearing that

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

2014-09-04 Thread Robert Haas
On Wed, Sep 3, 2014 at 2:13 PM, Peter Geoghegan p...@heroku.com wrote: 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

Re: [HACKERS] PL/pgSQL 2

2014-09-04 Thread Joel Jacobson
On 4 sep 2014, at 15:09, Shaun Thomas stho...@optionshouse.com wrote: On 09/01/2014 04:04 AM, Joel Jacobson wrote: + Make UPDATE/INSERT/DELETE throw error if they didnt' modify exactly 1 row, as that's the most common use-case, and provide alternative syntax to modify multiple or zero rows.

Re: [HACKERS] Scaling shared buffer eviction

2014-09-04 Thread Alvaro Herrera
Robert Haas wrote: 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

Re: [HACKERS] PL/pgSQL 1.2

2014-09-04 Thread Joel Jacobson
On 4 sep 2014, at 15:32, Pavel Stehule pavel.steh...@gmail.com wrote: 2014-09-04 15:24 GMT+02:00 Jan Wieck j...@wi3ck.info: On 09/04/2014 01:14 AM, Pavel Stehule wrote: 2014-09-03 23:19 GMT+02:00 Hannu Krosing ha...@2ndquadrant.com A more SQL-ish way of doing the same could probably

Re: [HACKERS] Join push-down support for foreign tables

2014-09-04 Thread Atri Sharma
On Thursday, September 4, 2014, Bruce Momjian br...@momjian.us wrote: On Thu, Sep 4, 2014 at 08:37:08AM -0400, Robert Haas wrote: The main problem I see here is that accurate costing may require a round-trip to the remote server. If there is only one path that is probably OK; the cost of

Re: [HACKERS] PL/pgSQL 1.2

2014-09-04 Thread Joel Jacobson
On 4 sep 2014, at 16:45, Hannu Krosing ha...@2ndquadrant.com wrote: When looking from the other end of the problem, we are using SELECT/INSERT/UPDATE/DELETE *SET statements* in pl/pgsql when we really want scalars. My understanding is that one main drivers of starting this thread was

Re: [HACKERS] PL/pgSQL 1.2

2014-09-04 Thread Pavel Stehule
2014-09-04 17:16 GMT+02:00 Joel Jacobson j...@trustly.com: On 4 sep 2014, at 16:45, Hannu Krosing ha...@2ndquadrant.com wrote: When looking from the other end of the problem, we are using SELECT/INSERT/UPDATE/DELETE *SET statements* in pl/pgsql when we really want scalars. My

Re: [HACKERS] PL/pgSQL 1.2

2014-09-04 Thread Pavel Stehule
2014-09-04 17:10 GMT+02:00 Joel Jacobson j...@trustly.com: On 4 sep 2014, at 15:32, Pavel Stehule pavel.steh...@gmail.com wrote: 2014-09-04 15:24 GMT+02:00 Jan Wieck j...@wi3ck.info: On 09/04/2014 01:14 AM, Pavel Stehule wrote: 2014-09-03 23:19 GMT+02:00 Hannu Krosing

Re: [HACKERS] PL/pgSQL 1.2

2014-09-04 Thread Joel Jacobson
On 4 sep 2014, at 17:18, Pavel Stehule pavel.steh...@gmail.com wrote: You just need a ISAM API for Postgres, That is all. Now you are being ironic, and I would prefer to keep the discussion on a serious level. You know that's not applicable in my case, you know what I do for work and what kind

Re: [HACKERS] PL/pgSQL 1.2

2014-09-04 Thread Jan Wieck
On 09/04/2014 11:16 AM, Joel Jacobson wrote: On 4 sep 2014, at 16:45, Hannu Krosing ha...@2ndquadrant.com wrote: When looking from the other end of the problem, we are using SELECT/INSERT/UPDATE/DELETE *SET statements* in pl/pgsql when we really want scalars. My understanding is that one main

[HACKERS] .ready files appearing on slaves

2014-09-04 Thread Jehan-Guillaume de Rorthais
Hi hackers, Since few months, we occasionally see .ready files appearing on some slave instances from various context. The two I have in mind are under 9.2.x. I tried to investigate a bit. These .ready files are created when a WAL file from pg_xlog has no corresponding file in

Re: [HACKERS] PL/pgSQL 1.2

2014-09-04 Thread Robert Haas
On Thu, Sep 4, 2014 at 11:32 AM, Joel Jacobson j...@trustly.com wrote: On 4 sep 2014, at 17:18, Pavel Stehule pavel.steh...@gmail.com wrote: You just need a ISAM API for Postgres, That is all. Now you are being ironic, and I would prefer to keep the discussion on a serious level. You know

Re: [HACKERS] PL/pgSQL 2

2014-09-04 Thread Craig Ringer
On 09/04/2014 02:48 AM, Robert Haas wrote: To take another example, I've been complaining about the fact that PostgreSQL 8.3+ requires far more typecasts in stored procedures than any other database I'm aware of for years, probably since before I joined EnterpriseDB. +10 This still drives me

Re: [HACKERS] Join push-down support for foreign tables

2014-09-04 Thread Bruce Momjian
On Thu, Sep 4, 2014 at 08:41:43PM +0530, Atri Sharma wrote: On Thursday, September 4, 2014, Bruce Momjian br...@momjian.us wrote: On Thu, Sep  4, 2014 at 08:37:08AM -0400, Robert Haas wrote: The main problem I see here is that accurate costing may require a round-trip to

Re: [HACKERS] Join push-down support for foreign tables

2014-09-04 Thread Atri Sharma
On Thu, Sep 4, 2014 at 9:26 PM, Bruce Momjian br...@momjian.us wrote: On Thu, Sep 4, 2014 at 08:41:43PM +0530, Atri Sharma wrote: On Thursday, September 4, 2014, Bruce Momjian br...@momjian.us wrote: On Thu, Sep 4, 2014 at 08:37:08AM -0400, Robert Haas wrote: The main

Re: [HACKERS] PL/pgSQL 1.2

2014-09-04 Thread Kevin Grittner
Pavel Stehule pavel.steh...@gmail.com wrote: You just need a ISAM API for Postgres, That is all. Joel sure hasn't *shown* us anything to suggest that wouldn't answer his needs better than any PL, or explained why that wouldn't be a better solution for him. -- Kevin Grittner EDB:

Re: [HACKERS] PL/pgSQL 2

2014-09-04 Thread Marko Tiikkaja
On 9/4/14 5:54 PM, Craig Ringer wrote: On 09/04/2014 02:48 AM, Robert Haas wrote: To take another example, I've been complaining about the fact that PostgreSQL 8.3+ requires far more typecasts in stored procedures than any other database I'm aware of for years, probably since before I joined

Re: [HACKERS] PL/pgSQL 2

2014-09-04 Thread Craig Ringer
On 09/04/2014 06:48 AM, Joshua D. Drake wrote: 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.

Re: [HACKERS] Join push-down support for foreign tables

2014-09-04 Thread Bruce Momjian
On Thu, Sep 4, 2014 at 09:31:20PM +0530, Atri Sharma wrote: I am thinking we would eventually have to cache the statistics, then get some kind of invalidation message from the foreign server.  I am also thinking that cache would have to be global across all backends, I guess

Re: [HACKERS] PL/pgSQL 2

2014-09-04 Thread Pavel Stehule
Hi Craig 2014-09-04 17:54 GMT+02:00 Craig Ringer cr...@2ndquadrant.com: On 09/04/2014 02:48 AM, Robert Haas wrote: To take another example, I've been complaining about the fact that PostgreSQL 8.3+ requires far more typecasts in stored procedures than any other database I'm aware of for

Re: [HACKERS] pgcrypto: PGP signatures

2014-09-04 Thread Joel Jacobson
Marko, et al, This is a review of the pgcrypto PGP signatures patch: http://www.postgresql.org/message-id/53edbcf0.9070...@joh.to There hasn't been any discussion, at least that I've been able to find. Contents Purpose == This patch add functions to create, verify and extract

Re: [HACKERS] Join push-down support for foreign tables

2014-09-04 Thread Atri Sharma
On Thu, Sep 4, 2014 at 9:33 PM, Bruce Momjian br...@momjian.us wrote: On Thu, Sep 4, 2014 at 09:31:20PM +0530, Atri Sharma wrote: I am thinking we would eventually have to cache the statistics, then get some kind of invalidation message from the foreign server. I am also

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

2014-09-04 Thread Robert Haas
On Tue, Sep 2, 2014 at 10:27 PM, Peter Geoghegan p...@heroku.com wrote: * Still doesn't address the open question of whether or not we should optimistically always try memcmp() == 0 on tiebreak. I still lean towards yes. Let m be the cost of a memcmp() that fails near the end of the strings;

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

2014-09-04 Thread Robert Haas
On Wed, Sep 3, 2014 at 5:44 PM, Peter Geoghegan p...@heroku.com wrote: 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.

Re: [HACKERS] PL/pgSQL 1.2

2014-09-04 Thread Pavel Stehule
2014-09-04 18:02 GMT+02:00 Kevin Grittner kgri...@ymail.com: Pavel Stehule pavel.steh...@gmail.com wrote: You just need a ISAM API for Postgres, That is all. Joel sure hasn't *shown* us anything to suggest that wouldn't answer his needs better than any PL, or explained why that wouldn't

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

2014-09-04 Thread Robert Haas
On Wed, Sep 3, 2014 at 6:24 PM, Bruce Momjian br...@momjian.us wrote: 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;

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

2014-09-04 Thread Bruce Momjian
On Thu, Sep 4, 2014 at 12:52:14PM -0400, Robert Haas wrote: On Wed, Sep 3, 2014 at 6:24 PM, Bruce Momjian br...@momjian.us wrote: 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

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

2014-09-04 Thread Robert Haas
On Thu, Sep 4, 2014 at 12:53 PM, Bruce Momjian br...@momjian.us wrote: On Thu, Sep 4, 2014 at 12:52:14PM -0400, Robert Haas wrote: On Wed, Sep 3, 2014 at 6:24 PM, Bruce Momjian br...@momjian.us wrote: On Fri, May 9, 2014 at 12:03:36PM -0400, Robert Haas wrote: On Thu, May 8, 2014 at 5:21

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

2014-09-04 Thread Robert Haas
On Thu, Sep 4, 2014 at 3:09 AM, Ants Aasma a...@cybertec.at wrote: On Thu, Sep 4, 2014 at 12:36 AM, Andres Freund and...@2ndquadrant.com wrote: It's imo quite clearly better to keep it allocated. For one after postmaster started the checkpointer successfully you don't need to be worried about

Re: [HACKERS] PL/pgSQL 1.2

2014-09-04 Thread Joel Jacobson
On Thu, Sep 4, 2014 at 5:51 PM, Robert Haas robertmh...@gmail.com wrote: When you suggest ISAM, that's like saying demolish your house and build a new one when all I want is to make small but important changes to what I already do as a professional on a daily basis. Go right ahead: this is an

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

2014-09-04 Thread David G Johnston
On Thu, Sep 4, 2014 at 1:00 PM, Robert Haas [via PostgreSQL] ml-node+s1045698n581780...@n5.nabble.com wrote: On Thu, Sep 4, 2014 at 12:53 PM, Bruce Momjian [hidden email] http://user/SendEmail.jtp?type=nodenode=5817809i=0 wrote: On Thu, Sep 4, 2014 at 12:52:14PM -0400, Robert Haas wrote:

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

2014-09-04 Thread Bruce Momjian
On Wed, Sep 3, 2014 at 08:33:31PM -0400, Bruce Momjian wrote: I can't seem to find a way to get the timezone offset via C; see: http://stackoverflow.com/questions/635780/why-does-glibc-timezone-global-not-agree-with-system-time-on-dst On Linux, do 'man timezone' for details.

Re: [HACKERS] Pg_upgrade and toast tables bug discovered

2014-09-04 Thread Noah Yetter
The 9.3.5 release notes contain... - Fix pg_upgrade for cases where the new server creates a TOAST table but the old version did not (Bruce Momjian) This rare situation would manifest as relation OID mismatch errors. ...which I thought was this bug, hence my confusion. If anyone

Re: [HACKERS] pgcrypto: PGP armor headers

2014-09-04 Thread Joel Jacobson
Marko, et al, This is a review of the pgcrypto PGP Armor Headers patch: http://www.postgresql.org/message-id/53edcae8.20...@joh.to Contents Purpose == This patch add functions to create and extract OpenPGP Armor Headers. from OpenPGP messages. Included in the patch are updated

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

2014-09-04 Thread Peter Geoghegan
On Thu, Sep 4, 2014 at 9:19 AM, Robert Haas robertmh...@gmail.com wrote: On Tue, Sep 2, 2014 at 10:27 PM, Peter Geoghegan p...@heroku.com wrote: * Still doesn't address the open question of whether or not we should optimistically always try memcmp() == 0 on tiebreak. I still lean towards yes.

Re: [HACKERS] PL/pgSQL 2

2014-09-04 Thread Josh Berkus
On 09/04/2014 09:02 AM, Craig Ringer wrote: There are a few things I would like to see, like secure session variables in PL/PgSQL. Mostly, though, I think talk of Oracle compatibility seems to be something that comes up before the speaker has really understood what that would mean, and the

Re: [HACKERS] Pg_upgrade and toast tables bug discovered

2014-09-04 Thread Bruce Momjian
On Thu, Sep 4, 2014 at 11:37:27AM -0600, Noah Yetter wrote: The 9.3.5 release notes contain... • Fix pg_upgrade for cases where the new server creates a TOAST table but the old version did not (Bruce Momjian) This rare situation would manifest as relation OID mismatch 

Re: [HACKERS] PL/pgSQL 2

2014-09-04 Thread Pavel Stehule
2014-09-04 20:31 GMT+02:00 Josh Berkus j...@agliodbs.com: On 09/04/2014 09:02 AM, Craig Ringer wrote: There are a few things I would like to see, like secure session variables in PL/PgSQL. Mostly, though, I think talk of Oracle compatibility seems to be something that comes up before the

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

2014-09-04 Thread Peter Geoghegan
On Thu, Sep 4, 2014 at 8:03 AM, Robert Haas robertmh...@gmail.com wrote: I think there shouldn't be any plan nodes in the system that don't get displayed by explain. If you're using a plan node for something, and think it shouldn't be displayed by explain, then either (1) you are wrong or (2)

Re: [HACKERS] Pg_upgrade and toast tables bug discovered

2014-09-04 Thread David G Johnston
On Thu, Sep 4, 2014 at 2:39 PM, Bruce Momjian [via PostgreSQL] ml-node+s1045698n5817828...@n5.nabble.com wrote: On Thu, Sep 4, 2014 at 11:37:27AM -0600, Noah Yetter wrote: The 9.3.5 release notes contain... • Fix pg_upgrade for cases where the new server creates a TOAST table but

Re: [HACKERS] Pg_upgrade and toast tables bug discovered

2014-09-04 Thread Noah Yetter
Isn't that exactly what the release note says? where the new server creates a TOAST table but the old version did not vs. where the new cluster needs a TOAST table that the old cluster didn't At any rate, I've additionally observed that the relation which is blowing up pg_upgrade is a VIEW in the

Re: [HACKERS] Built-in binning functions

2014-09-04 Thread Pavel Stehule
Hi I did a review of last patch 1. There is no problem with patching 2. compilation and doc compilation without warnings and issues. 3. code is clean, respects Postgres coding rules and is well documented - it is slightly modified Tom's version with float8 optimization 4. The name with_bucket is

Re: [HACKERS] Pg_upgrade and toast tables bug discovered

2014-09-04 Thread Bruce Momjian
On Thu, Sep 4, 2014 at 01:14:01PM -0600, Noah Yetter wrote: Isn't that exactly what the release note says?  where the new server creates a TOAST table but the old version did not  vs.  where the new cluster needs a TOAST table that the old cluster didn't Sorry, yes, I got confused. We have

Re: [HACKERS] Commitfest status

2014-09-04 Thread Stephen Frost
* Heikki Linnakangas (hlinnakan...@vmware.com) wrote: 5. Better syntax for REINDEX 6. pgcrypto: support PGP signatures 7. pgcrypto: PGP armour headers [...] I think the latter 3 patches are missing a reviewer because no-one is interested in them. There was some discussion on the REINDEX

Re: [HACKERS] Pg_upgrade and toast tables bug discovered

2014-09-04 Thread Robert Haas
On Thu, Sep 4, 2014 at 3:35 PM, Bruce Momjian br...@momjian.us wrote: At any rate, I've additionally observed that the relation which is blowing up pg_upgrade is a VIEW in the source cluster but gets created as a TABLE in the upgraded cluster, which may better explain why it had no toast table

Re: [HACKERS] PL/pgSQL 2

2014-09-04 Thread Stephen Frost
* Robert Haas (robertmh...@gmail.com) wrote: Second, if you did manage to develop something which was significantly more compatible with Oracle than PostgreSQL or PL/pgsql is today, you'd probably find that the community wouldn't accept it. Agreed. Moving PostgreSQL forward is what the

  1   2   >