Re: [HACKERS] string_to_array with an empty input string

2010-08-11 Thread Greg Stark
On Wed, Aug 11, 2010 at 12:37 AM, Peter Geoghegan peter.geoghega...@gmail.com wrote: On 10 August 2010 19:48, David E. Wheeler da...@kineticode.com wrote: On Aug 10, 2010, at 11:46 AM, Thom Brown wrote: I, personally, would expect an empty array output given an empty input, and a null output

Re: [HACKERS] string_to_array with an empty input string

2010-08-11 Thread Greg Stark
There's already been one rather-long thread on this topic. http://thread.gmane.org/gmane.comp.db.postgresql.general/121450 In there I argue for the empty array interpretation and Tom goes back and forth a few times. I'm not sure where that thread ended though. -- greg -- Sent via

Re: [HACKERS] Cost of AtEOXact_Buffers in --enable-cassert

2010-08-11 Thread Andres Freund
On Wed, Aug 11, 2010 at 12:51:36AM -0400, Greg Smith wrote: Andres Freund wrote: The most prohibitively expensive part is the AtEOXact_Buffers check of running through all buffers and checking their pin count. And it makes $app's regression tests take thrice their time... Have you tried

Re: [HACKERS] assertions and constraint triggers

2010-08-11 Thread Marko Tiikkaja
On 8/11/10 8:31 AM +0300, Peter Eisentraut wrote: Thinking about SQL assertions (check constraints that are independent of one particular table), do you think it would be reasonable to implement those on top of constraint triggers? On creation you'd hook up a trigger to each of the affected

Re: [HACKERS] Bug / shortcoming in has_*_privilege

2010-08-11 Thread Simon Riggs
On Thu, 2010-06-10 at 23:18 -0400, Tom Lane wrote: Robert Haas robertmh...@gmail.com writes: On Thu, Jun 10, 2010 at 5:54 PM, Jim Nasby j...@nasby.net wrote: So there's no way to see if a particular privilege has been granted to public. ISTM 'public' should be accepted, since you can't use

Re: [HACKERS] Regression tests versus the buildfarm environment

2010-08-11 Thread Vik Reykja
On Wed, Aug 11, 2010 at 06:42, Tom Lane t...@sss.pgh.pa.us wrote: I am not sure if there's anything very good we can do about the problem of pg_regress misidentifying the postmaster it's managed to connect to. A real solution would probably be much more trouble than it's worth, anyway.

Re: [HACKERS] assertions and constraint triggers

2010-08-11 Thread Simon Riggs
On Wed, 2010-08-11 at 08:31 +0300, Peter Eisentraut wrote: Thinking about SQL assertions (check constraints that are independent of one particular table), do you think it would be reasonable to implement those on top of constraint triggers? On creation you'd hook up a trigger to each of the

Re: [HACKERS] assertions and constraint triggers

2010-08-11 Thread Nicolas Barbier
2010/8/11 Marko Tiikkaja marko.tiikk...@cs.helsinki.fi: On 8/11/10 8:31 AM +0300, Peter Eisentraut wrote: Thinking about SQL assertions (check constraints that are independent of one particular table), do you think it would be reasonable to implement those on top of constraint triggers?  On

Re: [HACKERS] MERGE Specification

2010-08-11 Thread Boxuan Zhai
On Wed, Aug 11, 2010 at 12:18 PM, Boxuan Zhai bxzhai2...@gmail.com wrote: On Wed, Aug 11, 2010 at 12:14 PM, Greg Smith g...@2ndquadrant.comwrote: Boxuan Zhai wrote: I just found that no Assert() works in my codes. I think it is because the assertion is no enabled. How to enable

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

2010-08-11 Thread Simon Riggs
On Sat, 2010-07-24 at 18:57 -0400, Joseph Adams wrote: I've been developing it as a contrib module because: * I'd imagine it's easier than developing it as a built-in datatype right away (e.g. editing a .sql.in file versus editing pg_type.h ). * As a module, it has PGXS support, so people can

Re: [HACKERS] trace_recovery_messages

2010-08-11 Thread Simon Riggs
On Tue, 2010-08-10 at 23:28 +0900, Fujii Masao wrote: ISTM the right is * Categorized into DEVELOPER_OPTIONS * The default is DEBUG1 * The context is PGC_SIGHUP Don't think we should go live with default of DEBUG1. -- Simon Riggs www.2ndQuadrant.com PostgreSQL Development,

Re: [HACKERS] MERGE command for inheritance

2010-08-11 Thread Heikki Linnakangas
On 10/08/10 12:38, Boxuan Zhai wrote: These days I am considering what else can be done for MERGE, And, I find inheritance tables in postgres is not supported by our MERGE command yet. I played with your latest patch version a bit, and actually, it seems to me that inherited tables work just

Re: [HACKERS] trace_recovery_messages

2010-08-11 Thread Fujii Masao
On Wed, Aug 11, 2010 at 5:26 PM, Simon Riggs si...@2ndquadrant.com wrote: On Tue, 2010-08-10 at 23:28 +0900, Fujii Masao wrote: ISTM the right is * Categorized into DEVELOPER_OPTIONS * The default is DEBUG1 * The context is PGC_SIGHUP Don't think we should go live with default of DEBUG1.

