Re: [HACKERS] MERGE command for inheritance

2010-08-13 Thread Heikki Linnakangas
On 13/08/10 09:27, Boxuan Zhai wrote: I have renewed the merge.sql and merge.out in regress. Please have a look. Thanks. Did you change the way DO INSTEAD rules are handled already? http://archives.postgresql.org/pgsql-hackers/2010-08/msg00151.php -- Heikki Linnakangas EnterpriseDB

Re: [HACKERS] patch: utf8_to_unicode (trivial)

2010-08-13 Thread Joseph Adams
On Tue, Jul 27, 2010 at 1:31 PM, Robert Haas robertmh...@gmail.com wrote: On Sat, Jul 24, 2010 at 10:34 PM, Joseph Adams joeyadams3.14...@gmail.com wrote: In src/include/mb/pg_wchar.h , there is a function unicode_to_utf8 , but no corresponding utf8_to_unicode .  However, there is a static

Re: [HACKERS] MERGE command for inheritance

2010-08-13 Thread Boxuan Zhai
On Fri, Aug 13, 2010 at 2:33 PM, Heikki Linnakangas heikki.linnakan...@enterprisedb.com wrote: On 13/08/10 09:27, Boxuan Zhai wrote: I have renewed the merge.sql and merge.out in regress. Please have a look. Thanks. Did you change the way DO INSTEAD rules are handled already?

[HACKERS] patch: General purpose utility functions used by the JSON data type

2010-08-13 Thread Joseph Adams
I factored out the general-purpose utility functions in the JSON data type code into a patch against HEAD. I have made a few changes to them since I posted about them earlier ( http://archives.postgresql.org/pgsql-hackers/2010-08/msg00692.php ). A summary of the utility functions along with some

Re: [HACKERS] patch: General purpose utility functions used by the JSON data type

2010-08-13 Thread Mike Fowler
On 13/08/10 10:45, Joseph Adams wrote: This patch doesn't include tests . How would I go about writing them? I have made the JSON data type built-in, and I will post that patch shortly (it depends on this one). The built-in JSON data type uses all of these utility functions, and the tests for

Re: [HACKERS] Develop item from TODO list

2010-08-13 Thread Dimitri Fontaine
Viktor Valy vili0...@gmail.com writes: Thanks for the advice!Yes, we are new to linux too :)We have chosen Eclipse, because we have already experience with it.However, after downloading the code from CVS, we can#39;t build it, because of some include commands in tutorial / complex.c says No

Re: [HACKERS] pg_restore should accept multiple -t switches?

2010-08-13 Thread Dimitri Fontaine
Fujii Masao masao.fu...@gmail.com writes: pg_dump allows us to select multiple target tables by using multiple -t switches, but pg_restore does not. So, when restoring multiple tables, we have to run pg_restore more than once as follows. This is a pain to me. Use the list facilities, options

Re: [HACKERS] Develop item from TODO list

2010-08-13 Thread Robert Haas
On Wed, Aug 4, 2010 at 5:34 PM, Dimitri Fontaine dfonta...@hi-media.com wrote: On Tue, 2010-08-03 at 11:10 -0400, Robert Haas wrote: Or vi. cough. Well, I guess letting newcomers know about tools of choice amongst regular contributors is a good idea, but the best editor you can find around

Re: [HACKERS] micro bucket sort ...

2010-08-13 Thread Hitoshi Harada
2010/8/12 PostgreSQL - Hans-Jürgen Schönig postg...@cybertec.at: as tom pointed out - this is not possible. there is no limit 20 in my case - i just used it to indicate that limiting does not make the index scan possible which it does in some other cases. I came up with this: explain analyze

Re: [HACKERS] patch: General purpose utility functions used by the JSON data type

2010-08-13 Thread Robert Haas
On Fri, Aug 13, 2010 at 5:45 AM, Joseph Adams joeyadams3.14...@gmail.com wrote: getEnumLabelOids  * Useful-ometer: ()---o  * Rationale: There is currently no streamlined way to return a custom enum value from a PostgreSQL function written in C.  This function

