[HACKERS] Is LISTEN/NOTIFY reliable?

2010-10-16 Thread Tatsuo Ishii
Hi, Does anybody know PostgreSQL LISTEN/NOTIFY is more reliable than previous versions? I vaguely recall that in the previous implementation, message sent by NOTIFY may not be reached to listner. Does PostgreSQL 9.0's new implementation guarantee that the message is received by the listener? --

Re: [HACKERS] Extensions, this time with a patch

2010-10-16 Thread Dimitri Fontaine
Alvaro Herrera alvhe...@commandprompt.com writes: Maybe what you should be doing here is that modules should provide another definition, say EXTENSION, and they have to explicitely define it in their Makefile (maybe require EXTENSION_VERSION too or something like that). I think the idea that

Re: [HACKERS] Extensions, this time with a patch

2010-10-16 Thread Dimitri Fontaine
Alvaro Herrera alvhe...@commandprompt.com writes: Hmm. To be honest I don't like the direction that pg_execute_from_file has taken. (Now that I look, it's been like this since inception). I have two problems with it: one is that it is #including half the world into genfile.c. This already

Re: Trailing Whitespace Tips (was: [HACKERS] Re: starting to review the Extend NOT NULL representation to pg_constraint patch)

2010-10-16 Thread Peter Eisentraut
On fre, 2010-10-15 at 22:45 +0200, Dimitri Fontaine wrote: I suppose people using other editors or tools will come up with other tricks and tips. Here is an alternative recipe that I have been using: (require 'show-wspace) (add-hook 'font-lock-mode-hook 'show-ws-highlight-hard-spaces)

[HACKERS] Timeline in the light of Synchronous replication

2010-10-16 Thread fazool mein
Hello guys, The concept of time line makes sense to me in the case of asynchronous replication. But in case of synchronous replication, I am not so sure. When a standby connects to the primary, it checks if both have the same time line. If not, it doesn't start. Now, consider the following

Re: [HACKERS] Why do we have a database specification in .pgpass?

2010-10-16 Thread Peter Eisentraut
On ons, 2010-10-13 at 14:32 -0400, Bruce Momjian wrote: We have a database specification in .pgpass: hostname:port:database:username:password What is the purpose of 'database' since username/password combinations are global, not per database? I would like to documents its purpose.

[HACKERS] all keyword for pg_hba.conf host column

2010-10-16 Thread Peter Eisentraut
As a small addition to the pg_hba.conf host name feature, I figured it would be useful to allow all in the host column, instead of having to write 0.0.0.0/0 and ::/0. Patch attached. diff --git a/doc/src/sgml/client-auth.sgml b/doc/src/sgml/client-auth.sgml index ab96af8..228cfff 100644 ---

Re: [HACKERS] knngist - 0.8

2010-10-16 Thread Martijn van Oosterhout
On Fri, Oct 15, 2010 at 08:45:26PM -0400, Robert Haas wrote: But I'm also not sure how far this gets us with KNNGIST, where the issue is not the typmods but the auxilliary information about the context of the sort and/or whether this is a sort or qual. ISTM there are two issues here. With

Re: [HACKERS] Timeout and wait-forever in sync rep

2010-10-16 Thread Robert Haas
On Fri, Oct 15, 2010 at 8:41 AM, Fujii Masao masao.fu...@gmail.com wrote: Hi, As the result of the discussion, I think that we need the following two parameters for the case where the standby goes down. * replication_timeout  This is the maximum time to wait for the ACK from the standby. If

Re: [HACKERS] Is LISTEN/NOTIFY reliable?

2010-10-16 Thread Robert Haas
On Sat, Oct 16, 2010 at 3:27 AM, Tatsuo Ishii is...@postgresql.org wrote: Does anybody know PostgreSQL LISTEN/NOTIFY is more reliable than previous versions?  I vaguely recall that in the previous implementation, message sent by NOTIFY may not be reached to listner. Does PostgreSQL 9.0's new

Re: [HACKERS] Is LISTEN/NOTIFY reliable?

2010-10-16 Thread Tom Lane
Tatsuo Ishii is...@postgresql.org writes: Does anybody know PostgreSQL LISTEN/NOTIFY is more reliable than previous versions? I vaguely recall that in the previous implementation, message sent by NOTIFY may not be reached to listner. Does PostgreSQL 9.0's new implementation guarantee that the

Re: [HACKERS] Extensions, this time with a patch

2010-10-16 Thread Tom Lane
Dimitri Fontaine dimi...@2ndquadrant.fr writes: Alvaro Herrera alvhe...@commandprompt.com writes: The other problem is that it's slurping the whole file and executing it as a single query. Given some advice, I'll rework that part too. The good news is that it's well separated from the rest

Re: [HACKERS] Is LISTEN/NOTIFY reliable?

2010-10-16 Thread Andrew Dunstan
On 10/16/2010 09:04 AM, Robert Haas wrote: On Sat, Oct 16, 2010 at 3:27 AM, Tatsuo Ishiiis...@postgresql.org wrote: Does anybody know PostgreSQL LISTEN/NOTIFY is more reliable than previous versions? I vaguely recall that in the previous implementation, message sent by NOTIFY may not be

Re: [HACKERS] knngist plans

2010-10-16 Thread Marios Vodas
Oleg as I said I do believe some things could get better in docs. Here are 4 main drawbacks in my opinion: 1. The docs lack example(s). There are some references to gistproc.c etc but this is not part of the docs and if I am someone that has just started this is hard and confusing (I shouldn't

Re: [HACKERS] Keywords in pg_hba.conf should be field-specific

2010-10-16 Thread Brendan Jurd
On 13 October 2010 00:28, Fujii Masao masao.fu...@gmail.com wrote: On Sat, Oct 9, 2010 at 11:13 AM, Brendan Jurd dire...@gmail.com wrote: I understand that 'replication' is a keyword as far as the database name is concerned, but I was surprised to find that it was treated as a keyword in the

Re: [HACKERS] Keywords in pg_hba.conf should be field-specific

2010-10-16 Thread Brendan Jurd
On 17 October 2010 01:52, Brendan Jurd dire...@gmail.com wrote: Per the above discussion, I've prepared a patch to make keywords in pg_hba.conf field-specific. Try New and Improved This Message (tm), now with attachment! Cheers, BJ *** a/src/backend/libpq/hba.c --- b/src/backend/libpq/hba.c

Re: [HACKERS] Extensions, this time with a patch

2010-10-16 Thread Dimitri Fontaine
Tom Lane t...@sss.pgh.pa.us writes: I think that's something that could be left for later, if not never. That's very great news. I'm left with moving the bulk of the code away from genfile.c and into postgres.c, and have the former be a user callable shell around the later, I suppose. Right?

Re: [HACKERS] all keyword for pg_hba.conf host column

2010-10-16 Thread Robert Haas
On Oct 16, 2010, at 6:56 AM, Peter Eisentraut pete...@gmx.net wrote: As a small addition to the pg_hba.conf host name feature, I figured it would be useful to allow all in the host column, instead of having to write 0.0.0.0/0 and ::/0. Patch attached. +1. Looks sane on a quick read.

Re: [HACKERS] all keyword for pg_hba.conf host column

2010-10-16 Thread Brendan Jurd
On 16 October 2010 21:56, Peter Eisentraut pete...@gmx.net wrote: As a small addition to the pg_hba.conf host name feature, I figured it would be useful to allow all in the host column, instead of having to write 0.0.0.0/0 and ::/0.  Patch attached. Cool. And, for what it's worth, this

Re: [HACKERS] knngist plans

2010-10-16 Thread Alvaro Herrera
Excerpts from Marios Vodas's message of sáb oct 16 11:11:52 -0300 2010: 4. Why not add some images/figures? (1 image = 1000 words) I can answer this: the reason is that we haven't settled on a technology for producing figures. There's a thread about it, but no consensus. -- Álvaro Herrera

Re: [HACKERS] Keywords in pg_hba.conf should be field-specific

2010-10-16 Thread Alvaro Herrera
Excerpts from Brendan Jurd's message of sáb oct 16 11:53:31 -0300 2010: On 17 October 2010 01:52, Brendan Jurd dire...@gmail.com wrote: Per the above discussion, I've prepared a patch to make keywords in pg_hba.conf field-specific. Try New and Improved This Message (tm), now with

Re: [HACKERS] Keywords in pg_hba.conf should be field-specific

2010-10-16 Thread Brendan Jurd
On 17 October 2010 02:27, Alvaro Herrera alvhe...@commandprompt.com wrote: Hmm.  Would it be possible to list keywords _applicable_ to each field, and have these passed down to next_token by the caller instead?  This seems backwards, but I'm not sure if the other way is really workable. Short

Re: [HACKERS] knngist - 0.8

2010-10-16 Thread Paul Ramsey
(And, if we are going to break everything in sight, now would be a good time to think about changing typmod to something more flexible than one int32.) As someone who is jamming geometry type, spatial reference number and dimensionality into said 32bit typmod, let me say emphatically ...

Re: Trailing Whitespace Tips (was: [HACKERS] Re: starting to review the Extend NOT NULL representation to pg_constraint patch)

2010-10-16 Thread Bernd Helmle
--On 16. Oktober 2010 12:35:06 +0300 Peter Eisentraut pete...@gmx.net wrote: Maybe it should go in src/tools/editors/emacs.samples, too? Yeah, I think we should recommend some way to highlight faulty whitespace. The problem is, after you turn it on, it will make you cry as you realize

Re: [HACKERS] patch: Add JSON datatype to PostgreSQL (GSoC, WIP)

2010-10-16 Thread Terry Laurenzo
Hi all - I independently started some work on a similar capability as was contributed back in August by Joey Adams for a json datatype. Before starting, I did a quick search but for some reason didn't turn this existing thread up. What I've been working on is out on github for now:

Re: [HACKERS] knngist - 0.8

2010-10-16 Thread Peter Eisentraut
On lör, 2010-10-16 at 09:23 -0700, Paul Ramsey wrote: (And, if we are going to break everything in sight, now would be a good time to think about changing typmod to something more flexible than one int32.) As someone who is jamming geometry type, spatial reference number and

Re: [HACKERS] WIP: extensible enums

2010-10-16 Thread Dean Rasheed
On 10/15/2010 04:33 AM, Dean Rasheed wrote: I started looking at this last night, but ran out of time. I'll continue this evening / over the weekend. Continuing my review of this patch... Usability review What the patch does: This patch adds syntax to allow additional enum

Re: [HACKERS] knngist plans

2010-10-16 Thread Oleg Bartunov
Marios, you're right. There are several reasons for poor documentation, but of course, no excuse, we do need good docs any way ! It's very nice you're willing to write one, since it's always better seen from outside of development. I think it'd be better to use wiki, so other people can join.

Re: [HACKERS] Extensions, this time with a patch

2010-10-16 Thread Dimitri Fontaine
Dimitri Fontaine dimi...@2ndquadrant.fr writes: That's very great news. I'm left with moving the bulk of the code away from genfile.c and into postgres.c, and have the former be a user callable shell around the later, I suppose. Right? Here it is, looks much better this way. Regards, --

Re: [HACKERS] patch: Add JSON datatype to PostgreSQL (GSoC, WIP)

2010-10-16 Thread Hitoshi Harada
2010/10/17 Terry Laurenzo t...@laurenzo.org: Hi all - I independently started some work on a similar capability as was contributed back in August by Joey Adams for a json datatype.  Before starting, I did a quick search but for some reason didn't turn this existing thread up. What I've been

Re: [HACKERS] knngist - 0.8

2010-10-16 Thread Paul Ramsey
On Sat, Oct 16, 2010 at 10:17 AM, Peter Eisentraut pete...@gmx.net wrote: On lör, 2010-10-16 at 09:23 -0700, Paul Ramsey wrote:   (And, if we are going to break everything in sight, now would be a good time to think about changing typmod to something more flexible than one int32.) As

Re: [HACKERS] Extensions, this time with a patch

2010-10-16 Thread Tom Lane
Dimitri Fontaine dimi...@2ndquadrant.fr writes: Tom Lane t...@sss.pgh.pa.us writes: I think that's something that could be left for later, if not never. That's very great news. I'm left with moving the bulk of the code away from genfile.c and into postgres.c, and have the former be a user

Re: [HACKERS] Keywords in pg_hba.conf should be field-specific

2010-10-16 Thread Tom Lane
Alvaro Herrera alvhe...@commandprompt.com writes: Excerpts from Brendan Jurd's message of sáb oct 16 11:53:31 -0300 2010: Try New and Improved This Message (tm), now with attachment! Hmm. Would it be possible to list keywords _applicable_ to each field, and have these passed down to

Re: [HACKERS] Keywords in pg_hba.conf should be field-specific

2010-10-16 Thread Tom Lane
Brendan Jurd dire...@gmail.com writes: Full answer: The problem is that pg_hba.conf doesn't have a fixed structure. Each line can be 4, 5 or 6 fields (not including the final 'options' field) long, and which of these structures apply to any given line isn't decided until parse_hba_line goes

Re: [HACKERS] Is LISTEN/NOTIFY reliable?

2010-10-16 Thread Tatsuo Ishii
On Sat, Oct 16, 2010 at 3:27 AM, Tatsuo Ishii is...@postgresql.org wrote: Does anybody know PostgreSQL LISTEN/NOTIFY is more reliable than previous versions? ,A (BI vaguely recall that in the previous implementation, message sent by NOTIFY may not be reached to listner. Does PostgreSQL

Re: [HACKERS] knngist - 0.8

2010-10-16 Thread Robert Haas
On Sat, Oct 16, 2010 at 6:13 PM, Paul Ramsey pram...@cleverelephant.ca wrote: On Sat, Oct 16, 2010 at 10:17 AM, Peter Eisentraut pete...@gmx.net wrote: On lör, 2010-10-16 at 09:23 -0700, Paul Ramsey wrote:   (And, if we are going to break everything in sight, now would be a good time to

Re: [HACKERS] How to reliably detect if it's a promoting standby

2010-10-16 Thread Tatsuo Ishii
On Thu, Oct 14, 2010 at 7:35 PM, Tatsuo Ishii is...@postgresql.org wrote: What new public interfaces do you think are needed for 9.1 in this regard? At this point I'm thinking of modifying existing pg_is_in_recovery(), thus 0 new public interface. pg_is_in_recovery() returns a bool, are

Re: [HACKERS] knngist - 0.8

2010-10-16 Thread Robert Haas
On Fri, Oct 15, 2010 at 9:39 PM, Robert Haas robertmh...@gmail.com wrote: On Fri, Oct 15, 2010 at 8:45 PM, Robert Haas robertmh...@gmail.com wrote: On Fri, Oct 15, 2010 at 8:10 PM, Tom Lane t...@sss.pgh.pa.us wrote: Perhaps we should think of pg_amop not so much as a way to tell the AM what to

Re: [HACKERS] Extensions, this time with a patch

2010-10-16 Thread Alvaro Herrera
Excerpts from Tom Lane's message of sáb oct 16 19:52:27 -0300 2010: Dimitri Fontaine dimi...@2ndquadrant.fr writes: Tom Lane t...@sss.pgh.pa.us writes: I think that's something that could be left for later, if not never. That's very great news. I'm left with moving the bulk of the code

Re: [HACKERS] How to determine failed connection attempt due to invalid authorization (libpq)?

2010-10-16 Thread Robert Haas
On Thu, Oct 14, 2010 at 2:59 PM, Dmitriy Igrishin dmit...@gmail.com wrote: Is there way to determine failed connection attempt due to invalid authorization (libpq)? I think this question would be more appropriate on pgsql-general. I suppose you would have to look at PQerrorMessage(). --

Re: [HACKERS] Extensions, this time with a patch

2010-10-16 Thread Tom Lane
Alvaro Herrera alvhe...@commandprompt.com writes: The intent here is to execute some code from the file directly inside the server. Eh, I realize now that the right way to go about this is to use SPI. Yeah, that would be one way to go about it. But IMO postgres.c should be solely concerned

Re: [HACKERS] knngist - 0.8

2010-10-16 Thread Robert Haas
On Fri, Oct 15, 2010 at 7:10 PM, Tom Lane t...@sss.pgh.pa.us wrote: Robert Haas robertmh...@gmail.com writes: I still feel vaguely uneasy about the fact that the proposed patch can't handle ASC/DESC or NULLS FIRST/LAST, and that unease grew a bit more last night when I read Peter's patch to

Re: [HACKERS] Extensions, this time with a patch

2010-10-16 Thread Alvaro Herrera
Excerpts from Tom Lane's message of sáb oct 16 23:32:49 -0300 2010: Alvaro Herrera alvhe...@commandprompt.com writes: The intent here is to execute some code from the file directly inside the server. Eh, I realize now that the right way to go about this is to use SPI. Yeah, that would

Re: [HACKERS] Review: Fix snapshot taking inconsistencies

2010-10-16 Thread Alvaro Herrera
Excerpts from Tom Lane's message of mar oct 12 20:49:28 -0300 2010: Marko Tiikkaja marko.tiikk...@cs.helsinki.fi writes: On 2010-10-13 2:10 AM +0300, Tom Lane wrote: BTW, this patch seems to be also the time to remove the AtStart_Cache() call in CommandCounterIncrement, as foreseen in the

Re: [HACKERS] Keywords in pg_hba.conf should be field-specific

2010-10-16 Thread Brendan Jurd
On 17 October 2010 09:59, Tom Lane t...@sss.pgh.pa.us wrote: Brendan Jurd dire...@gmail.com writes: At the time that next_token gets called, we have no way of knowing which field is currently being tokenised, at least not without doing some serious rearrangement of hba.c, so that it tokenises