Re: [HACKERS] MERGE command for inheritance

2010-08-11 Thread Simon Riggs
On Tue, 2010-08-10 at 17:15 +0300, Heikki Linnakangas wrote: On 10/08/10 12:38, Boxuan Zhai wrote: The difficult way is to generate the plans for children table in planner, as the other commands like UPDATE and DELETE. However, because the structure of MERGE plan is much more complex than

Re: [HACKERS] string_to_array with an empty input string

2010-08-11 Thread Pavel Stehule
2010/8/11 Greg Stark gsst...@mit.edu: On Wed, Aug 11, 2010 at 12:37 AM, Peter Geoghegan peter.geoghega...@gmail.com wrote: On 10 August 2010 19:48, David E. Wheeler da...@kineticode.com wrote: On Aug 10, 2010, at 11:46 AM, Thom Brown wrote: I, personally, would expect an empty array output

Re: [HACKERS] MERGE Specification

2010-08-11 Thread Peter Eisentraut
On fre, 2010-08-06 at 10:28 +0300, Heikki Linnakangas wrote: IMO the UPDATE/DELETE/INSERT actions should fire the respective statement level triggers, but the MERGE itself should not. Yes, SQL defines the triggering of triggers as part of the modification of rows, not as part of any particular

Re: [HACKERS] assertions and constraint triggers

2010-08-11 Thread Peter Eisentraut
On ons, 2010-08-11 at 10:54 +0300, Marko Tiikkaja wrote: Enforcing that kind of constraints without true serializability seems impractical. Yes, but that is being worked on, I understand. -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your

Re: [HACKERS] assertions and constraint triggers

2010-08-11 Thread Marko Tiikkaja
On 8/11/10 1:18 PM +0300, Peter Eisentraut wrote: On ons, 2010-08-11 at 10:54 +0300, Marko Tiikkaja wrote: Enforcing that kind of constraints without true serializability seems impractical. Yes, but that is being worked on, I understand. Correct. But you'd have to somehow make the

Re: [HACKERS] MERGE command for inheritance

2010-08-11 Thread Heikki Linnakangas
On 11/08/10 11:45, Simon Riggs wrote: On Tue, 2010-08-10 at 17:15 +0300, Heikki Linnakangas wrote: On 10/08/10 12:38, Boxuan Zhai wrote: The difficult way is to generate the plans for children table in planner, as the other commands like UPDATE and DELETE. However, because the structure of

Re: [HACKERS] Bug / shortcoming in has_*_privilege

2010-08-11 Thread Robert Haas
On Wed, Aug 11, 2010 at 3:57 AM, Simon Riggs si...@2ndquadrant.com wrote: On Thu, 2010-06-10 at 23:18 -0400, Tom Lane wrote: Robert Haas robertmh...@gmail.com writes: On Thu, Jun 10, 2010 at 5:54 PM, Jim Nasby j...@nasby.net wrote: So there's no way to see if a particular privilege has been

Re: [HACKERS] Regression tests versus the buildfarm environment

2010-08-11 Thread Andrew Dunstan
On 08/11/2010 12:42 AM, Tom Lane wrote: There's an interesting buildfarm failure here: http://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=polecatdt=2010-08-10%2023:46:10 It appears to me that this was caused by the concurrent run of another buildfarm animal on the same physical machine,

Re: [HACKERS] MERGE command for inheritance

2010-08-11 Thread Simon Riggs
On Wed, 2010-08-11 at 13:25 +0300, Heikki Linnakangas wrote: I concur that Boxuan's suggested difficult approach seems like the right one. Right, but you've completely ignored my proposal: lets do this in two pieces. Get what we have now ready to commit, then add support for partitioning

Re: [HACKERS] Develop item from TODO list

2010-08-11 Thread Viktor Valy
Hello! We have chosen another item from the list: Allow ALTER TABLE to change constraint deferrability and actions Is this already done? If yes, can you recommend any task which is appropriate for beginners in open-source software? Thanks in advance, Chris Viktor 2010/8/4 Bruce Momjian

[HACKERS] pgstat_report_waiting() in hot standby

2010-08-11 Thread Fujii Masao
Hi, ResolveRecoveryConflictWithVirtualXIDs() calls pgstat_report_waiting(), but it seems useless (though harmless) since the startup process doesn't have the shared memory entry (i.e., MyBEEntry) for pg_stat_activity. We should remove it? Regards, -- Fujii Masao NIPPON TELEGRAPH AND TELEPHONE

[HACKERS] micro bucket sort ...

2010-08-11 Thread Hans-Jürgen Schönig
hello all ... i am bugged with a small issue which is basically like this ... test=# create table t_test as select x, x % 5 as y from generate_series(1, 100) AS x; SELECT test=# create index idx_a on t_test (x) ; CREATE INDEX test=# ANALYZE ; ANALYZE test=# explain analyze select * from

Re: [HACKERS] Bug / shortcoming in has_*_privilege