Re: [HACKERS] typos in HS source code comment

2010-08-13 Thread Robert Haas
On Thu, Aug 12, 2010 at 9:37 PM, Fujii Masao masao.fu...@gmail.com wrote: Before 9.0, since xact_redo_commit always calls TransactionIdCommitTree, TransactionIdSetStatusBit always receives InvalidXLogRecPtr. In 9.0, xact_redo_commit calls TransactionIdCommitTree only when hot standby is

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

2010-08-13 Thread Robert Haas
On Thu, Aug 12, 2010 at 5:54 PM, Tom Lane t...@sss.pgh.pa.us wrote: I wrote: I wonder if the problem is not so much libpqwalreceiver as the walreceiver process.  Maybe an ordinary backend process does some prerequisite initialization that walreceiver is missing.  Hard to guess what, though

Re: [HACKERS] patch: utf8_to_unicode (trivial)

2010-08-13 Thread Robert Haas
On Fri, Aug 13, 2010 at 3:12 AM, Joseph Adams joeyadams3.14...@gmail.com wrote: I've attached another patch that moves utf8_to_unicode to src/port per Robert Haas's suggestion. This patch itself is not quite as elegant as the first one because it puts platform-independent code that belongs in

Re: [HACKERS] RecordTransactionCommit() and SharedInvalidationMessages

2010-08-13 Thread Robert Haas
On Thu, Aug 12, 2010 at 9:43 PM, Fujii Masao masao.fu...@gmail.com wrote: On Fri, Aug 13, 2010 at 10:24 AM, Robert Haas robertmh...@gmail.com wrote: On Thu, Aug 12, 2010 at 12:11 AM, Fujii Masao masao.fu...@gmail.com wrote: It appears to me that RecordTransactionCommit() only needs to WAL-log

Re: [HACKERS] patch: utf8_to_unicode (trivial)

2010-08-13 Thread Alvaro Herrera
Excerpts from Robert Haas's message of vie ago 13 12:00:32 -0400 2010: On Fri, Aug 13, 2010 at 3:12 AM, Joseph Adams joeyadams3.14...@gmail.com wrote: I've attached another patch that moves utf8_to_unicode to src/port per Robert Haas's suggestion. This patch itself is not quite as

Re: [HACKERS] including backend ID in relpath of temp rels - updated patch

2010-08-13 Thread Tom Lane
Robert Haas robertmh...@gmail.com writes: Here is an updated patch. It's in context-diff format this time, Thanks, I appreciate that ;-) This looks committable to me, with a couple of tiny suggestions: In the text added to storage.sgml, s/temporary relation/temporary relations/. Also, it'd be

Re: [HACKERS] including backend ID in relpath of temp rels - updated patch

2010-08-13 Thread Robert Haas
On Fri, Aug 13, 2010 at 12:49 PM, Tom Lane t...@sss.pgh.pa.us wrote: Robert Haas robertmh...@gmail.com writes: Here is an updated patch.  It's in context-diff format this time, Thanks, I appreciate that ;-) This looks committable to me, with a couple of tiny suggestions: Woo hoo! In the

Re: [HACKERS] patch: General purpose utility functions used by the JSON data type

2010-08-13 Thread Joseph Adams
On Fri, Aug 13, 2010 at 10:46 AM, Robert Haas robertmh...@gmail.com wrote: On Fri, Aug 13, 2010 at 5:45 AM, Joseph Adams joeyadams3.14...@gmail.com wrote: getEnumLabelOids  * Useful-ometer: ()---o  * Rationale: There is currently no streamlined way to return a

Re: [HACKERS] including backend ID in relpath of temp rels - updated patch

2010-08-13 Thread Tom Lane
Robert Haas robertmh...@gmail.com writes: On Fri, Aug 13, 2010 at 12:49 PM, Tom Lane t...@sss.pgh.pa.us wrote: Also, it'd be better if BBB and FFF were marked up as replaceable rather than literal, see examples elsewhere in that file. I see. How should I mark tBBB_FFF? I'd do

