Re: [HACKERS] Determining client_encoding from client locale

2009-07-24 Thread Jaime Casanova
On Fri, Jul 24, 2009 at 2:23 AM, Magnus Hagander wrote: >> >> 1) it introduces a dependency for -lpgport when compiling a client >> that uses libpq >>    http://archives.postgresql.org/pgsql-hackers/2009-07/msg01511.php > > For other parts of libpgport that are needed, we pull in the > individual s

Re: [HACKERS] WIP: to_char, support for EEEE format

2009-07-24 Thread Brendan Jurd
2009/7/24 Euler Taveira de Oliveira : > Here is my review. The patch applied without problems. The docs and regression > tests are included. Both of them worked as expected. Also, you included a fix > in RN format, do it in another patch. > Well, I updated an error message for RN to keep it consis

[HACKERS] proposal: support empty string as separator for string_to_array

2009-07-24 Thread Pavel Stehule
Hello I have one idea, that should simplify string to char array transformation. The base is idea: between every char is empty string, so empty string is regular separator for string_to_array function. This behave is inversion of array_to_string function behave: postgres=# select array_to_string(

Re: [HACKERS] WIP: plpython3

2009-07-24 Thread James Pye
On Jul 24, 2009, at 7:08 PM, Stuart Bishop wrote: I'm not particularly interested in Python 3.x support yet (we are still back on 2.4, soon to hop to 2.5 or 2.6. For us 3.1 is probably 2 years away at the earliest). I am interested in improved plpython though. Two years would hopefully be

Re: [HACKERS] ECPG dynamic cursor, SQLDA support

2009-07-24 Thread Robert Haas
On Thu, Jun 25, 2009 at 11:18 AM, Michael Meskes wrote: > On Wed, Jun 24, 2009 at 11:51:57AM +0200, Boszormenyi Zoltan wrote: >> attached is our latest patch extending ECPG: > > Just as a short explanation, the older versions were sent to me only and I > reviewed them. I haven't found time to to re

Re: [HACKERS] WIP: plpython3

2009-07-24 Thread Stuart Bishop
On Fri, Jul 24, 2009 at 5:23 AM, James Pye wrote:   That also means that maintaining a separate, parallel code base   for a Python 3 variant can only be acceptable if it gives major advantages. I'm not particularly interested in Python 3.x support yet (we are still back on 2.4, soon to hop

Re: [HACKERS] [PATCH] DefaultACLs