2010-08-11 Thread Stephen Frost
* Robert Haas (robertmh...@gmail.com) wrote: On Wed, Aug 11, 2010 at 3:57 AM, Simon Riggs si...@2ndquadrant.com wrote: On Thu, 2010-06-10 at 23:18 -0400, Tom Lane wrote: Nothing.  The only reason to use those forms is in a join against pg_authid, and the public group doesn't have an entry

Re: [HACKERS] MERGE command for inheritance

2010-08-11 Thread Boxuan Zhai
On Wed, Aug 11, 2010 at 4:27 PM, Heikki Linnakangas heikki.linnakan...@enterprisedb.com wrote: On 10/08/10 12:38, Boxuan Zhai wrote: These days I am considering what else can be done for MERGE, And, I find inheritance tables in postgres is not supported by our MERGE command yet. I played

Re: [HACKERS] Bug / shortcoming in has_*_privilege

2010-08-11 Thread Simon Riggs
On Wed, 2010-08-11 at 06:48 -0400, Robert Haas wrote: On Wed, Aug 11, 2010 at 3:57 AM, Simon Riggs si...@2ndquadrant.com wrote: On Thu, 2010-06-10 at 23:18 -0400, Tom Lane wrote: Robert Haas robertmh...@gmail.com writes: On Thu, Jun 10, 2010 at 5:54 PM, Jim Nasby j...@nasby.net wrote:

Re: [HACKERS] MERGE command for inheritance

2010-08-11 Thread Heikki Linnakangas
On 11/08/10 14:44, Simon Riggs wrote: On Wed, 2010-08-11 at 13:25 +0300, Heikki Linnakangas wrote: I concur that Boxuan's suggested difficult approach seems like the right one. Right, but you've completely ignored my proposal: lets do this in two pieces. Get what we have now ready to commit,

Re: [HACKERS] micro bucket sort ...

2010-08-11 Thread Simon Riggs
On Wed, 2010-08-11 at 14:21 +0200, Hans-Jürgen Schönig wrote: my question is: is there already a concept out there to make this work or does anybody know of a patch out there addressing an issue like that? some idea is heavily appreciated. it seems our sort key infrastructure is not enough

Re: [HACKERS] review: psql: edit function, show function commands patch

2010-08-11 Thread Robert Haas
On Tue, Aug 10, 2010 at 11:58 PM, Tom Lane t...@sss.pgh.pa.us wrote: The \e patch definitely needs another read-through.  I noticed a number of comments that were still pretty poor English, and one ---        /* skip header lines */ --- that seems just plain wrong.  The actual intent of that

Re: [HACKERS] Bug / shortcoming in has_*_privilege

2010-08-11 Thread Robert Haas
On Wed, Aug 11, 2010 at 8:51 AM, Simon Riggs si...@2ndquadrant.com wrote: On Wed, 2010-08-11 at 06:48 -0400, Robert Haas wrote: On Wed, Aug 11, 2010 at 3:57 AM, Simon Riggs si...@2ndquadrant.com wrote: On Thu, 2010-06-10 at 23:18 -0400, Tom Lane wrote: Robert Haas robertmh...@gmail.com

Re: [HACKERS] Develop item from TODO list

2010-08-11 Thread Robert Haas
On Wed, Aug 11, 2010 at 7:47 AM, Viktor Valy vili0...@gmail.com wrote: We have chosen another item from the list: Allow ALTER TABLE to change constraint deferrability and actions I believe that is not done. What does the TODO list item mean by and actions? -- Robert Haas EnterpriseDB:

Re: [HACKERS] MERGE command for inheritance

2010-08-11 Thread Simon Riggs
On Wed, 2010-08-11 at 15:53 +0300, Heikki Linnakangas wrote: On 11/08/10 14:44, Simon Riggs wrote: On Wed, 2010-08-11 at 13:25 +0300, Heikki Linnakangas wrote: I concur that Boxuan's suggested difficult approach seems like the right one. Right, but you've completely ignored my

Re: [HACKERS] Develop item from TODO list

2010-08-11 Thread Kevin Grittner
Robert Haas robertmh...@gmail.com wrote: What does the TODO list item mean by and actions? Things like ON DELETE CASCADE versus ON DELETE RESTRICT? -Kevin -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription:

Re: [HACKERS] Regression tests versus the buildfarm environment

2010-08-11 Thread Tom Lane
Andrew Dunstan and...@dunslane.net writes: On 08/11/2010 12:42 AM, Tom Lane wrote: ... However, it does seem like we ought to be able to do something about two buildfarm critters defaulting to the same choice of port number. Why not just add the configured port (DEF_PGPORT) into the

Re: [HACKERS] Regression tests versus the buildfarm environment

2010-08-11 Thread Kevin Grittner
Tom Lane t...@sss.pgh.pa.us wrote: A look at the code shows that it is merely trying to run psql, and if psql reports that it can connect to the specified port, then pg_regress thinks the postmaster started OK. Of course, psql was really reporting that it could connect to the other

Re: [HACKERS] RecordTransactionCommit() and SharedInvalidationMessages

