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

2010-10-16 Thread Dmitriy Igrishin
Hey Robert, I've asked pgsql-general. Unfortunately it seems that there is no better way to do it except parsing PQerrorMessage(). Sadly. 2010/10/17 Robert Haas > On Thu, Oct 14, 2010 at 2:59 PM, Dmitriy Igrishin > wrote: > > Is there way to determine failed connection attempt due to invalid

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 wrote: > Brendan Jurd 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 and then >> parses one token

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 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 comment there. > > >

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 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

Re: [HACKERS] knngist - 0.8

2010-10-16 Thread Robert Haas
On Fri, Oct 15, 2010 at 7:10 PM, Tom Lane wrote: > Robert Haas 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 add collation support. > > Good poi

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

2010-10-16 Thread Tom Lane
Alvaro Herrera 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 with interactions with th

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 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(). -- Robert Haas Enterpri

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 writes: > > Tom Lane 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 p

Re: [HACKERS] knngist - 0.8

2010-10-16 Thread Robert Haas
On Fri, Oct 15, 2010 at 9:39 PM, Robert Haas wrote: > On Fri, Oct 15, 2010 at 8:45 PM, Robert Haas wrote: >> On Fri, Oct 15, 2010 at 8:10 PM, Tom Lane wrote: Perhaps we should think of pg_amop not so much as a way to tell the AM what to do, but just a way to tell it what operator

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 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 you pro

Re: [HACKERS] knngist - 0.8

2010-10-16 Thread Robert Haas
On Sat, Oct 16, 2010 at 6:13 PM, Paul Ramsey wrote: > On Sat, Oct 16, 2010 at 10:17 AM, Peter Eisentraut 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 >>

Re: [HACKERS] Is LISTEN/NOTIFY reliable?

2010-10-16 Thread Tatsuo Ishii
> On Sat, Oct 16, 2010 at 3:27 AM, Tatsuo Ishii 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 9.0's new implem

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

2010-10-16 Thread Tom Lane
Brendan Jurd 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 to work on it.

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

2010-10-16 Thread Tom Lane
Alvaro Herrera 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 next_token by the caller inst

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

2010-10-16 Thread Tom Lane
Dimitri Fontaine writes: > Tom Lane 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 su

Re: [HACKERS] knngist - 0.8

2010-10-16 Thread Paul Ramsey
On Sat, Oct 16, 2010 at 10:17 AM, Peter Eisentraut 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 someo

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

2010-10-16 Thread Hitoshi Harada
2010/10/17 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

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

2010-10-16 Thread Dimitri Fontaine
Dimitri Fontaine 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, -- Dimitri Fontaine http://

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. P

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 additiona

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 > d

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: http://github.

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 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 how sloppy most co

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: [HACKERS] Keywords in pg_hba.conf should be field-specific

2010-10-16 Thread Brendan Jurd
On 17 October 2010 02:27, Alvaro Herrera 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 answer: I don't think

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 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! Hmm. W

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 T

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

2010-10-16 Thread Brendan Jurd
On 16 October 2010 21:56, Peter Eisentraut 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 doesn't conflic

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 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. ...Robert -- Sent

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

2010-10-16 Thread Dimitri Fontaine
Tom Lane 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? Regards, -- Dimitri

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 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] Keywords in pg_hba.conf should be field-specific

2010-10-16 Thread Brendan Jurd
On 13 October 2010 00:28, Fujii Masao wrote: > On Sat, Oct 9, 2010 at 11:13 AM, Brendan Jurd 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 username field also.  I had a loo

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 have

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 Ishii 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

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

2010-10-16 Thread Tom Lane
Dimitri Fontaine writes: > Alvaro Herrera 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 of the extension's work. I think that's so

Re: [HACKERS] Is LISTEN/NOTIFY reliable?

2010-10-16 Thread Tom Lane
Tatsuo Ishii 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 message is > rec

Re: [HACKERS] Is LISTEN/NOTIFY reliable?

2010-10-16 Thread Robert Haas
On Sat, Oct 16, 2010 at 3:27 AM, Tatsuo Ishii 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 implementation gua

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 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 this >  timeou

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 Bt

[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 --- a/do

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 pur

[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 scena

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) (add-ho

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

2010-10-16 Thread Dimitri Fontaine
Alvaro Herrera 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 smells trouble in itsel

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

2010-10-16 Thread Dimitri Fontaine
Alvaro Herrera 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 modules should continue

[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? -- T