Re: [HACKERS] Range Types, discrete and/or continuous

2010-10-25 Thread David Fetter
On Sun, Oct 24, 2010 at 06:59:34PM -0400, Tom Lane wrote: Jeff Davis pg...@j-davis.com writes: Last development cycle, one of the questions that was unresolved was whether to handle ranges like a discrete set (that is, [1,5) = [1,4] ) or continuous or both. Put me in the camp that says

Re: [HACKERS] Range Types, discrete and/or continuous

2010-10-25 Thread Heikki Linnakangas
On 25.10.2010 01:59, Tom Lane wrote: Jeff Davispg...@j-davis.com writes: If we treat those as discrete, then R1 = R2, R1 contains R2, R2 contains R1, and R2 - R1 = R1 - R2 = empty. However, if we treat those as continuous, then we get a contradiction: R2 contains R1 R1 does not contain R2

[HACKERS] Extensible executor nodes for preparation of SQL/MED

2010-10-25 Thread Itagaki Takahiro
); ... -- Itagaki Takahiro extensible_execnodes-20101025.patch.gz Description: GNU Zip compressed data -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers

Re: [HACKERS] ask for review of MERGE

2010-10-25 Thread Kevin Grittner
Robert Haas wrote: What we're talking about is what happens when there are concurrent table modifications in progress; and the answer is that you might get serialization anomalies. But we have serialization anomalies without MERGE, too - see the discussions around Kevin Grittner's SSI

[HACKERS] bug in explain - core dump