2010-08-11 Thread Robert Haas
On Wed, Aug 11, 2010 at 1:17 AM, Fujii Masao masao.fu...@gmail.com wrote: On Tue, Aug 10, 2010 at 9:30 AM, Robert Haas robertmh...@gmail.com wrote: It appears to me that RecordTransactionCommit() only needs to WAL-log shared invalidation messages when wal_level is hot_standby, but I don't see

[HACKERS] Inconsistent ::bit(N) and get_bit()?

2010-08-11 Thread Boszormenyi Zoltan
Hi, I just came across the following confusing thing. zozo=# create table bit_test(i integer); CREATE TABLE zozo=# insert into bit_test values (1), (2), (3); INSERT 0 3 zozo=# select i, i::bit(2), get_bit(i::bit(2), 1) as bit1, get_bit(i::bit(2), 0) as bit0 from bit_test; i | i | bit1 | bit0

Re: [HACKERS] Regression tests versus the buildfarm environment

2010-08-11 Thread Tom Lane
Kevin Grittner kevin.gritt...@wicourts.gov writes: Tom Lane t...@sss.pgh.pa.us wrote: A look at the code shows that it is merely trying to run psql, and if psql reports that it can connect to the specified port, then pg_regress thinks the postmaster started OK. Of course, psql was really

Re: [HACKERS] Regression tests versus the buildfarm environment

2010-08-11 Thread Andrew Dunstan
On 08/11/2010 09:43 AM, Tom Lane wrote: Andrew Dunstanand...@dunslane.net writes: On 08/11/2010 12:42 AM, Tom Lane wrote: ... However, it does seem like we ought to be able to do something about two buildfarm critters defaulting to the same choice of port number. Why not just add the

Re: [HACKERS] Regression tests versus the buildfarm environment

2010-08-11 Thread Kevin Grittner
Tom Lane t...@sss.pgh.pa.us wrote: BTW, I don't know why anyone would think that a random number would offer any advantage here. I'd use the postmaster PID, which is guaranteed to be unique across the space that you're worried about. Well, in the post I cited, it was you who argued that

Re: [HACKERS] MERGE command for inheritance

2010-08-11 Thread Boxuan Zhai
On Wed, Aug 11, 2010 at 4:45 PM, Simon Riggs si...@2ndquadrant.com wrote: On Tue, 2010-08-10 at 17:15 +0300, Heikki Linnakangas wrote: On 10/08/10 12:38, Boxuan Zhai wrote: The difficult way is to generate the plans for children table in planner, as the other commands like UPDATE and

Re: [HACKERS] [ADMIN] postgres 9.0 crash when bringing up hot standby

2010-08-11 Thread Robert Haas
On Fri, Aug 6, 2010 at 3:53 PM, Heikki Linnakangas heikki.linnakan...@enterprisedb.com wrote: So, loading libpqwalreceiver library crashes. It looks like it might be pthread-related. Perhaps something wrong with our makefiles, causing libpqwalreceiver to be built with wrong flags? Does

Re: [HACKERS] MERGE command for inheritance

2010-08-11 Thread Robert Haas
On Wed, Aug 11, 2010 at 10:09 AM, Boxuan Zhai bxzhai2...@gmail.com wrote: PS: Since I have taken this project, I will do my best to make it perfect. I will keep working on MERGE until it is really finished, even after the gSoC. (unless you guys has other plans). That is great to hear! FWIW, I

Re: [HACKERS] Regression tests versus the buildfarm environment

2010-08-11 Thread Tom Lane
Kevin Grittner kevin.gritt...@wicourts.gov writes: Tom Lane t...@sss.pgh.pa.us wrote: BTW, I don't know why anyone would think that a random number would offer any advantage here. I'd use the postmaster PID, which is guaranteed to be unique across the space that you're worried about.

Re: [HACKERS] Regression tests versus the buildfarm environment

2010-08-11 Thread Tom Lane
Andrew Dunstan and...@dunslane.net writes: On 08/11/2010 09:43 AM, Tom Lane wrote: Andrew Dunstanand...@dunslane.net writes: Why not just add the configured port (DEF_PGPORT) into the calculation of the port to run on? No, that would be just about the worst possible choice. It'd be

Re: [HACKERS] Regression tests versus the buildfarm environment

2010-08-11 Thread Robert Haas
On Wed, Aug 11, 2010 at 10:15 AM, Tom Lane t...@sss.pgh.pa.us wrote: Andrew Dunstan and...@dunslane.net writes: On 08/11/2010 09:43 AM, Tom Lane wrote: Andrew Dunstanand...@dunslane.net  writes: Why not just add the configured port (DEF_PGPORT) into the calculation of the port to run on?

Re: [HACKERS] [ADMIN] postgres 9.0 crash when bringing up hot standby

2010-08-11 Thread Robert Haas
On Wed, Aug 11, 2010 at 10:20 AM, Alanoly Andrews alano...@invera.com wrote: Ok..in response to the questions from Heikki, 1. Yes, contrib/dblink does work. Here's the output from the command used to make dblink:      postgres:thimar /usr/bin/gmake -C contrib/dblink install      gmake:

Re: [HACKERS] assertions and constraint triggers