2009-07-24 Thread Joshua Tolley
On Sun, Jul 19, 2009 at 06:13:32PM +0200, Petr Jelinek wrote: > Hello, > > while writing some basic docs I found bug in dependency handling when > doing SET on object type that already had some default privileges. > Attached patch fixes it, it also fixes thinko in parser (DROPing GRANT > OPTI

Re: [HACKERS] SE-PostgreSQL Specifications

2009-07-24 Thread KaiGai Kohei
Sam Mason wrote: On Sat, Jul 25, 2009 at 09:16:47AM +0900, KaiGai Kohei wrote: Sam Mason wrote: The show_credit() function in this section would seem to leak authority as well; it seems possible to determine if customers exist that otherwise may otherwise hidden. For example, imagine we have a

Re: [HACKERS] Non-blocking communication between a frontend and a backend (pqcomm)

2009-07-24 Thread Robert Haas
On Fri, Jul 24, 2009 at 7:21 PM, Tom Lane wrote: > Fujii Masao writes: >> On Wed, Jul 22, 2009 at 2:20 AM, Robert Haas wrote: >>> Are you planning to update this patch based on Martin's review? > >> Sure. Attached is an updated patch. > > I looked at this patch.  I don't see how we can consider ac

Re: [HACKERS] SE-PostgreSQL Specifications

2009-07-24 Thread Sam Mason
On Sat, Jul 25, 2009 at 09:16:47AM +0900, KaiGai Kohei wrote: > Sam Mason wrote: > >The show_credit() function in this section would seem to leak authority > >as well; it seems possible to determine if customers exist that > >otherwise may otherwise hidden. For example, imagine we have a row > >in

Re: [HACKERS] Lock Wait Statistics (next commitfest)

2009-07-24 Thread Mark Kirkwood
Mark Kirkwood wrote: Jaime Casanova wrote: On Fri, Jul 17, 2009 at 3:38 AM, Mark Kirkwood wrote: With respect to the sum of wait times being not very granular, yes - quite true. I was thinking it is useful to be able to answer the question 'where is my wait time being spent' - but it hides c

Re: [HACKERS] Proposal: More portable way to support 64bit platforms

2009-07-24 Thread Dave Page
On Fri, Jul 24, 2009 at 10:53 PM, Stephen Frost wrote: > Dave, > > * Dave Page (dp...@pgadmin.org) wrote: >> On Fri, Jul 24, 2009 at 10:35 PM, Stephen Frost wrote: >> > Do you need access to a Win64 box?  I can provide you access to a >> > Win64 system, which Dave Page and Magnus already have acces

Re: [HACKERS] Lock Wait Statistics (next commitfest)

2009-07-24 Thread Mark Kirkwood
Tom Lane wrote: Mark Kirkwood writes: Yeah, enabling log_lock_waits is certainly another approach, however you currently miss out on those that are < deadlock_timeout - and potentially they could be the source of your problem (i.e millions of waits all < deadlock_timeout but taken together

Re: [HACKERS] SE-PostgreSQL Specifications

2009-07-24 Thread KaiGai Kohei
Sam Mason wrote: On Sat, Jul 25, 2009 at 07:23:22AM +0900, KaiGai Kohei wrote: Thanks, but I found an incorrect change at the trusted procedure section. Old) CREATE TABLE customer ( cid integer primary key, cname varchar(32), credit varchar(32) - SECURITY_LABE

Re: [HACKERS] COPY WITH CSV FORCE QUOTE * -- REVIEW

2009-07-24 Thread Andrew Dunstan
Tom Lane wrote: Andrew Dunstan writes: I have reviewed this and made a small tweak in the docco. I'm just about ready to commit this, but I'm still slightly worried that passing NULL to denote all columns in this piece of grammar: | FORCE QUOTE '*' {

Re: [HACKERS] SE-PostgreSQL Specifications

2009-07-24 Thread Sam Mason
On Sat, Jul 25, 2009 at 07:23:22AM +0900, KaiGai Kohei wrote: > Thanks, but I found an incorrect change at the trusted procedure section. > > Old) > CREATE TABLE customer ( > cid integer primary key, > cname varchar(32), > credit varchar(32) > - SECURITY_LABEL =

Re: [HACKERS] Non-blocking communication between a frontend and a backend (pqcomm)

2009-07-24 Thread Tom Lane
I wrote: > I am also thinking that if you do need the ability to get control back > without blocking on the socket, you probably will need that for writes > as well as reads; and this patch doesn't cover the write case. Oh, another gripe: I'll bet a nickel that this doesn't work very nicely under

Re: [HACKERS] COPY WITH CSV FORCE QUOTE * -- REVIEW

2009-07-24 Thread Tom Lane
Andrew Dunstan writes: > I have reviewed this and made a small tweak in the docco. I'm just about > ready to commit this, but I'm still slightly worried that passing NULL > to denote all columns in this piece of grammar: > | FORCE QUOTE '*' > { >

Re: [HACKERS] COPY WITH CSV FORCE QUOTE * -- REVIEW

2009-07-24 Thread Andrew Dunstan
Josh Berkus wrote: Stuff someone else should do: a. review code b. review code format I am done with this review. I have reviewed this and made a small tweak in the docco. I'm just about ready to commit this, but I'm still slightly worried that passing NULL to denote all columns in this

Re: [HACKERS] Non-blocking communication between a frontend and a backend (pqcomm)

2009-07-24 Thread Tom Lane
Fujii Masao writes: > On Wed, Jul 22, 2009 at 2:20 AM, Robert Haas wrote: >> Are you planning to update this patch based on Martin's review? > Sure. Attached is an updated patch. I looked at this patch. I don't see how we can consider accepting it by itself. It adds a bunch of code that is not

Re: [HACKERS] When is a record NULL?

2009-07-24 Thread David E. Wheeler
On Jul 24, 2009, at 2:59 PM, David E. Wheeler wrote: FETCH have INTO rec_have; FETCH want INTO rec_want; WHILE NOT rec_have IS NULL OR NOT rec_want IS NULL LOOP IF rec_have IS DISTINCT FROM rec_want THEN RETURN false; END IF; rownum = rownum + 1; F

Re: [HACKERS] SE-PostgreSQL Specifications

2009-07-24 Thread Robert Haas
On Fri, Jul 24, 2009 at 6:35 PM, Stephen Frost wrote: > Thanks for this, it really does help, I believe.  I've been reviewing it > and am also planning on helping refine and improve upon it.  I'd like to > spend time working on the patch as well but I'm hesitant to commit to > that right now due to

Re: [HACKERS] SE-PostgreSQL Specifications

2009-07-24 Thread Stephen Frost
KaiGai, * KaiGai Kohei (kai...@ak.jp.nec.com) wrote: > Here is the initial draft of SE-PostgreSQL specifications: > > http://wiki.postgresql.org/wiki/SEPostgreSQL_Draft Thanks for this, it really does help, I believe. I've been reviewing it and am also planning on helping refine and improve u

Re: [HACKERS] contrib/xml2 pfree bug

2009-07-24 Thread Andrew Dunstan
Tom Lane wrote: Andrew Dunstan writes: Didn't we just clean up a mess in our XML handling to do with memory handlers? It looks like contrib/xml2 might have similar problems. Yeah, it's using xmlMemSetup(), and being even less careful than the core code was :-(. Do we feel like fixi

Re: [HACKERS] SE-PostgreSQL Specifications

2009-07-24 Thread KaiGai Kohei
Martijn van Oosterhout wrote: > On Fri, Jul 24, 2009 at 01:07:54AM -0700, Greg Williamson wrote: >> Here is the initial draft of SE-PostgreSQL specifications: >> >> http://wiki.postgresql.org/wiki/SEPostgreSQL_Draft > > Hey, this is really cool. Think it is a nice introduction. Fixed some > of t

Re: [HACKERS] contrib/xml2 pfree bug

2009-07-24 Thread Tom Lane
Andrew Dunstan writes: > Didn't we just clean up a mess in our XML handling to do with memory > handlers? It looks like contrib/xml2 might have similar problems. Yeah, it's using xmlMemSetup(), and being even less careful than the core code was :-(. Do we feel like fixing it, or is it time to r

Re: [HACKERS] When is a record NULL?

2009-07-24 Thread Sam Mason
On Fri, Jul 24, 2009 at 12:30:39PM -0500, Kevin Grittner wrote: > Sam Mason wrote: > > The fact that it happens to be a NULL *value* in one case > > Well, according to Codd (and I tend to go with him on this) there is > no such thing. NULL is a way to flag a place where a value could be > store

Re: [HACKERS] When is a record NULL?

2009-07-24 Thread David E . Wheeler
On Jul 24, 2009, at 11:37 AM, Jeff Davis wrote: Hmmm ... that suggests that we may not be handling IS DISTINCT FROM correctly for rowtypes. I haven't read that part of the spec, but I would've guessed that the spec wants it to be consistent with IS NULL. Our behavior appears to match the stan

Re: [HACKERS] Enable SSPI on cygwin

2009-07-24 Thread Andrew Dunstan
Reini, the style of this patch has previously been criticized by both Magnus and me. We do not define WIN32 *anywhere* in our sources, and we don't want to start. In fact, IIRC we carefully removed all such code years ago, because it caused us lots of grief. Please find a way to code your

Re: [HACKERS] When is a record NULL?

2009-07-24 Thread David E. Wheeler
On Jul 24, 2009, at 9:40 AM, Jeff Davis wrote: There's no single test, but you can see if it's an empty row with: x IS NULL AND x IS DISTINCT FROM NULL And you can see if it's a "real" NULL by: x IS NULL AND x IS NOT DISTINCT FROM NULL It's funny until you try it -- then it's just scary. Am

Re: [HACKERS] Enable SSPI on cygwin

2009-07-24 Thread Magnus Hagander
On Fri, Jul 24, 2009 at 23:47, Reini Urban wrote: > Attached is my patch to enable SSPI on cygwin. Is it really such a good idea to keep doing #define WIN32 and #undef WIN32 in multiple places? It seems very fragile to me - we should keep the defines for cygwin and win32 separate. Even if that mea

Re: [HACKERS] Proposal: More portable way to support 64bit platforms

2009-07-24 Thread Stephen Frost
Dave, * Dave Page (dp...@pgadmin.org) wrote: > On Fri, Jul 24, 2009 at 10:35 PM, Stephen Frost wrote: > > Do you need access to a Win64 box?  I can provide you access to a > > Win64 system, which Dave Page and Magnus already have access to, if it > > would be useful.. > > I haven't got round to i

[HACKERS] Enable SSPI on cygwin

2009-07-24 Thread Reini Urban
Attached is my patch to enable SSPI on cygwin. -- Reini Urban http://phpwiki.org/ http://murbreak.at/ --- origsrc/postgresql-8.4.0/configure.in 2009-06-27 02:14:47.0 +0200 +++ src/postgresql-8.4.0/configure.in 2009-07-02 09:02:25.921875000 +0200 @@ -907,7 +907,11 @@ if test "$with_gssapi

Re: [HACKERS] Proposal: More portable way to support 64bit platforms

2009-07-24 Thread Dave Page
On Fri, Jul 24, 2009 at 10:35 PM, Stephen Frost wrote: > Peter, > > * Peter Eisentraut (pete...@gmx.net) wrote: >> After closer inspection, not having a win64 box available, I have my doubts >> whether this patch actually does anything.  Foremost, it doesn't touch the >> definition of the Datum typ

Re: [HACKERS] explain refactoring v4

2009-07-24 Thread Magnus Hagander
On Fri, Jul 24, 2009 at 23:11, Robert Haas wrote: > On Fri, Jul 24, 2009 at 4:02 PM, Tom Lane wrote: >> This is not likely to matter to human readers but it might to programs. >> OTOH we presumably expect programs to migrate to using a more >> program-friendly EXPLAIN output format with 8.5. >> >>

Re: [HACKERS] Proposal: More portable way to support 64bit platforms

2009-07-24 Thread Stephen Frost
Peter, * Peter Eisentraut (pete...@gmx.net) wrote: > After closer inspection, not having a win64 box available, I have my doubts > whether this patch actually does anything. Foremost, it doesn't touch the > definition of the Datum type, which ought to be at the core of a change like > this. D

[HACKERS] contrib/xml2 pfree bug

2009-07-24 Thread Andrew Dunstan
Didn't we just clean up a mess in our XML handling to do with memory handlers? It looks like contrib/xml2 might have similar problems. Here's the relevant part of a back trace from a core dump: Program terminated with signal 11, Segmentation fault. #0 0x0069300a in pfree () (gdb) bt

Re: [HACKERS] When is a record NULL?

2009-07-24 Thread Merlin Moncure
On Fri, Jul 24, 2009 at 4:29 PM, Greg Stark wrote: > On Fri, Jul 24, 2009 at 7:49 PM, Merlin Moncure wrote: >> Still, why: >> >> *) is select null::foo is distinct from (null, null)::foo; true? >> (null should not be distinct from null) >> >> *) does (null, null) allow STRICT functions to execute?

Re: [HACKERS] explain refactoring v4

2009-07-24 Thread Robert Haas
On Fri, Jul 24, 2009 at 5:11 PM, Tom Lane wrote: > Robert Haas writes: >> OK, here it is again.  Changes are the same as the previous version, >> but this one should apply cleanly after today's pgindent run. > > Applied with some minor editorialization/further cleanup. Thanks. I mostly finished

Re: [HACKERS] explain refactoring v4

2009-07-24 Thread Robert Haas
On Fri, Jul 24, 2009 at 4:02 PM, Tom Lane wrote: > Robert Haas writes: >> OK, here it is again.  Changes are the same as the previous version, >> but this one should apply cleanly after today's pgindent run. > > As I was poking through this I noticed that it makes at least one small > change in th

Re: [HACKERS] explain refactoring v4

2009-07-24 Thread Tom Lane
Robert Haas writes: > OK, here it is again. Changes are the same as the previous version, > but this one should apply cleanly after today's pgindent run. Applied with some minor editorialization/further cleanup. I left the "Subquery Scan on ss" business as-is. If anyone complains it would be a

Re: [HACKERS] SE-PostgreSQL Specifications

2009-07-24 Thread Martijn van Oosterhout
On Fri, Jul 24, 2009 at 01:07:54AM -0700, Greg Williamson wrote: > Here is the initial draft of SE-PostgreSQL specifications: > > http://wiki.postgresql.org/wiki/SEPostgreSQL_Draft Hey, this is really cool. Think it is a nice introduction. Fixed some of the really obvious language stuff and an

Re: [HACKERS] When is a record NULL?

2009-07-24 Thread Greg Stark
On Fri, Jul 24, 2009 at 7:49 PM, Merlin Moncure wrote: > Still, why: > > *) is select null::foo is distinct from (null, null)::foo; true? > (null should not be distinct from null) > > *) does (null, null) allow STRICT functions to execute? > > *) is (null, null)::text not null? These are all good

Re: [HACKERS] Proposal: More portable way to support 64bit platforms

2009-07-24 Thread Peter Eisentraut
On Friday 26 June 2009 12:07:24 Tsutomu Yamada wrote: > Included is a conceptual patch to use intptr_t. Comments are welcome. After closer inspection, not having a win64 box available, I have my doubts whether this patch actually does anything. Foremost, it doesn't touch the definition of the D

Re: [HACKERS] [PATCH] "could not reattach to shared memory" on Windows

2009-07-24 Thread Magnus Hagander
On Thu, Jul 23, 2009 at 09:04, Magnus Hagander wrote: > On Thu, Jul 23, 2009 at 08:04, Tsutomu Yamada wrote: >> Hello, >> >> Thank you for correcting patch. >> However, I think the following block have to use VirualFree*Ex*(). >> >> (yes, this should never happen, maybe there is actually no problem

Re: [HACKERS] explain refactoring v4

2009-07-24 Thread Tom Lane
Robert Haas writes: > OK, here it is again. Changes are the same as the previous version, > but this one should apply cleanly after today's pgindent run. As I was poking through this I noticed that it makes at least one small change in the output format: what had been "Subquery Scan ss" will now

Re: [HACKERS] psql - small fix in \du

2009-07-24 Thread Peter Eisentraut
On Thursday 23 July 2009 13:29:51 Andreas Wenk wrote: > attached you can find an updated patch. The changes are: > > - change \du and \dg to \du+ and \dg+ in the docu > - change the same in psql/help.c > - change the translation files in psql/po Fixed, thanks. -- Sent via pgsql-hackers mailing

Re: [HACKERS] Multicore builds on MSVC

2009-07-24 Thread Dave Page
On Fri, Jul 24, 2009 at 8:07 PM, Magnus Hagander wrote: > I'm going to apply this for HEAD. I'm considering backpatching as > well, to speed up all build machines. Comments on that? Let's see how it goes in the BF for HEAD, and then backpatch if it looks good. I'm keen to get the potential speedu

Re: [HACKERS] [PATCH] user mapping extension to pg_ident.conf

2009-07-24 Thread Robert Haas
On Wed, Jul 22, 2009 at 8:57 AM, Magnus Hagander wrote: > On Wed, Jul 22, 2009 at 14:53, Tom Lane wrote: >> Magnus Hagander writes: Yup, you would need a protocol change that would allow the client to change its mind about what the username was after it got the auth challenge.  And

[HACKERS] Multicore builds on MSVC

2009-07-24 Thread Magnus Hagander
Hi! I have a simple one-line patch to enable the use of multiple CPUs or cores when building with MSVC. It is only inside the C compiler itself, but it makes about a 30-35% reduction in compile time on a fairly CPU-limited dual-CPU VM. It would probably do a lot more on for example a quadcore. It

Re: [HACKERS] When is a record NULL?

2009-07-24 Thread Merlin Moncure
On Fri, Jul 24, 2009 at 2:05 PM, Tom Lane wrote: > Merlin Moncure writes: >> I think the following should _not_ return true: >> select (null, null)::somerowtype is null; > > Take it up with the SQL standards committee.  The spec is 100% not > ambiguous about this. I'm not proposing to change the

Re: [HACKERS] bytea vs. pg_dump

2009-07-24 Thread Bernd Helmle
--On Freitag, Juli 24, 2009 11:38:06 -0400 Tom Lane wrote: Bernd, are you done reviewing this or did you intend to do more? It's still marked as "needs review" on the commitfest page. I hoped to get more profiling data like Andrew suggested, but haven't enough time to do it :( The customer

Re: [HACKERS] When is a record NULL?

2009-07-24 Thread Jeff Davis
On Fri, 2009-07-24 at 14:10 -0400, Tom Lane wrote: > Hmmm ... that suggests that we may not be handling IS DISTINCT FROM > correctly for rowtypes. I haven't read that part of the spec, but > I would've guessed that the spec wants it to be consistent with > IS NULL. > Our behavior appears to matc

Re: [HACKERS] When is a record NULL?

2009-07-24 Thread Jeff Davis
On Fri, 2009-07-24 at 13:35 -0400, Merlin Moncure wrote: > I think the following should _not_ return true: > select (null, null)::somerowtype is null; > > The reasoning being that It's not at all clear to me that you can "reason" effectively about SQL logic semantics. Upon which laws are you reas

Re: [HACKERS] When is a record NULL?

2009-07-24 Thread David E. Wheeler
On Jul 24, 2009, at 11:10, Tom Lane wrote: Hmmm ... that suggests that we may not be handling IS DISTINCT FROM correctly for rowtypes. I haven't read that part of the spec, but I would've guessed that the spec wants it to be consistent with IS NULL. Yes, that's precisely what I was trying to

Re: [HACKERS] When is a record NULL?

2009-07-24 Thread David E. Wheeler
On Jul 24, 2009, at 3:17, Brendan Jurd wrote: "ROW(NULL, NULL) IS NULL" returns true, but that is not the same as saying that it actually is NULL I think my head just exploded. Loving the dark corners of SQL… Best, David -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)

Re: [HACKERS] When is a record NULL?

2009-07-24 Thread Tom Lane
Jeff Davis writes: > There's no single test, but you can see if it's an empty row with: > x IS NULL AND x IS DISTINCT FROM NULL > And you can see if it's a "real" NULL by: > x IS NULL AND x IS NOT DISTINCT FROM NULL Hmmm ... that suggests that we may not be handling IS DISTINCT FROM correctly

Re: [HACKERS] When is a record NULL?

2009-07-24 Thread Tom Lane
Merlin Moncure writes: > I think the following should _not_ return true: > select (null, null)::somerowtype is null; Take it up with the SQL standards committee. The spec is 100% not ambiguous about this. regards, tom lane -- Sent via pgsql-hackers mailing list (pgsql-

Re: [HACKERS] [PATCH v4] [libpq] Try to avoid manually masking SIGPIPEs on every send()

2009-07-24 Thread Tom Lane
Jeremy Kerr writes: > Currently, libpq will wrap each send() call on the connection with > two system calls to mask SIGPIPEs. This results in 3 syscalls instead > of one, and (on Linux) can lead to high contention on the signal > mask locks in threaded apps. > We have a couple of other methods to

Re: [HACKERS] When is a record NULL?

2009-07-24 Thread Merlin Moncure
On Fri, Jul 24, 2009 at 1:35 PM, Merlin Moncure wrote: > On Fri, Jul 24, 2009 at 5:15 AM, David E. Wheeler wrote: >> On Jul 23, 2009, at 9:34 PM, Brendan Jurd wrote: >> >>> Well, a ROW is an ordered set of values, each one of which may be >>> either NULL or NOT NULL. >> >> Right. >> >>> It doesn't

Re: [HACKERS] When is a record NULL?

2009-07-24 Thread Merlin Moncure
On Fri, Jul 24, 2009 at 5:15 AM, David E. Wheeler wrote: > On Jul 23, 2009, at 9:34 PM, Brendan Jurd wrote: > >> Well, a ROW is an ordered set of values, each one of which may be >> either NULL or NOT NULL. > > Right. > >> It doesn't really make sense to talk about the ROW itself being NULL >> or N

Re: [HACKERS] WIP: Deferrable unique constraints

2009-07-24 Thread Jeff Davis
On Wed, 2009-07-22 at 12:25 +0100, Dean Rasheed wrote: > OK, here's an updated patch. One thing that Alvaro mentioned that you didn't do yet is use the macro to return from the function (either PG_RETURN_VOID() or PG_RETURN_NULL()). You seem to be following the document here: http://www.postgresq

Re: [HACKERS] When is a record NULL?

2009-07-24 Thread Kevin Grittner
Sam Mason wrote: > On Fri, Jul 24, 2009 at 09:31:13AM -0400, Tom Lane wrote: > Hope nobody minds if I go off on a somewhat pedagogic bent here! Not as long as you don't mind replies in kind. ;-) > The fact that it happens to be a NULL *value* in one case Well, according to Codd (and I te

Re: [HACKERS] WIP: plpython3

2009-07-24 Thread Joshua D. Drake
On Fri, 2009-07-24 at 04:24 -0700, James Pye wrote: > I see Python 3 as a good opportunity to change the interfaces and fix > the design of the PL. > > I dunno. I have time to give it some TLC, and I'm not terribly excited > about trying to tack features onto something that I find kinda gross

Re: [HACKERS] uuid contrib don't compile in OpenSolaris

2009-07-24 Thread Emanuel Calvo Franco
>> Hi all, >> >> I have some issues to compile uuid contrib of 8.4 version. >> >> Touching something i see that the gmake don't find uuid.h. >> (pfexec gmake -d) >> Touching more, i add uuid.h into the uuid directory and i had a >> error message: missing separator. > > Did you use gmake the second

Re: [HACKERS] uuid contrib don't compile in OpenSolaris

2009-07-24 Thread Alvaro Herrera
Emanuel Calvo Franco escribió: > Hi all, > > I have some issues to compile uuid contrib of 8.4 version. > > Touching something i see that the gmake don't find uuid.h. > (pfexec gmake -d) > Touching more, i add uuid.h into the uuid directory and i had a > error message: missing separator. Did you

Re: [HACKERS] When is a record NULL?

2009-07-24 Thread Sam Mason
On Fri, Jul 24, 2009 at 09:31:13AM -0400, Tom Lane wrote: > Brendan Jurd writes: > > So it is wrong to talk about ROW(NULL, NULL) being NULL. It doesn't > > have the property of being NULL or not NULL, because it is a composite > > value. "ROW(NULL, NULL) IS NULL" returns true, but that is not t

Re: [HACKERS] display previous query string of idle-in-transaction

2009-07-24 Thread Robert Haas
On Fri, Jul 24, 2009 at 11:15 AM, Tom Lane wrote: > Robert Haas writes: >> Hmm, I don't think we'd need two columns for this, actually.  You >> could just have one column last_statement_endtime (not sure if it's >> the best name, but something along those lines) which would be NULL if >> the state

[HACKERS] uuid contrib don't compile in OpenSolaris

2009-07-24 Thread Emanuel Calvo Franco
Hi all, I have some issues to compile uuid contrib of 8.4 version. Touching something i see that the gmake don't find uuid.h. (pfexec gmake -d) Touching more, i add uuid.h into the uuid directory and i had a error message: missing separator. So i google a little and i find something: http://www.

Re: [HACKERS] When is a record NULL?

2009-07-24 Thread Jeff Davis
On Fri, 2009-07-24 at 09:31 -0400, Tom Lane wrote: > Brendan Jurd writes: > It's worse than that, because there actually is also such a thing as > the row value being NULL --- ie, there's no row structure at all. > At least internally, that's a completely different thing from having > a row all of

Re: [HACKERS] bytea vs. pg_dump

2009-07-24 Thread Tom Lane
Bernd Helmle writes: > I've attached a slightly edited patch which fixes a compiler warning in > encode.c, too. Bernd, are you done reviewing this or did you intend to do more? It's still marked as "needs review" on the commitfest page. regards, tom lane -- Sent via pg

Re: [HACKERS] query decorrelation in postgres

2009-07-24 Thread mahendra chavan
Thank you for you response. I was looking for a query rewriting mechanism which would be outside the optimizer and will do this kind of transformations at the query level. ~Mahendra On Fri, Jul 24, 2009 at 7:32 PM, Kevin Grittner wrote: > mahendra chavan wrote: > > What I meant by de-correla

Re: [HACKERS] display previous query string of idle-in-transaction

2009-07-24 Thread Tom Lane
Robert Haas writes: > Hmm, I don't think we'd need two columns for this, actually. You > could just have one column last_statement_endtime (not sure if it's > the best name, but something along those lines) which would be NULL if > the statement was still in progress and the appropriate timestamp

Re: [HACKERS] display previous query string of idle-in-transaction

2009-07-24 Thread Kevin Grittner
Robert Haas wrote: > Hmm, I don't think we'd need two columns for this, actually. You > could just have one column last_statement_endtime (not sure if it's > the best name, but something along those lines) which would be NULL > if the statement was still in progress and the appropriate timesta

Re: [HACKERS] display previous query string of idle-in-transaction

2009-07-24 Thread Robert Haas
On Fri, Jul 24, 2009 at 10:47 AM, Kevin Grittner wrote: > daveg wrote: >> On Thu, Jun 04, 2009 at 10:22:41PM -0400, Robert Haas wrote: > >>> maybe make a separate column called "idle" that's a boolean, >>> or something, and let the query column contain the most recent >>> query (whether or not it'

Re: [HACKERS] display previous query string of idle-in-transaction

2009-07-24 Thread Kevin Grittner
daveg wrote: > On Thu, Jun 04, 2009 at 10:22:41PM -0400, Robert Haas wrote: >> maybe make a separate column called "idle" that's a boolean, >> or something, and let the query column contain the most recent >> query (whether or not it's still executing). +1 > I like this idea a lot. Possibly

Re: [HACKERS] join regression failure on cygwin

2009-07-24 Thread Andrew Dunstan
Tom Lane wrote: I wrote: Andrew Dunstan writes: It appears on Googling a bit that the erand48() is buggy in that it requires the seed to have been initialized with srand48() or it will constantly return 0.0. Huh, and that sends us into an infinite loop? I'll take a loo

Re: [HACKERS] join regression failure on cygwin

2009-07-24 Thread Tom Lane
I wrote: > Andrew Dunstan writes: >> It appears on Googling a bit that the erand48() is buggy in that it >> requires the seed to have been initialized with srand48() or it will >> constantly return 0.0. > Huh, and that sends us into an infinite loop? I'll take a look at that. > Even though it'

Re: [HACKERS] query decorrelation in postgres

2009-07-24 Thread Kevin Grittner
mahendra chavan wrote: > What I meant by de-correlation was optimizing a query to get rid of > sub-queirs by using joins. > > eg. In the TPC-H schema, a query to find out the names of suppliers > who supply parts having size < 100 > > *Query with nested subqueries:* > > SELECT > S_NAME >

Re: [HACKERS] When is a record NULL?

2009-07-24 Thread Tom Lane
Joshua Tolley writes: > On Thu, Jul 23, 2009 at 06:46:25PM -0700, David E. Wheeler >> Yes, but given that the standard says that `ROW(1, NULL)` is NULL, then I >> would expect it to be NOT DISTINCT from `ROW(2, NULL)`. > Wait, didn't we decide upthread that the standard said ROW(1, NULL) isn't

Re: [HACKERS] join removal

2009-07-24 Thread Robert Haas
On Fri, Jul 24, 2009 at 7:53 AM, Alex Brasetvik wrote: > > On Jul 17, 2009, at 04:27 , Robert Haas wrote: > >> - INNER joins are more complex because what happens on the inner side >> of the join can potentially wipe out rows from the result.  With a >> LEFT join, it's sufficient to prove that the

Re: [HACKERS] When is a record NULL?

2009-07-24 Thread Joshua Tolley
On Thu, Jul 23, 2009 at 06:46:25PM -0700, David E. Wheeler wrote: > Yes, but given that the standard says that `ROW(1, NULL)` is NULL, then I > would expect it to be NOT DISTINCT from `ROW(2, NULL)`. Wait, didn't we decide upthread that the standard said ROW(1, NULL) isn't NULL? (From Tom): > Th

Re: [HACKERS] join regression failure on cygwin

2009-07-24 Thread Tom Lane
Andrew Dunstan writes: > It appears on Googling a bit that the erand48() is buggy in that it > requires the seed to have been initialized with srand48() or it will > constantly return 0.0. Huh, and that sends us into an infinite loop? I'll take a look at that. Even though it's surely nonrandom

Re: [HACKERS] When is a record NULL?

2009-07-24 Thread Tom Lane
Brendan Jurd writes: > So it is wrong to talk about ROW(NULL, NULL) being NULL. It doesn't > have the property of being NULL or not NULL, because it is a composite > value. "ROW(NULL, NULL) IS NULL" returns true, but that is not the > same as saying that it actually is NULL, because of the diffe

Re: [HACKERS] When is a record NULL?

2009-07-24 Thread Michael Gould
Does this also apply at the column level? In Postgres is If column IS NOT NULL or If column IS NULL? Do all columns in the record have to be NULL to have IF column IS NULL = true? Best Regards -- Michael Gould, Managing Partner Intermodal Software Solutions, LLC 904.226.0978 904.592.5250 f

Re: [HACKERS] join regression failure on cygwin

2009-07-24 Thread Andrew Dunstan
Tom Lane wrote: I don't personally have a problem with just forcing use of our own erand48 on Cygwin; it's not a lot of code and it would make the behavior of that build more like the MSVC build. But it's curious that such a simple library function is seemingly broken on Cygwin ... especially

Re: [HACKERS] join removal

2009-07-24 Thread Alex Brasetvik
On Jul 17, 2009, at 04:27 , Robert Haas wrote: - INNER joins are more complex because what happens on the inner side of the join can potentially wipe out rows from the result. With a LEFT join, it's sufficient to prove that the inner rel is at least unique enough, but for an INNER join, we hav

Re: [HACKERS] WIP: plpython3

2009-07-24 Thread James Pye
On Jul 24, 2009, at 1:21 AM, Peter Eisentraut wrote: While various of these ideas may be good, I think you are setting yourself up for a rejection. Right, I supposed that that may be the case or at least that you would feel this way based on your messages from the prior thread. There is

Re: [HACKERS] When is a record NULL?

2009-07-24 Thread Brendan Jurd
2009/7/24 David E. Wheeler : > It's useful to learn that `ROW(NULL, NULL)` is NULL, but I find the whole > thing totally bizarre. Is it me? > *shrug* The IS [NOT] NULL tests mean something different when applied to a ROW than they do when applied to a scalar value or an array. "SELECT 1 IS NULL"

Re: [HACKERS] When is a record NULL?

2009-07-24 Thread Richard Huxton
David E. Wheeler wrote: On Jul 23, 2009, at 9:34 PM, Brendan Jurd wrote: I guess the spec authors figured they might as well make IS [NOT] NULL do something useful when applied to a row rather than throwing an error. I tend to agree. Frankly, I find the state where a record with a NULL and

Re: [HACKERS] When is a record NULL?

2009-07-24 Thread David E. Wheeler
On Jul 23, 2009, at 9:34 PM, Brendan Jurd wrote: Well, a ROW is an ordered set of values, each one of which may be either NULL or NOT NULL. Right. It doesn't really make sense to talk about the ROW itself being NULL or NOT NULL, only its member values (but for extra confusion, contrast with

Re: [HACKERS] [PATCH] DefaultACLs

2009-07-24 Thread Nikhil Sontakke
Hi, > I'd still like to have opinion from one of the commiters on "the > VIEW problem" which also affects grant on all patch ( see > http://archives.postgresql.org/pgsql-hackers/2009-07/msg00957.php ) and > I fear "returned with feedback" might prevent that until next commit fest. > > > I see pote

Re: [HACKERS] WIP: plpython3

2009-07-24 Thread Peter Eisentraut
On Friday 24 July 2009 01:23:40 James Pye wrote: > Here are the features that I plan/hope to implement before submitting > any patch: > > * Native Typing [Python types that represent Postgres types] > * Reworked function structure (Python modules, not function fragments) > * Improved SQL in

Re: [HACKERS] SE-PostgreSQL Specifications

2009-07-24 Thread Greg Williamson
Excellent ... I'll try to have something tomorrow (Friday PDT) but I've got some non-work related issues which may keep from giving this a good look until the weekend (FWIW). I'll post any questions I have. Thanks, Greg W. - Original Message From: KaiGai Kohei To: Robert Haas Cc:

Re: [HACKERS] Determining client_encoding from client locale

2009-07-24 Thread Magnus Hagander
On Fri, Jul 24, 2009 at 04:12, Jaime Casanova wrote: > On Mon, Jul 6, 2009 at 10:00 AM, Heikki > Linnakangas wrote: >> Here's my first attempt at setting client_encoding automatically from >> locale. >> > > Sorry for the many mails on this issue.. i will do a recolect of my findings: > > 1) it intr

Re: [HACKERS] Aggregate-function space leakage

2009-07-24 Thread Hitoshi Harada
2009/7/24 Tom Lane : > I think that WindowAgg does not need any changes because it already does > MemoryContextResetAndDeleteChildren(winstate->wincontext) at partition > boundaries.  Hitoshi, do you agree? > I do. Looking closer, temporal space management of Agg is getting similar to WindowAgg's