2010-10-25 Thread Pavel Stehule
Hello On 9.1 I found a query where explain do backend crash backtrace Core was generated by `postgres: pavel postgres [local] EXPLAIN '. Program terminated with signal 6, Aborted. #0 0x003226c329a5 in raise () from /lib64/libc.so.6 Missing separate debuginfos, use:

Re: [HACKERS] security hook on authorization

2010-10-25 Thread KaiGai Kohei
Sorry for this late responding. I got a cold later half of the last week. (2010/10/20 12:10), Robert Haas wrote: On Wed, Oct 13, 2010 at 2:13 AM, Robert Haasrobertmh...@gmail.com wrote: 2010/8/24 KaiGai Koheikai...@ak.jp.nec.com: I tried to revise the patch. It allows plugins to get control

Re: [HACKERS] SQL/MED with simple wrappers

2010-10-25 Thread Pavel Stehule
Hello 4) List of foreign connections Users (especially DBAs?) might want to see list of foreign connections. Currently postgresql_fdw provides its own connection list via postgresql_fdw_connections view.  Common view such as pg_foreign_connections would be needed?  If so, function which

Re: [HACKERS] find -path isn't portable

2010-10-25 Thread Alvaro Herrera
Excerpts from Alvaro Herrera's message of jue oct 21 18:06:40 -0300 2010: Excerpts from Tom Lane's message of jue oct 21 17:48:18 -0300 2010: buildfarm member koi, having recently been rescued from git purgatory, is failing like this: which indicates it can't cope with your recent patch to

Re: [HACKERS] O_DSYNC broken on MacOS X?

2010-10-25 Thread Robert Haas
On Tue, Oct 19, 2010 at 11:06 AM, Bruce Momjian br...@momjian.us wrote: Robert Haas wrote: On Thu, Oct 7, 2010 at 11:52 AM, Tom Lane t...@sss.pgh.pa.us wrote: Robert Haas robertmh...@gmail.com writes: Proposed doc patch attached. discusesed? ?Otherwise +1 Woops, thanks.  Committed with

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

2010-10-25 Thread Alvaro Herrera
Excerpts from Alvaro Herrera's message of vie oct 22 17:02:22 -0300 2010: Excerpts from Dimitri Fontaine's message of vie oct 22 16:21:14 -0300 2010: I'll go rework the patch sometime later to drop the name from the control file, but that also means fixing several contrib modules by

Re: [HACKERS] Range Types, discrete and/or continuous

2010-10-25 Thread Tom Lane
David Fetter da...@fetter.org writes: On Sun, Oct 24, 2010 at 06:59:34PM -0400, Tom Lane wrote: Put me in the camp that says you need both. I really seriously dislike the idea of representing [1, 2) as [1, 2-epsilon], mainly because there is often no portable value for epsilon.

Re: [HACKERS] bug in explain - core dump

2010-10-25 Thread Tom Lane
Pavel Stehule pavel.steh...@gmail.com writes: On 9.1 I found a query where explain do backend crash Can't reproduce here. Would you provide a self-contained test case? regards, tom lane -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make

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

2010-10-25 Thread Alvaro Herrera
Excerpts from Alvaro Herrera's message of lun oct 25 10:37:22 -0300 2010: Excerpts from Alvaro Herrera's message of vie oct 22 17:02:22 -0300 2010: I'll go rework the patch sometime later to drop the name from the control file, but that also means fixing several contrib modules by

Re: [HACKERS] Extensible executor nodes for preparation of SQL/MED

2010-10-25 Thread Tom Lane
Itagaki Takahiro itagaki.takah...@gmail.com writes: SQL/MED will have some kinds of planner hooks to support FDW-depending plan execution. Then, we will need to support user-defined executor nodes. The proposed SQL/MED has own executor node hooks in ForeignTableScan,

Re: [HACKERS] bug in explain - core dump

2010-10-25 Thread Pavel Stehule
postgres=# \i crash.sql version ── PostgreSQL 9.1devel on x86_64-unknown-linux-gnu, compiled by GCC gcc (GCC) 4.4.4 20100630 (Red Hat 4.4.4…

Re: [HACKERS] Range Types, discrete and/or continuous

2010-10-25 Thread David Fetter
On Mon, Oct 25, 2010 at 10:21:49AM -0400, Tom Lane wrote: David Fetter da...@fetter.org writes: On Sun, Oct 24, 2010 at 06:59:34PM -0400, Tom Lane wrote: Put me in the camp that says you need both. I really seriously dislike the idea of representing [1, 2) as [1, 2-epsilon], mainly

Re: [HACKERS] [BUGS] Segfault in 9.0 inlining SRF

2010-10-25 Thread Brendan Jurd
On 25 October 2010 07:36, Tom Lane t...@sss.pgh.pa.us wrote: Brendan Jurd dire...@gmail.com writes: I have encountered a reproducible segfault in Postgres ... Looks like the invalItems list has been clobbered: (gdb) p *root-glob-invalItems $6 = {type = 2139062143, length = 2139062143, head

[HACKERS] add label to enum syntax

2010-10-25 Thread Andrew Dunstan
It occurred to me in the dead of the night that instead of: ALTER TYPE enumtype ADD 'newlabel' it might be better to have: ALTER TYPE enumtype ADD LABEL 'newlabel' That way if we later wanted to support some other sort of ADD operation on types we would be able to more easily. LABEL

Re: [HACKERS] add label to enum syntax

2010-10-25 Thread Pavel Stehule
2010/10/25 Andrew Dunstan and...@dunslane.net: It occurred to me in the dead of the night that instead of:   ALTER TYPE enumtype ADD 'newlabel' it might be better to have:   ALTER TYPE enumtype ADD LABEL 'newlabel' +1 Regards Pavel That way if we later wanted to support some other

[HACKERS] Composite Types and Function Parameters

2010-10-25 Thread Greg
Hi guys, got across an interesting problem of passing params to a function in postgre: is it possible to pass a composite parameter to a function without declaring a type first? For example: // declare a function create function TEST ( object??? )       object???.paramName    // using

Re: [HACKERS] add label to enum syntax

2010-10-25 Thread Robert Haas
On Mon, Oct 25, 2010 at 11:57 AM, Pavel Stehule pavel.steh...@gmail.com wrote: 2010/10/25 Andrew Dunstan and...@dunslane.net: It occurred to me in the dead of the night that instead of:   ALTER TYPE enumtype ADD 'newlabel' it might be better to have:   ALTER TYPE enumtype ADD LABEL

Re: [HACKERS] [BUGS] Segfault in 9.0 inlining SRF

2010-10-25 Thread Tom Lane
Brendan Jurd dire...@gmail.com writes: On 25 October 2010 07:36, Tom Lane t...@sss.pgh.pa.us wrote: I'm guessing it was modified in the temporary memory context and not properly copied out to the parent context when we finished inlining the function. Thanks for the hint; I found that the

Re: [HACKERS] add label to enum syntax

2010-10-25 Thread Peter Eisentraut
On mån, 2010-10-25 at 11:48 -0400, Andrew Dunstan wrote: It occurred to me in the dead of the night that instead of: ALTER TYPE enumtype ADD 'newlabel' it might be better to have: ALTER TYPE enumtype ADD LABEL 'newlabel' That had occurred to me as well. Go for it. -- Sent

Re: [HACKERS] Composite Types and Function Parameters

2010-10-25 Thread Pavel Stehule
Hello I am thinking, so it isn't possible. There are a general datatype anyelement, but it cannot accept a second general type record. CREATE TYPE p AS (a text, b int, c bool); CREATE OR REPLACE FUNCTION fp(p) RETURNS int AS $$ BEGIN RAISE NOTICE 'a = %', $1.a; RETURN $1.b; END; $$ LANGUAGE

Re: [HACKERS] Range Types, discrete and/or continuous

2010-10-25 Thread Jeff Davis
On Sun, 2010-10-24 at 18:59 -0400, Tom Lane wrote: Jeff Davis pg...@j-davis.com writes: Last development cycle, one of the questions that was unresolved was whether to handle ranges like a discrete set (that is, [1,5) = [1,4] ) or continuous or both. Put me in the camp that says you need

Re: [HACKERS] O_DSYNC broken on MacOS X?

2010-10-25 Thread Peter Eisentraut
On mån, 2010-10-25 at 09:33 -0400, Robert Haas wrote: It seems we're still missing some relevant details, because hdparm doesn't seem to work on SCSI devices. Is sdparm the right utility in that case? Does anyone know what the correct incantations look like? Search the sdparm man page for

Re: [HACKERS] Range Types, discrete and/or continuous

2010-10-25 Thread Robert Haas
On Mon, Oct 25, 2010 at 12:51 PM, Jeff Davis pg...@j-davis.com wrote: On Sun, 2010-10-24 at 18:59 -0400, Tom Lane wrote: Jeff Davis pg...@j-davis.com writes: Last development cycle, one of the questions that was unresolved was whether to handle ranges like a discrete set (that is, [1,5) =

Re: [HACKERS] add label to enum syntax

2010-10-25 Thread Tom Lane
Andrew Dunstan and...@dunslane.net writes: It occurred to me in the dead of the night that instead of: ALTER TYPE enumtype ADD 'newlabel' it might be better to have: ALTER TYPE enumtype ADD LABEL 'newlabel' That way if we later wanted to support some other sort of ADD operation on

Re: [HACKERS] [BUGS] Segfault in 9.0 inlining SRF

2010-10-25 Thread Brendan Jurd
On 26 October 2010 03:42, Tom Lane t...@sss.pgh.pa.us wrote: Brendan Jurd dire...@gmail.com writes: Thanks for the hint; I found that the attached patch resolved my specific segfault, but I am wondering whether it goes far enough. Well, it definitely doesn't go far enough, because the

Re: [HACKERS] Range Types, discrete and/or continuous

2010-10-25 Thread Kevin Grittner
Jeff Davis pg...@j-davis.com wrote: Last development cycle, one of the questions that was unresolved was whether to handle ranges like a discrete set (that is, [1,5) = [1,4] ) or continuous or both. I think that discrete ranges are required. For instance, day range and IP address ranges

Re: [HACKERS] [BUGS] Segfault in 9.0 inlining SRF

2010-10-25 Thread Tom Lane
Brendan Jurd dire...@gmail.com writes: This whole business of passing around global pointers while switching memory contexts seems like an optimal breeding-ground for bugs. Yeah. If it were to get significantly more complicated than this, the best solution IMO would be to give up on trying to

Re: [HACKERS] ask for review of MERGE

2010-10-25 Thread Greg Stark
On Sun, Oct 24, 2010 at 10:43 AM, Robert Haas robertmh...@gmail.com wrote: But let's back up and talk about MVCC for a minute.  Suppose we have three source tuples, (1), (2), and (3); and the target table contains tuples (1) and (2), of which only (1) is visible to our MVCC snapshot; suppose

Re: [HACKERS] Range Types, discrete and/or continuous

2010-10-25 Thread Jeff Davis
On Mon, 2010-10-25 at 12:20 -0500, Kevin Grittner wrote: It would be very useful to be able to specify a granularity -- for example timestamps with a five minute granularity would be useful for scheduling appointments. In some cases the granularity might be inferred -- if we have a domain

Re: [HACKERS] add label to enum syntax

2010-10-25 Thread David E. Wheeler
On Oct 25, 2010, at 10:08 AM, Tom Lane wrote: I can see the point of that, but I don't find LABEL to be a particularly great name for the elements of an enum type, and so I'm not in favor of institutionalizing that name in the syntax. How about ADD VALUE? From the fine manual: The second

Re: [HACKERS] ask for review of MERGE

2010-10-25 Thread Kevin Grittner
Greg Stark gsst...@mit.edu wrote: Robert Haas robertmh...@gmail.com wrote: But let's back up and talk about MVCC for a minute. Suppose we have three source tuples, (1), (2), and (3); and the target table contains tuples (1) and (2), of which only (1) is visible to our MVCC snapshot; suppose

Re: [HACKERS] ask for review of MERGE

2010-10-25 Thread Robert Haas
On Mon, Oct 25, 2010 at 1:42 PM, Greg Stark gsst...@mit.edu wrote: On Sun, Oct 24, 2010 at 10:43 AM, Robert Haas robertmh...@gmail.com wrote: But let's back up and talk about MVCC for a minute.  Suppose we have three source tuples, (1), (2), and (3); and the target table contains tuples (1)

Re: [HACKERS] Range Types, discrete and/or continuous

2010-10-25 Thread Robert Haas
On Mon, Oct 25, 2010 at 2:01 PM, Jeff Davis pg...@j-davis.com wrote: On Mon, 2010-10-25 at 12:20 -0500, Kevin Grittner wrote: It would be very useful to be able to specify a granularity -- for example timestamps with a five minute granularity would be useful for scheduling appointments. In

Re: [HACKERS] bug in explain - core dump

2010-10-25 Thread Tom Lane
Pavel Stehule pavel.steh...@gmail.com writes: DROP TABLE IF EXISTS foo; CREATE TABLE foo(a int, b int); INSERT INTO foo SELECT (random()*1)::int, (random()*10)::int from generate_series(1,10); ANALYZE foo; CREATE INDEX ON foo(a,b); CREATE INDEX ON foo(b,a); EXPLAIN SELECT

Re: [HACKERS] Range Types, discrete and/or continuous

2010-10-25 Thread Jeff Davis
On Mon, 2010-10-25 at 13:00 -0400, Robert Haas wrote: I'm still confused. It seems to me (and maybe I'm full of it) that the distinction between continuous ranges and discrete ranges is pretty minor. Suppose you have continuous ranges done, and working. The only thing you need to add for

Re: [HACKERS] Floating-point timestamps versus Range Types

2010-10-25 Thread James Cloos
JD == Jeff Davis pg...@j-davis.com writes: JD 2. Fix the input/output functions in a special mode for dump/reload, JDto make them true inverses. That can be done by supporting the %A printf(3)/scanf(3) format. -JimC -- James Cloos cl...@jhcloos.com OpenPGP: 1024D/ED7DAEA6 --

Re: [HACKERS] add label to enum syntax

2010-10-25 Thread Tom Lane
David E. Wheeler da...@kineticode.com writes: On Oct 25, 2010, at 10:08 AM, Tom Lane wrote: I can see the point of that, but I don't find LABEL to be a particularly great name for the elements of an enum type, and so I'm not in favor of institutionalizing that name in the syntax. How about

Re: [HACKERS] Range Types, discrete and/or continuous

2010-10-25 Thread Jeff Davis
On Mon, 2010-10-25 at 14:11 -0400, Robert Haas wrote: On Mon, Oct 25, 2010 at 2:01 PM, Jeff Davis pg...@j-davis.com wrote: On Mon, 2010-10-25 at 12:20 -0500, Kevin Grittner wrote: It would be very useful to be able to specify a granularity -- for example timestamps with a five minute

Re: [HACKERS] add label to enum syntax

2010-10-25 Thread Robert Haas
On Mon, Oct 25, 2010 at 2:41 PM, Tom Lane t...@sss.pgh.pa.us wrote: David E. Wheeler da...@kineticode.com writes: On Oct 25, 2010, at 10:08 AM, Tom Lane wrote: I can see the point of that, but I don't find LABEL to be a particularly great name for the elements of an enum type, and so I'm not

Re: [HACKERS] Floating-point timestamps versus Range Types

2010-10-25 Thread Jeff Davis
On Mon, 2010-10-25 at 13:54 -0400, James Cloos wrote: JD == Jeff Davis pg...@j-davis.com writes: JD 2. Fix the input/output functions in a special mode for dump/reload, JDto make them true inverses. That can be done by supporting the %A printf(3)/scanf(3) format. I don't happen to

[HACKERS] foreign keys for array/period contains relationships

2010-10-25 Thread Peter Eisentraut
Currently, foreign keys only work with the = operator (the name might be different, but it needs to behave like equality). I'm thinking there are other scenarios that could be useful, for example with arrays and range types. Example #1: Foreign key side is an array, every member must match some

Re: [HACKERS] ask for review of MERGE

2010-10-25 Thread Kevin Grittner
Robert Haas robertmh...@gmail.com wrote: rhaas=# create table concurrent (x integer primary key); NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index concurrent_pkey for table concurrent CREATE TABLE rhaas=# insert into x values (1); rhaas=# begin; BEGIN rhaas=# insert into

Re: [HACKERS] foreign keys for array/period contains relationships

2010-10-25 Thread Greg Stark
On Mon, Oct 25, 2010 at 12:11 PM, Peter Eisentraut pete...@gmx.net wrote: Is this sort of thing feasible?  Has anyone done more research into the necessary details? I think the problems arise when you try to figure out what records you need to lock to prevent someone from deleting the

Re: [HACKERS] ask for review of MERGE

2010-10-25 Thread Robert Haas
On Mon, Oct 25, 2010 at 3:15 PM, Kevin Grittner kevin.gritt...@wicourts.gov wrote: Robert Haas robertmh...@gmail.com wrote: rhaas=# create table concurrent (x integer primary key); NOTICE:  CREATE TABLE / PRIMARY KEY will create implicit index concurrent_pkey for table concurrent CREATE

Re: [HACKERS] foreign keys for array/period contains relationships

2010-10-25 Thread Robert Haas
On Mon, Oct 25, 2010 at 3:11 PM, Peter Eisentraut pete...@gmx.net wrote: Currently, foreign keys only work with the = operator (the name might be different, but it needs to behave like equality).  I'm thinking there are other scenarios that could be useful, for example with arrays and range

Re: [HACKERS] add label to enum syntax

2010-10-25 Thread Andrew Dunstan
On 10/25/2010 02:51 PM, Robert Haas wrote: On Mon, Oct 25, 2010 at 2:41 PM, Tom Lanet...@sss.pgh.pa.us wrote: David E. Wheelerda...@kineticode.com writes: On Oct 25, 2010, at 10:08 AM, Tom Lane wrote: I can see the point of that, but I don't find LABEL to be a particularly great name for

Re: [HACKERS] add label to enum syntax

2010-10-25 Thread Kevin Grittner
Andrew Dunstan and...@dunslane.net wrote: Personally, I prefer LABEL. But I could live with VALUE. That's roughly my position. LABEL would seem more natural to me. I would tend to think of the VALUE as the hidden number which determines the order. -Kevin -- Sent via pgsql-hackers

Re: [HACKERS] Floating-point timestamps versus Range Types

2010-10-25 Thread James Cloos
JD == Jeff Davis pg...@j-davis.com writes: JD 2. Fix the input/output functions in a special mode for dump/reload, JD to make them true inverses. JC That can be done by supporting the %A printf(3)/scanf(3) format. JD I don't happen to see a %A format in the man page, but I doubt the JD output

[HACKERS] Tab completion for view triggers in psql

2010-10-25 Thread David Fetter
Folks, Please find attached patch for $subject :) Cheers, David. -- David Fetter da...@fetter.org http://fetter.org/ Phone: +1 415 235 3778 AIM: dfetter666 Yahoo!: dfetter Skype: davidfetter XMPP: david.fet...@gmail.com iCal: webcal://www.tripit.com/feed/ical/people/david74/tripit.ics

Re: [HACKERS] add label to enum syntax

2010-10-25 Thread Pavel Stehule
2010/10/25 Andrew Dunstan and...@dunslane.net: On 10/25/2010 02:51 PM, Robert Haas wrote: On Mon, Oct 25, 2010 at 2:41 PM, Tom Lanet...@sss.pgh.pa.us  wrote: David E. Wheelerda...@kineticode.com  writes: On Oct 25, 2010, at 10:08 AM, Tom Lane wrote: I can see the point of that, but I

Re: [HACKERS] Floating-point timestamps versus Range Types

2010-10-25 Thread Tom Lane
James Cloos cl...@jhcloos.com writes: That said, the possiblity of hex i/o format for the float datatypes would be welcome. It's unportable, for two different reasons: 1. pg_dump output would become platform-specific. This is highly undesirable. 2. The printf specifiers you want us to rely

Re: [HACKERS] foreign keys for array/period contains relationships

2010-10-25 Thread Pavel Stehule
2010/10/25 Robert Haas robertmh...@gmail.com: On Mon, Oct 25, 2010 at 3:11 PM, Peter Eisentraut pete...@gmx.net wrote: Currently, foreign keys only work with the = operator (the name might be different, but it needs to behave like equality).  I'm thinking there are other scenarios that could

Re: [HACKERS] ask for review of MERGE

2010-10-25 Thread Greg Stark
On Mon, Oct 25, 2010 at 12:40 PM, Robert Haas robertmh...@gmail.com wrote: Now, as Greg says, that might be what some people want, but it's certainly monumentally unserializable. To be clear when I said it's what people want what I meant was that in the common cases it's doing exactly what

Re: [HACKERS] add label to enum syntax

2010-10-25 Thread Andrew Dunstan
On 10/25/2010 04:03 PM, Pavel Stehule wrote: 2010/10/25 Andrew Dunstanand...@dunslane.net: On 10/25/2010 02:51 PM, Robert Haas wrote: Personally, I prefer LABEL. But I could live with VALUE. That's roughly my position. It would be consistent with the name we use in the catalogs, as well

Re: [HACKERS] ask for review of MERGE

2010-10-25 Thread Kevin Grittner
Robert Haas robertmh...@gmail.com wrote: Kevin Grittner kevin.gritt...@wicourts.gov wrote: I would have thought that the INSERT would have created an in doubt tuple which would block the UPDATE. This is just standard MVCC - readers don't block writers, nor writers readers. Sure, but I

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

2010-10-25 Thread Alvaro Herrera
Excerpts from Dimitri Fontaine's message of vie oct 22 16:43:56 -0300 2010: Dimitri Fontaine dimi...@2ndquadrant.fr writes: For information, when we talk about performance problem, please note that on my workstation with a default setup (not that it's important here) we're talking about

Re: [HACKERS] add label to enum syntax

2010-10-25 Thread Tom Lane
Andrew Dunstan and...@dunslane.net writes: LABEL is already an unreserved keyword, and I'm pretty sure that's all we'll need. The only reason it's a keyword is the SECURITY LABEL patch that went in a month or so ago; which is syntax that might still be thought better of before it gets to a

Re: [HACKERS] Floating-point timestamps versus Range Types

2010-10-25 Thread James Cloos
TL == Tom Lane t...@sss.pgh.pa.us writes: JC That said, the possiblity of hex i/o format for the float datatypes JC would be welcome. TL It's unportable, for two different reasons: TL 2. The printf specifiers you want us to rely on are not standard. They are in C99. TL 1. pg_dump output

Re: [HACKERS] ask for review of MERGE

2010-10-25 Thread Robert Haas
On Mon, Oct 25, 2010 at 4:10 PM, Greg Stark gsst...@mit.edu wrote: On Mon, Oct 25, 2010 at 12:40 PM, Robert Haas robertmh...@gmail.com wrote: Now, as Greg says, that might be what some people want, but it's certainly monumentally unserializable. To be clear when I said it's what people want

Re: [HACKERS] Floating-point timestamps versus Range Types

2010-10-25 Thread Robert Haas
On Mon, Oct 25, 2010 at 4:35 PM, James Cloos cl...@jhcloos.com wrote: TL == Tom Lane t...@sss.pgh.pa.us writes: JC That said, the possiblity of hex i/o format for the float datatypes JC would be welcome. TL It's unportable, for two different reasons: TL 2. The printf specifiers you want us

Re: [HACKERS] Range Types, discrete and/or continuous

2010-10-25 Thread Robert Haas
On Mon, Oct 25, 2010 at 2:27 PM, Jeff Davis pg...@j-davis.com wrote: On Mon, 2010-10-25 at 13:00 -0400, Robert Haas wrote: I'm still confused.  It seems to me (and maybe I'm full of it) that the distinction between continuous ranges and discrete ranges is pretty minor.  Suppose you have

[HACKERS] Bug: citext not working in non-public schema

2010-10-25 Thread Anders Steinlein
Researching a nasty bug discovered in our application led me to this bug report and its follow-ups: http://archives.postgresql.org/pgsql-bugs/2010-03/msg00058.php This bit us hard (on PostgreSQL 8.4.4). We have a custom domain for email addresses based on citext, placed in the public schema,

Re: [HACKERS] Range Types, discrete and/or continuous

2010-10-25 Thread Robert Haas
On Mon, Oct 25, 2010 at 2:44 PM, Jeff Davis pg...@j-davis.com wrote: On Mon, 2010-10-25 at 14:11 -0400, Robert Haas wrote: On Mon, Oct 25, 2010 at 2:01 PM, Jeff Davis pg...@j-davis.com wrote: On Mon, 2010-10-25 at 12:20 -0500, Kevin Grittner wrote: It would be very useful to be able to

Re: [HACKERS] Composite Types and Function Parameters

2010-10-25 Thread Greg
Hi Pavel, thanks! Yeah, thats what I though. I have to have a custom type or a very ugly looking solution for passing the params then. To Postgre dev. team: If anyone who involved in Postgre development reading this, just a feature suggestion: allow array that can accept combination of any

Re: [HACKERS] Bug: citext not working in non-public schema

2010-10-25 Thread Tom Lane
Anders Steinlein and...@steinlein.no writes: http://archives.postgresql.org/pgsql-bugs/2010-03/msg00058.php This bit us hard (on PostgreSQL 8.4.4). We have a custom domain for email addresses based on citext, placed in the public schema, while each user of our application has their own

Re: [HACKERS] Composite Types and Function Parameters

2010-10-25 Thread Merlin Moncure
On Mon, Oct 25, 2010 at 6:38 PM, Greg grigo...@yahoo.co.uk wrote: Hi Pavel, thanks! Yeah, thats what I though. I have to have a custom type or a very ugly looking solution for passing the params then. To Postgre dev. team: If anyone who involved in Postgre development reading this, just a

Re: [HACKERS] Composite Types and Function Parameters

2010-10-25 Thread Tom Lane
Merlin Moncure mmonc...@gmail.com writes: probably hstore would be more appropriate for something like that. An array is certainly completely the wrong thing if you don't intend all the items to be the same datatype... You can also declare functions taking composite arrays, anyarray, variadic

Re: [HACKERS] Range Types, discrete and/or continuous

2010-10-25 Thread Jeff Davis
On Mon, 2010-10-25 at 18:28 -0400, Robert Haas wrote: Oh, maybe I'm confused. Are you saying you'd need multiple copies of the base type, or multiple range types based on a single base type? The latter. That is, if you want a timestamp range with granularity 1 second, and a timestamp range

Re: [HACKERS] Range Types, discrete and/or continuous

2010-10-25 Thread Jeff Davis
On Mon, 2010-10-25 at 18:03 -0400, Robert Haas wrote: Hmm. Do you have some concrete examples of cases where a range type might want to do some representational optimization? Let's say for instance you want to keep an timestamp range in 16 bytes. You could have an 8-byte timestamp, a 7-byte

Re: [HACKERS] foreign keys for array/period contains relationships

2010-10-25 Thread Jeff Davis
On Mon, 2010-10-25 at 12:34 -0700, Greg Stark wrote: On Mon, Oct 25, 2010 at 12:11 PM, Peter Eisentraut pete...@gmx.net wrote: Is this sort of thing feasible? Has anyone done more research into the necessary details? I think the problems arise when you try to figure out what records you

Re: [HACKERS] foreign keys for array/period contains relationships

2010-10-25 Thread Jeff Davis
On Mon, 2010-10-25 at 22:11 +0300, Peter Eisentraut wrote: Currently, foreign keys only work with the = operator (the name might be different, but it needs to behave like equality). I'm thinking there are other scenarios that could be useful, for example with arrays and range types. I agree

Re: [HACKERS] Range Types, discrete and/or continuous

2010-10-25 Thread Robert Haas
On Mon, Oct 25, 2010 at 8:01 PM, Jeff Davis pg...@j-davis.com wrote: On Mon, 2010-10-25 at 18:28 -0400, Robert Haas wrote: Oh, maybe I'm confused.  Are you saying you'd need multiple copies of the base type, or multiple range types based on a single base type? The latter. That is, if you want

Re: [HACKERS] foreign keys for array/period contains relationships

2010-10-25 Thread Greg Stark
On Mon, Oct 25, 2010 at 5:24 PM, Jeff Davis pg...@j-davis.com wrote: I think that's easier when the PK must contain the FK, because then you only need to lock one record. Even when you need to lock multiple records, it seems feasible, and is just an index lookup, right? Do you see a particular

Re: [HACKERS] Composite Types and Function Parameters

2010-10-25 Thread David E. Wheeler
On Oct 25, 2010, at 4:12 PM, Tom Lane wrote: However, that objection doesn't hold for plperl or pltcl (and likely not plpython, though I don't know that language enough to be sure). So it would be a reasonable feature request to teach those PLs to accept record parameters. I think the fact

Re: [HACKERS] Range Types, discrete and/or continuous

2010-10-25 Thread Robert Haas
On Mon, Oct 25, 2010 at 8:13 PM, Jeff Davis pg...@j-davis.com wrote: On Mon, 2010-10-25 at 18:03 -0400, Robert Haas wrote: Hmm.  Do you have some concrete examples of cases where a range type might want to do some representational optimization? Let's say for instance you want to keep an

Re: [HACKERS] Tab completion for view triggers in psql

2010-10-25 Thread Itagaki Takahiro
On Tue, Oct 26, 2010 at 5:01 AM, David Fetter da...@fetter.org wrote: Please find attached patch for $subject :) Thank you for maintaining psql tab completion, but I'm not sure whether tgtype is the best column for the purpose. How about has_table_privilege() to filter candidate relations in

Re: [HACKERS] xlog.c: WALInsertLock vs. WALWriteLock

2010-10-25 Thread Robert Haas
On Fri, Oct 22, 2010 at 3:08 PM, fazool mein fazoolm...@gmail.com wrote: I'm writing a function that will read data from the buffer in xlog (i.e. from XLogCtl-pages and XLogCtl-xlblocks). I want to make sure that I am doing it correctly. For reading from the buffer, do I need to lock

Re: [HACKERS] Composite Types and Function Parameters

2010-10-25 Thread Andrew Dunstan
On 10/25/2010 07:12 PM, Tom Lane wrote: However, that objection doesn't hold for plperl or pltcl (and likely not plpython, though I don't know that language enough to be sure). So it would be a reasonable feature request to teach those PLs to accept record parameters. I think the fact that

Re: [HACKERS] security hook on authorization

2010-10-25 Thread Robert Haas
On Mon, Oct 25, 2010 at 8:51 AM, KaiGai Kohei kai...@kaigai.gr.jp wrote: One possible candidate is CheckMyDatabase() that checks ACL_CONNECT permission for the required database prior to execution of all the queries. Currently, we don't have any security hook around here. But, if we have

Re: [HACKERS] Tab completion for view triggers in psql

2010-10-25 Thread David Fetter
On Tue, Oct 26, 2010 at 10:30:49AM +0900, Itagaki Takahiro wrote: On Tue, Oct 26, 2010 at 5:01 AM, David Fetter da...@fetter.org wrote: Please find attached patch for $subject :) Thank you for maintaining psql tab completion, but I'm not sure whether tgtype is the best column for the

Re: [HACKERS] Tab completion for view triggers in psql

2010-10-25 Thread Itagaki Takahiro
On Tue, Oct 26, 2010 at 10:53 AM, David Fetter da...@fetter.org wrote: How about has_table_privilege() to filter candidate relations That's orthogonal to tgtype (snip) Shall I send a new patch with that added? Do we need to 'add' it? I intended to replace the JOIN with pg_trigger to

Re: [HACKERS] Tab completion for view triggers in psql

2010-10-25 Thread David Fetter
On Tue, Oct 26, 2010 at 11:10:53AM +0900, Itagaki Takahiro wrote: On Tue, Oct 26, 2010 at 10:53 AM, David Fetter da...@fetter.org wrote: How about has_table_privilege() to filter candidate relations That's orthogonal to tgtype (snip) Shall I send a new patch with that added? Do we need

Re: [HACKERS] Tab completion for view triggers in psql

2010-10-25 Thread Itagaki Takahiro
On Tue, Oct 26, 2010 at 11:34 AM, David Fetter da...@fetter.org wrote: Do we need to 'add' it? Possibly.  My understanding is that it couldn't really replace it. Ah, I see. I was wrong. We can have modification privileges for views even if they have no INSTEAD OF triggers. So, I think your

Re: [HACKERS] Extensible executor nodes for preparation of SQL/MED

2010-10-25 Thread Itagaki Takahiro
On Tue, Oct 26, 2010 at 12:28 AM, Tom Lane t...@sss.pgh.pa.us wrote: But it might be a good change anyway from a performance standpoint, in case a call through a function pointer is faster than a big switch. Have you tried benchmarking it on common platforms? I didn't intend performance, but

Re: [HACKERS] security hook on authorization

2010-10-25 Thread kaigai
On Mon, 25 Oct 2010 21:45:23 -0400 Robert Haas robertmh...@gmail.com wrote: On Mon, Oct 25, 2010 at 8:51 AM, KaiGai Kohei kai...@kaigai.gr.jp wrote: One possible candidate is CheckMyDatabase() that checks ACL_CONNECT permission for the required database prior to execution of all the