2010-08-11 Thread Kevin Grittner
Marko Tiikkaja marko.tiikk...@cs.helsinki.fi wrote: On 8/11/10 1:18 PM +0300, Peter Eisentraut wrote: On ons, 2010-08-11 at 10:54 +0300, Marko Tiikkaja wrote: Enforcing that kind of constraints without true serializability seems impractical. Yes, but that is being worked on, I understand.

Re: [HACKERS] string_to_array with an empty input string

2010-08-11 Thread Tom Lane
Greg Stark gsst...@mit.edu writes: Ideally you really want string_to_array(array_to_string(x, ':'),':') to return x. There's no safe return value to pick for the cases where x=[''] and x=[] that will make this work. It's easy to see that string_to_array/array_to_string are *not* usable as

Re: [HACKERS] RecordTransactionCommit() and SharedInvalidationMessages

2010-08-11 Thread Heikki Linnakangas
On 11/08/10 16:46, Robert Haas wrote: On Wed, Aug 11, 2010 at 1:17 AM, Fujii Masaomasao.fu...@gmail.com wrote: On Tue, Aug 10, 2010 at 9:30 AM, Robert Haasrobertmh...@gmail.com wrote: It appears to me that RecordTransactionCommit() only needs to WAL-log shared invalidation messages when

Re: [HACKERS] string_to_array with an empty input string

2010-08-11 Thread Tom Lane
Greg Stark gsst...@mit.edu writes: There's already been one rather-long thread on this topic. http://thread.gmane.org/gmane.comp.db.postgresql.general/121450 In there I argue for the empty array interpretation and Tom goes back and forth a few times. I'm not sure where that thread ended

Re: [HACKERS] MERGE command for inheritance

2010-08-11 Thread Simon Riggs
On Wed, 2010-08-11 at 22:09 +0800, Boxuan Zhai wrote: One more thing I want to point out is that, the INSERT is also an inheritable action in MERGE. For a plain INSERT command, all the inserted tuples are put in the target table ONLY. It is easy to understand. We don't want to duplicate all

Re: [HACKERS] [ADMIN] postgres 9.0 crash when bringing up hot standby

2010-08-11 Thread Alanoly Andrews
Ok..in response to the questions from Heikki, 1. Yes, contrib/dblink does work. Here's the output from the command used to make dblink: postgres:thimar /usr/bin/gmake -C contrib/dblink install gmake: Entering directory `/dinabkp/faouzis/postgresql-9.0beta1/contrib/dblink'

Re: [HACKERS] assertions and constraint triggers

2010-08-11 Thread Tom Lane
Marko Tiikkaja marko.tiikk...@cs.helsinki.fi writes: On 8/11/10 8:31 AM +0300, Peter Eisentraut wrote: Thinking about SQL assertions (check constraints that are independent of one particular table), do you think it would be reasonable to implement those on top of constraint triggers? On

Re: [HACKERS] string_to_array with an empty input string

2010-08-11 Thread Robert Haas
On Wed, Aug 11, 2010 at 10:32 AM, Tom Lane t...@sss.pgh.pa.us wrote: Greg Stark gsst...@mit.edu writes: Ideally you really want string_to_array(array_to_string(x, ':'),':') to return x. There's no safe return value to pick for the cases where x=[''] and x=[] that will make this work. It's

Re: [HACKERS] MERGE command for inheritance

2010-08-11 Thread Heikki Linnakangas
On 11/08/10 17:45, Simon Riggs wrote: It seems clear that your work in this area will interfere with the work on partitioning and insert routing. Nothing concrete has come out of that work yet. And we should have MERGE work with inherited tables, regardless of any future work that may happen

Re: [HACKERS] Bug / shortcoming in has_*_privilege

2010-08-11 Thread Tom Lane
Robert Haas robertmh...@gmail.com writes: On Wed, Aug 11, 2010 at 8:51 AM, Simon Riggs si...@2ndquadrant.com wrote: It clearly rates higher in importance than most of the things on the open items list of late... First, I don't think that's true. WALreceiver crashing on AIX, the backup

Re: [HACKERS] Regression tests versus the buildfarm environment

2010-08-11 Thread Tom Lane
Vik Reykja vikrey...@gmail.com writes: We just put in the possibility to name the client connections. Would it be interesting to be able to name the server installation itself? Wouldn't do anything for this problem --- it would just introduce something else the buildfarm would have to worry

Re: [HACKERS] MERGE command for inheritance

2010-08-11 Thread Tom Lane
Simon Riggs si...@2ndquadrant.com writes: On Wed, 2010-08-11 at 13:25 +0300, Heikki Linnakangas wrote: I concur that Boxuan's suggested difficult approach seems like the right one. Right, but you've completely ignored my proposal: lets do this in two pieces. Get what we have now ready to

Re: [HACKERS] MERGE Specification

2010-08-11 Thread Peter Eisentraut
On fre, 2010-08-06 at 08:12 +0100, Simon Riggs wrote: Given that Peter is now attending SQL Standards meetings, I would suggest we leave out my suggestion above, for now. We have time to raise this at standards meetings and influence the outcome and then follow later. I'm not actually

Re: [HACKERS] MERGE command for inheritance