Re: [HACKERS] patch: General purpose utility functions used by the JSON data type

2010-08-13 Thread Robert Haas
On Fri, Aug 13, 2010 at 12:55 PM, Joseph Adams joeyadams3.14...@gmail.com wrote: Indeed, a built-in JSON data type will certainly not need it. However, users may want to return enums from procedures written in C, and this function provides a way to do it. Yeah, but I can't see accepting it on

Re: [HACKERS] patch: General purpose utility functions used by the JSON data type

2010-08-13 Thread Tom Lane
Joseph Adams joeyadams3.14...@gmail.com writes: On Fri, Aug 13, 2010 at 10:46 AM, Robert Haas robertmh...@gmail.com wrote: + if (sub_end + len e) + { + Assert(false); /* Clipped multibyte character */ + break;

Re: [HACKERS] patch: General purpose utility functions used by the JSON data type

2010-08-13 Thread David Fetter
On Fri, Aug 13, 2010 at 12:59:48PM -0400, Robert Haas wrote: On Fri, Aug 13, 2010 at 12:55 PM, Joseph Adams joeyadams3.14...@gmail.com wrote: Indeed, a built-in JSON data type will certainly not need it. However, users may want to return enums from procedures written in C, and this

Re: [HACKERS] more numeric stuff

2010-08-13 Thread Bruce Momjian
Tom Lane wrote: 3. 64-bit arithmetic. Right now, mul_var() and div_var() use int for arithmetic, but haven't we given up on supporting platforms without long long? I'm not sure I'm motivated enough to write the patch myself, but it seems like 64-bit arithmetic would give us a lot more

Re: [HACKERS] patch: General purpose utility functions used by the JSON data type

2010-08-13 Thread Robert Haas
On Fri, Aug 13, 2010 at 1:05 PM, David Fetter da...@fetter.org wrote: On Fri, Aug 13, 2010 at 12:59:48PM -0400, Robert Haas wrote: On Fri, Aug 13, 2010 at 12:55 PM, Joseph Adams joeyadams3.14...@gmail.com wrote: Indeed, a built-in JSON data type will certainly not need it. However, users

Re: [HACKERS] more numeric stuff

2010-08-13 Thread Robert Haas
On Fri, Aug 13, 2010 at 1:10 PM, Bruce Momjian br...@momjian.us wrote: Tom Lane wrote: 3. 64-bit arithmetic.  Right now, mul_var() and div_var() use int for arithmetic, but haven't we given up on supporting platforms without long long?  I'm not sure I'm motivated enough to write the patch

Re: [HACKERS] patch: utf8_to_unicode (trivial)

2010-08-13 Thread Alvaro Herrera
Excerpts from Robert Haas's message of vie ago 13 12:50:13 -0400 2010: On Fri, Aug 13, 2010 at 12:11 PM, Alvaro Herrera alvhe...@commandprompt.com wrote: src/include/port.h? Oh, hey, look at that. Any thought on what to about the fact that our two existing copies of utf2ucs() don't match?

Re: [HACKERS] patch: utf8_to_unicode (trivial)

2010-08-13 Thread Tom Lane
Alvaro Herrera alvhe...@commandprompt.com writes: Excerpts from Robert Haas's message of vie ago 13 12:50:13 -0400 2010: Oh, hey, look at that. Any thought on what to about the fact that our two existing copies of utf2ucs() don't match? (one tests against 0xf8 where the other against 0xf0)

Re: [HACKERS] patch: General purpose utility functions used by the JSON data type

2010-08-13 Thread David Fetter
On Fri, Aug 13, 2010 at 01:33:06PM -0400, Robert Haas wrote: On Fri, Aug 13, 2010 at 1:05 PM, David Fetter da...@fetter.org wrote: On Fri, Aug 13, 2010 at 12:59:48PM -0400, Robert Haas wrote: On Fri, Aug 13, 2010 at 12:55 PM, Joseph Adams joeyadams3.14...@gmail.com wrote: Indeed, a

Re: [HACKERS] patch: utf8_to_unicode (trivial)

2010-08-13 Thread Robert Haas
On Fri, Aug 13, 2010 at 1:50 PM, Tom Lane t...@sss.pgh.pa.us wrote: Alvaro Herrera alvhe...@commandprompt.com writes: Excerpts from Robert Haas's message of vie ago 13 12:50:13 -0400 2010: Oh, hey, look at that.  Any thought on what to about the fact that our two existing copies of utf2ucs()

Re: [HACKERS] patch: utf8_to_unicode (trivial)

2010-08-13 Thread Tom Lane
Robert Haas robertmh...@gmail.com writes: On Fri, Aug 13, 2010 at 1:50 PM, Tom Lane t...@sss.pgh.pa.us wrote: AFAICS the version in mbprint.c is flat out wrong, and the only reason nobody's noticed is that it should never get passed a more-than-4-byte sequence anyway. Should we fix it, then,

Re: [HACKERS] review: xml_is_well_formed

2010-08-13 Thread Tom Lane
Mike Fowler m...@mlfowler.com writes: On 11/08/10 21:27, Tom Lane wrote: Yes. Mike, are you expecting to submit a new version before the end of the week? Yes and here it is, apologies for the delay. I have re-implemented xml_is_well_formed such that it is sensitive to the XMLOPTION. The

Re: [HACKERS] WIP partial replication patch

2010-08-13 Thread Tom Lane
Boszormenyi Zoltan z...@cybertec.at writes: attached is a WIP patch that will eventually implement partial replication, with the following syntax: This fundamentally cannot work, as it relies on system catalogs to be valid during recovery. Another rather basic problem is that you've got to

Re: [HACKERS] WIP partial replication patch

2010-08-13 Thread Boszormenyi Zoltan
Tom Lane írta: Boszormenyi Zoltan z...@cybertec.at writes: attached is a WIP patch that will eventually implement partial replication, with the following syntax: This fundamentally cannot work, as it relies on system catalogs to be valid during recovery. Just like Hot Standby, no?

Re: [HACKERS] WIP partial replication patch

2010-08-13 Thread Andres Freund
On Fri, Aug 13, 2010 at 09:36:00PM +0200, Boszormenyi Zoltan wrote: Tom Lane írta: Boszormenyi Zoltan z...@cybertec.at writes: attached is a WIP patch that will eventually implement partial replication, with the following syntax: This fundamentally cannot work, as it relies on system

Re: [HACKERS] patch: General purpose utility functions used by the JSON data type

2010-08-13 Thread Joseph Adams
On Fri, Aug 13, 2010 at 2:02 PM, David Fetter da...@fetter.org wrote: On Fri, Aug 13, 2010 at 01:33:06PM -0400, Robert Haas wrote: Maybe so, but it's not clear the interface that Joseph implemented is the one everyone wants... Fair enough.  What's the interface now in a nutshell?  Lack of

Re: [HACKERS] patch: utf8_to_unicode (trivial)

2010-08-13 Thread Robert Haas
On Fri, Aug 13, 2010 at 12:11 PM, Alvaro Herrera alvhe...@commandprompt.com wrote: src/include/port.h? Oh, hey, look at that. Any thought on what to about the fact that our two existing copies of utf2ucs() don't match? (one tests against 0xf8 where the other against 0xf0) -- Robert Haas

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

2010-08-13 Thread Tom Lane
Pavel Stehule pavel.steh...@gmail.com writes: attached updated \sf implementation. It is little bit simplyfied with support a pager and output forwarding. The line number argument to this greatly complicates the code but doesn't appear to me to have much practical use. Why would you bother

Re: [HACKERS] WIP partial replication patch

2010-08-13 Thread Josh Berkus
Another rather basic problem is that you've got to pass system catalog updates downstream (in case they affect the tables being replicated) but if you want partial replication then many of those updates will be incorrect for the slave machine. Couldn't this be taken care of by replicating

Re: [HACKERS] patch: General purpose utility functions used by the JSON data type

2010-08-13 Thread Andrew Dunstan
On 08/13/2010 03:46 PM, Joseph Adams wrote: On Fri, Aug 13, 2010 at 2:02 PM, David Fetterda...@fetter.org wrote: On Fri, Aug 13, 2010 at 01:33:06PM -0400, Robert Haas wrote: Maybe so, but it's not clear the interface that Joseph implemented is the one everyone wants... Fair enough. What's

[HACKERS] Window functions seem to inhibit push-down of quals into views

2010-08-13 Thread Alvaro Herrera
Hi, I've got a table and view defined like this: CREATE TABLE foo AS SELECT a, a % 10 AS b FROM generate_series(1, 10) a; CREATE INDEX a_b ON foo (b); CREATE VIEW bar AS SELECT a, b, lead(a, 1) OVER () FROM foo; Now, if I query the table directly instead of going through the view, a WHERE

Re: [HACKERS] WIP partial replication patch

2010-08-13 Thread Tom Lane
Josh Berkus j...@agliodbs.com writes: Another rather basic problem is that you've got to pass system catalog updates downstream (in case they affect the tables being replicated) but if you want partial replication then many of those updates will be incorrect for the slave machine. Couldn't

Re: [HACKERS] Window functions seem to inhibit push-down of quals into views

2010-08-13 Thread Tom Lane
Alvaro Herrera alvhe...@alvh.no-ip.org writes: CREATE TABLE foo AS SELECT a, a % 10 AS b FROM generate_series(1, 10) a; CREATE INDEX a_b ON foo (b); CREATE VIEW bar AS SELECT a, b, lead(a, 1) OVER () FROM foo; explain select a, b, lead(a, 1) over () from foo where b = 2; explain select *

[HACKERS] Re: [COMMITTERS] pgsql: Include the backend ID in the relpath of temporary relations.

2010-08-13 Thread Robert Haas
On Fri, Aug 13, 2010 at 6:38 PM, Robert Haas robertmh...@gmail.com wrote: On Fri, Aug 13, 2010 at 5:51 PM, Tom Lane t...@sss.pgh.pa.us wrote: rh...@postgresql.org (Robert Haas) writes: Include the backend ID in the relpath of temporary relations. A couple of the buildfarm members don't like

Re: [HACKERS] Re: [COMMITTERS] pgsql: Include the backend ID in the relpath of temporary relations.

2010-08-13 Thread Tom Lane
Robert Haas robertmh...@gmail.com writes: I have taken a crack at fixing this but someone who understands DTrace better than I do may want to check and see if the changes look sane. It appears to me that we have no documentation - not even so much as a source code comment - explaining how

[HACKERS] Python 2.7 deprecated the PyCObject API?

2010-08-13 Thread Tom Lane
According to a discussion over in Fedora-land, $subject is true: http://lists.fedoraproject.org/pipermail/devel/2010-August/140995.html I see several calls in plpython.c that seem to refer to PyCObject stuff. Anybody have any idea if we need to do something about this?

Re: [HACKERS] micro bucket sort ...

2010-08-13 Thread Greg Stark
2010/8/11 Hans-Jürgen Schönig postg...@cybertec.at: now, the problem is: i cannot easily create additional indexes as i have too many possible second conditions here. Is it just me or is this description of the problem not very specific? Can you give more examples of your queries and explain

Re: [HACKERS] Re: [COMMITTERS] pgsql: Include the backend ID in the relpath of temporary relations.

2010-08-13 Thread Robert Haas
On Fri, Aug 13, 2010 at 7:23 PM, Tom Lane t...@sss.pgh.pa.us wrote: Robert Haas robertmh...@gmail.com writes: I have taken a crack at fixing this but someone who understands DTrace better than I do may want to check and see if the changes look sane. It appears to me that we have no

[HACKERS] Re: [COMMITTERS] pgsql: Recognize functional dependency on primary keys.

2010-08-13 Thread Bruce Momjian
Tom Lane wrote: Log Message: --- Recognize functional dependency on primary keys. This allows a table's other columns to be referenced without listing them in GROUP BY, so long as the primary key column(s) are listed in GROUP BY. Eventually we should also allow functional

Re: [HACKERS] Re: [COMMITTERS] pgsql: Recognize functional dependency on primary keys.

2010-08-13 Thread Stephen Frost
Bruce, * Bruce Momjian (br...@momjian.us) wrote: My guess is our new 9.1 functionality will reduce requests for this features, so we can just not list it anymore. If they still ask, we can re-added this not-wanted item. I'm not so sure... I expect we're going to get people complaining that

Re: [HACKERS] Python 2.7 deprecated the PyCObject API?

2010-08-13 Thread James William Pye
On Aug 13, 2010, at 5:20 PM, Tom Lane wrote: According to a discussion over in Fedora-land, $subject is true: http://lists.fedoraproject.org/pipermail/devel/2010-August/140995.html I see several calls in plpython.c that seem to refer to PyCObject stuff. Anybody have any idea if we need to do

Re: [HACKERS] [BUGS] BUG #5608: array_agg() consumes too much memory

2010-08-13 Thread Itagaki Takahiro
2010/8/10 Tom Lane t...@sss.pgh.pa.us: Eventually it might be nice to have some sort of way to specify the estimate to use for any aggregate function --- but for a near-term fix maybe we should just hard-wire a special case for array_agg in count_agg_clauses_walker(). The attached patch is

Re: [HACKERS] Re: [COMMITTERS] pgsql: Recognize functional dependency on primary keys.

2010-08-13 Thread Bruce Momjian
Stephen Frost wrote: -- Start of PGP signed section. Bruce, * Bruce Momjian (br...@momjian.us) wrote: My guess is our new 9.1 functionality will reduce requests for this features, so we can just not list it anymore. If they still ask, we can re-added this not-wanted item. I'm not so

Re: [HACKERS] Re: [COMMITTERS] pgsql: Recognize functional dependency on primary keys.

2010-08-13 Thread Tom Lane
Bruce Momjian br...@momjian.us writes: Well, as worded, it says we have to group by everything, which is not true in 9.1, so I figured let's see what feedback we get and we can add a new one if we want, but our old argument is invalid, since we did implement part of what we said we wouldn't.

Re: [HACKERS] Re: [COMMITTERS] pgsql: Recognize functional dependency on primary keys.

2010-08-13 Thread Tom Lane
Stephen Frost sfr...@snowman.net writes: * Bruce Momjian (br...@momjian.us) wrote: My guess is our new 9.1 functionality will reduce requests for this features, so we can just not list it anymore. If they still ask, we can re-added this not-wanted item. I'm not so sure... I expect we're

Re: [HACKERS] Re: [COMMITTERS] pgsql: Recognize functional dependency on primary keys.

2010-08-13 Thread Bruce Momjian
Tom Lane wrote: Stephen Frost sfr...@snowman.net writes: * Bruce Momjian (br...@momjian.us) wrote: My guess is our new 9.1 functionality will reduce requests for this features, so we can just not list it anymore. If they still ask, we can re-added this not-wanted item. I'm not so

Re: [HACKERS] Re: [COMMITTERS] pgsql: Recognize functional dependency on primary keys.

2010-08-13 Thread Tom Lane
Bruce Momjian br...@momjian.us writes: Tom Lane wrote: I'm not sure whether there is any clear rule for what rows you get when grouping by a non-PK column in mysql, but it'll let you do it. I understand this. The issue is how many people who complained about our GROUP BY behavior were

Re: [HACKERS] [BUGS] BUG #5608: array_agg() consumes too much memory

2010-08-13 Thread Hitoshi Harada
2010/8/14 Itagaki Takahiro itagaki.takah...@gmail.com: 2010/8/10 Tom Lane t...@sss.pgh.pa.us: Eventually it might be nice to have some sort of way to specify the estimate to use for any aggregate function --- but for a near-term fix maybe we should just hard-wire a special case for array_agg