2010-08-11 Thread Simon Riggs
On Wed, 2010-08-11 at 11:03 -0400, Tom Lane wrote: Simon Riggs si...@2ndquadrant.com writes: On Wed, 2010-08-11 at 13:25 +0300, Heikki Linnakangas wrote: I concur that Boxuan's suggested difficult approach seems like the right one. Right, but you've completely ignored my proposal:

Re: [HACKERS] micro bucket sort ...

2010-08-11 Thread Alvaro Herrera
Excerpts from Hans-Jürgen Schönig's message of mié ago 11 08:21:10 -0400 2010: same with limit ... test=# explain analyze select * from t_test order by x, y limit 20; But if you put the limit in a subquery which is ordered by the known-indexed condition, it is very fast: alvherre=#

Re: [HACKERS] MERGE command for inheritance

2010-08-11 Thread Robert Haas
On Wed, Aug 11, 2010 at 11:23 AM, Simon Riggs si...@2ndquadrant.com wrote: Well, if we go off chasing this particular goose then we will set ourselves back at least one commitfest. I'd rather work towards having a fully committable patch without inheritance sooner than an even bigger patch

Re: [HACKERS] micro bucket sort ...

2010-08-11 Thread Tom Lane
Alvaro Herrera alvhe...@commandprompt.com writes: Excerpts from Hans-Jürgen Schönig's message of mié ago 11 08:21:10 -0400 2010: test=# explain analyze select * from t_test order by x, y limit 20; But if you put the limit in a subquery which is ordered by the known-indexed condition, it

Re: [HACKERS] Regression tests versus the buildfarm environment

2010-08-11 Thread Tom Lane
Robert Haas robertmh...@gmail.com writes: On Wed, Aug 11, 2010 at 10:15 AM, Tom Lane t...@sss.pgh.pa.us wrote: Or we could do something like     port = 0xC000 ^ (DEF_PGPORT 0x7FFF); which is absolutely guaranteed not to conflict with DEF_PGPORT, at the cost of possibly shifting into the

Re: [HACKERS] Regression tests versus the buildfarm environment

2010-08-11 Thread Andrew Dunstan
On 08/11/2010 10:23 AM, Robert Haas wrote: Or we could do something like port = 0xC000 ^ (DEF_PGPORT 0x7FFF); which is absolutely guaranteed not to conflict with DEF_PGPORT, at the cost of possibly shifting into the 32K-48K port number range if you had set DEF_PGPORT above 48K. I

Re: [HACKERS] MERGE command for inheritance

2010-08-11 Thread Tom Lane
Robert Haas robertmh...@gmail.com writes: On Wed, Aug 11, 2010 at 11:23 AM, Simon Riggs si...@2ndquadrant.com wrote: Well, if we go off chasing this particular goose then we will set ourselves back at least one commitfest. I'd rather work towards having a fully committable patch without

Re: [HACKERS] Regression tests versus the buildfarm environment

2010-08-11 Thread Peter Eisentraut
On ons, 2010-08-11 at 10:15 -0400, Tom Lane wrote: One of us is missing something. I didn't say to run the checks using the configured port. I had in mind something like: port = 0xC000 | ((PG_VERSION_NUM + DEF_PGPORT) 0x3FFF); Oh, I see, modify the DEF_PGPORT don't just use it

Re: [HACKERS] Regression tests versus the buildfarm environment

2010-08-11 Thread Peter Eisentraut
On ons, 2010-08-11 at 09:55 -0400, Tom Lane wrote: BTW, I don't know why anyone would think that a random number would offer any advantage here. I'd use the postmaster PID, which is guaranteed to be unique across the space that you're worried about. In fact, you could implement this off the

Re: [HACKERS] assertions and constraint triggers

2010-08-11 Thread Peter Eisentraut
On ons, 2010-08-11 at 13:23 +0300, Marko Tiikkaja wrote: But you'd have to somehow make the constraints to be checked with true serializability, and that part of the original suggestion seemed to be completely missing. Not sure how hard that would be though. I don't think somehow running

Re: [HACKERS] Regression tests versus the buildfarm environment

2010-08-11 Thread Tom Lane
Peter Eisentraut pete...@gmx.net writes: On ons, 2010-08-11 at 09:55 -0400, Tom Lane wrote: BTW, I don't know why anyone would think that a random number would offer any advantage here. I'd use the postmaster PID, which is guaranteed to be unique across the space that you're worried about.

Re: [HACKERS] Inconsistent ::bit(N) and get_bit()?

2010-08-11 Thread Robert Haas
2010/8/11 Boszormenyi Zoltan z...@cybertec.at: Shouldn't it at least be documented in more depth? Say, get_bit(, N) provides the Nth bit (0-based) counting from the leftmost bit? I would certainly appreciate a warning spelled out about this so if you convert a number to bitstring of length N

Re: [HACKERS] assertions and constraint triggers

2010-08-11 Thread Peter Eisentraut
On ons, 2010-08-11 at 10:47 -0400, Tom Lane wrote: I thought the point of ASSERTIONs was that you could write a thing such as: CREATE ASSERTION foo CHECK ((SELECT count(*) FROM tbl) = 4); Enforcing that kind of constraints without true serializability seems impractical. Enforcing

Re: [HACKERS] Regression tests versus the buildfarm environment

2010-08-11 Thread Tom Lane
Peter Eisentraut pete...@gmx.net writes: On ons, 2010-08-11 at 10:15 -0400, Tom Lane wrote: How about just this: port = 0xC000 | (DEF_PGPORT 0x3FFF); The version number was put in there intentionally, for developers who work on multiple branches at once. That's the whole reason this

Re: [HACKERS] Regression tests versus the buildfarm environment

2010-08-11 Thread Kevin Grittner
Peter Eisentraut pete...@gmx.net wrote: On ons, 2010-08-11 at 09:55 -0400, Tom Lane wrote: BTW, I don't know why anyone would think that a random number would offer any advantage here. I'd use the postmaster PID, which is guaranteed to be unique across the space that you're worried about.

Re: [HACKERS] Regression tests versus the buildfarm environment

2010-08-11 Thread Andrew Dunstan
On 08/11/2010 11:42 AM, Peter Eisentraut wrote: On ons, 2010-08-11 at 10:15 -0400, Tom Lane wrote: One of us is missing something. I didn't say to run the checks using the configured port. I had in mind something like: port = 0xC000 | ((PG_VERSION_NUM + DEF_PGPORT) 0x3FFF); Oh, I

Re: [HACKERS] Regression tests versus the buildfarm environment

2010-08-11 Thread Peter Eisentraut
On ons, 2010-08-11 at 11:48 -0400, Tom Lane wrote: How's that help? pg_backend_pid isn't going to return the postmaster's PID ... maybe we could add a new function that does return the postmaster's PID, though. Hmm, is there a portable way to find the parent PID of some other process, given

Re: [HACKERS] Regression tests versus the buildfarm environment

2010-08-11 Thread Tom Lane
Kevin Grittner kevin.gritt...@wicourts.gov writes: Peter Eisentraut pete...@gmx.net wrote: Why not just compare pg_backend_pid() with postmaster.pid? See the prior discussion in the archives. We started with that and found problems, to which Tom suggested a random number as the best

Re: [HACKERS] string_to_array with an empty input string

2010-08-11 Thread David E. Wheeler
On Aug 11, 2010, at 7:41 AM, Tom Lane wrote: I had forgotten that discussion. It looks like we trailed off without any real consensus: there was about equal sentiment for an array with zero elements and an array with one empty-string element. We ended up leaving it alone because (a) that

Re: [HACKERS] review: psql: edit function, show function commands patch

2010-08-11 Thread Tom Lane
Robert Haas robertmh...@gmail.com writes: On Tue, Aug 10, 2010 at 11:58 PM, Tom Lane t...@sss.pgh.pa.us wrote: BTW, at least in the usage in that loop, get_functiondef_dollarquote_tag seems grossly overdesigned.  It would be clearer, shorter, and faster if you just had a strncmp test for AS

Re: [HACKERS] string_to_array with an empty input string

2010-08-11 Thread Tom Lane
David E. Wheeler da...@kineticode.com writes: On Aug 11, 2010, at 7:41 AM, Tom Lane wrote: So maybe we need to revisit the issue. Pavel was claiming that switching to a zero-element array result was a no-brainer, but evidently it isn't so. Is anybody still excited about the alternatives? %

Re: [HACKERS] review: psql: edit function, show function commands patch

2010-08-11 Thread Robert Haas
On Wed, Aug 11, 2010 at 12:28 PM, Tom Lane t...@sss.pgh.pa.us wrote: Robert Haas robertmh...@gmail.com writes: On Tue, Aug 10, 2010 at 11:58 PM, Tom Lane t...@sss.pgh.pa.us wrote: BTW, at least in the usage in that loop, get_functiondef_dollarquote_tag seems grossly overdesigned.  It would be

Re: [HACKERS] string_to_array with an empty input string

2010-08-11 Thread Robert Haas
On Wed, Aug 11, 2010 at 12:36 PM, Tom Lane t...@sss.pgh.pa.us wrote: David E. Wheeler da...@kineticode.com writes: On Aug 11, 2010, at 7:41 AM, Tom Lane wrote: So maybe we need to revisit the issue.  Pavel was claiming that switching to a zero-element array result was a no-brainer, but

Re: [HACKERS] review: xml_is_well_formed

2010-08-11 Thread Robert Haas
On Mon, Aug 9, 2010 at 10:41 AM, Robert Haas robertmh...@gmail.com wrote: On Mon, Aug 9, 2010 at 10:20 AM, Peter Eisentraut pete...@gmx.net wrote: On lör, 2010-08-07 at 16:47 +0100, Mike Fowler wrote: To be honest I'm happiest with returning a boolean, even if there is some confusion over

Re: [HACKERS] MERGE command for inheritance

2010-08-11 Thread Greg Smith
Tom Lane wrote: Do we really think this is anywhere near committable now? There's a relatively objective standard for the first thing needed for commit--does it work?--in the form of the regression tests Simon put together before development. I just tried the latest merge_v102.patch

Re: [HACKERS] string_to_array with an empty input string

2010-08-11 Thread Peter Geoghegan
Yeah, I think David's examples are talking about the behavior of join, but we're trying to decide what split should do.  I think the main argument for making it return NULL is that you can then fairly easily use COALESCE() to get whatever you want.  That's a bit more difficult if you use

Re: [HACKERS] string_to_array with an empty input string

2010-08-11 Thread David E. Wheeler
On Aug 11, 2010, at 9:36 AM, Tom Lane wrote: I believe those are all , rather than '' + undef + ''. If you believe my previous opinion that the design center for these functions is arrays of numbers, then a zero-entry text[] array is what you want, because you can successfully cast it to

Re: [HACKERS] string_to_array with an empty input string

2010-08-11 Thread David E. Wheeler
On Aug 11, 2010, at 9:40 AM, Robert Haas wrote: Yeah, I think David's examples are talking about the behavior of join, but we're trying to decide what split should do. Right, sorry about that. I think the main argument for making it return NULL is that you can then fairly easily use

Re: [HACKERS] string_to_array with an empty input string

2010-08-11 Thread Robert Haas
On Wed, Aug 11, 2010 at 1:32 PM, Peter Geoghegan peter.geoghega...@gmail.com wrote: Yeah, I think David's examples are talking about the behavior of join, but we're trying to decide what split should do.  I think the main argument for making it return NULL is that you can then fairly easily

Re: [HACKERS] string_to_array with an empty input string

2010-08-11 Thread David E. Wheeler
On Aug 11, 2010, at 10:53 AM, Robert Haas wrote: Iterating through an array with plpgsql, for example, is more clunky than it should be. Really? FOR var IN SELECT UNNEST(arr) LOOP ... END LOOP I mean, doing everything is sort of clunky in PL/pgsql, but this doesn't seem particularly

Re: [HACKERS] string_to_array with an empty input string

2010-08-11 Thread Andrew Dunstan
On 08/11/2010 01:54 PM, David E. Wheeler wrote: On Aug 11, 2010, at 10:53 AM, Robert Haas wrote: Iterating through an array with plpgsql, for example, is more clunky than it should be. Really? FOR var IN SELECT UNNEST(arr) LOOP ... END LOOP I mean, doing everything is sort of clunky in

Re: [HACKERS] string_to_array with an empty input string

2010-08-11 Thread David E. Wheeler
On Aug 11, 2010, at 10:58 AM, Andrew Dunstan wrote: for i in array_lower(myarray,1) .. array_upper(myarray,1) loop ... works well for i in select array_subscripts(myarray, 1) loop ... Best, David -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to

Re: [HACKERS] Regression tests versus the buildfarm environment

2010-08-11 Thread Peter Eisentraut
On ons, 2010-08-11 at 11:53 -0400, Andrew Dunstan wrote: The version number was put in there intentionally, for developers who work on multiple branches at once. That's the whole reason this code exists. Please don't remove it. Do they run make check by hand simultaneously on

Re: [HACKERS] MERGE command for inheritance

2010-08-11 Thread Alvaro Herrera
Excerpts from Heikki Linnakangas's message of mié ago 11 10:52:24 -0400 2010: On 11/08/10 17:45, Simon Riggs wrote: We've seen it time and time again that big projects that aim to deliver towards end of a release cycle interfere with dev of other projects and leave loose ends from

Re: [HACKERS] Regression tests versus the buildfarm environment

2010-08-11 Thread Peter Eisentraut
On ons, 2010-08-11 at 11:47 -0400, Tom Lane wrote: Peter Eisentraut pete...@gmx.net writes: On ons, 2010-08-11 at 10:15 -0400, Tom Lane wrote: How about just this: port = 0xC000 | (DEF_PGPORT 0x3FFF); The version number was put in there intentionally, for developers who work on

[HACKERS] 16/32/48/64 bytes integers

2010-08-11 Thread Daniel Oliveira
Hello, I wishing to create real big numbers, but I'm facing some difficulties. Is possible to setup an integer type of more than 8 bytes (i.e. 16/32/48/64 bytes)? Can I setup a value as large as I want? How I should acess them using PG_RETURN_xxx and PG_GETARG_xxx macros? Thanks in advance,

Re: [HACKERS] 16/32/48/64 bytes integers

2010-08-11 Thread Heikki Linnakangas
On 11/08/10 21:19, Daniel Oliveira wrote: I wishing to create real big numbers, but I'm facing some difficulties. Is possible to setup an integer type of more than 8 bytes (i.e. 16/32/48/64 bytes)? No. Not unless you write your own datatype. Use numeric, it scales up to ridiculously large

Re: [HACKERS] string_to_array with an empty input string

2010-08-11 Thread Andrew Dunstan
On 08/11/2010 01:59 PM, David E. Wheeler wrote: On Aug 11, 2010, at 10:58 AM, Andrew Dunstan wrote: for i in array_lower(myarray,1) .. array_upper(myarray,1) loop ... works well for i in select array_subscripts(myarray, 1) loop ... That's not a built-in function AFAIK. cheers andrew

  1   2   >