Re: [HACKERS] Cancelling idle in transaction state

2009-12-05 Thread James Pye
On Dec 5, 2009, at 12:25 PM, Simon Riggs wrote: > ... I'm not volunteering here, but having worked with the protocol, I do have a suggestion: >> This allows locks to be released, but it is complex to report the >> cancellation back to the client. I think the answer here is t

Re: [HACKERS] Python 3.1 support

2009-11-20 Thread James Pye
On Nov 20, 2009, at 1:26 AM, Peter Eisentraut wrote: > because this is the same execution Hrm, not necessarily. foo could be imported by another, completely independent part of the program. foo is cached in sys.modules. bar() is executed and it's still the same globals(). shared. -- Sent via pg

Re: [HACKERS] Python 3.1 support

2009-11-20 Thread James Pye
On Nov 20, 2009, at 12:02 AM, Peter Eisentraut wrote: > Is there any precedent for the sort of behavior that you are > implementing, that is, automatic sharing of variables between > independent executions of the same source container? import foo # bar is a regular, def'd function. foo.bar() ...

Re: [HACKERS] Python 3.1 support

2009-11-19 Thread James Pye
On Nov 19, 2009, at 11:32 AM, Peter Eisentraut wrote: > But you wouldn't, for example, get away with breaking SQL (or even > improving it incompatibly) to facilitate a better elog. This doesn't fit the situation. I'm not breaking PL/Python. I'm trying to add PL/Python3. =) > I think of a PL/Pyth

Re: [HACKERS] Python 3.1 support

2009-11-19 Thread James Pye
On Nov 19, 2009, at 3:12 AM, Peter Eisentraut wrote: > The other approach, which is what James Pye's > new implementation proposes (as I understand it), is to convert > PostgreSQL types into specially made Python objects, such as > Postgres.types.record or Postgres.types.timestamp. Convert is not

Re: [HACKERS] Python 3.1 support

2009-11-18 Thread James Pye
On Nov 18, 2009, at 1:36 PM, James Pye wrote: > At this point, I'm not going to try getting it into PG. (apparent futility > and such) ugh, on second thought, I think I've written a bit too much code to stop now. I'm going to get plpython3 as far as I can and submit it t

Re: [HACKERS] Python 3.1 support

2009-11-18 Thread James Pye
On Nov 18, 2009, at 8:37 AM, Peter Eisentraut wrote: > The question is whether it helps the user, not the implementer. Sure, but do you have a patch waiting to implement tracebacks? I'd argue the reason it's never been done is due to the way procedures are currently managed in PL/Python. And *wi

Re: [HACKERS] Python 3.1 support

2009-11-15 Thread James Pye
On Nov 15, 2009, at 6:37 AM, Peter Eisentraut wrote: > but these two features don't excite me at all, hrm.. at all? I can see how function modules might look like a half-step backwards from function fragments at first, but the benefits of a *natural* initialization section (the module body) w

Re: [HACKERS] Python 3.1 support

2009-11-13 Thread James Pye
On Nov 13, 2009, at 4:47 AM, Peter Eisentraut wrote: > Has this list of gripes ever been brought up and discussed in this > forum? Some are TODOs, so in part by other people. Some were briefly touched on in the recent past discussions(around the time that I announced the WIP). Native typing vs

Re: [HACKERS] Python 3.1 support

2009-11-12 Thread James Pye
On Nov 12, 2009, at 12:54 PM, Peter Eisentraut wrote: > Here's the patch to support Python >=3.1 with PL/Python. :\ I was hoping to be able to use Python 3 to draw a clear distinction between plpython and the would-be "plpython3" that I've been working on. I understand that you're not in favor

Re: [HACKERS] Typed tables

2009-11-05 Thread James Pye
On Nov 5, 2009, at 10:24 AM, Peter Eisentraut wrote: One thing I'm not sure of is whether to keep the implicit row type in that case. That is, would the above command sequence still create a "persons" type? We could keep that so as to preserve the property "a table always has a row type of the

Re: [HACKERS] Tightening binary receive functions

2009-10-24 Thread James Pye
On Aug 31, 2009, at 1:12 AM, Heikki Linnakangas wrote: ... Is the new date_recv() constraint actually correct? [looking at the "result < 0" part, at least] src/backend/utils/adt/date.c ... + /* Limit to the same range that date_in() accepts. */ + if (result < 0 || result > JULIAN

Re: [HACKERS] RfD: more powerful "any" types

2009-09-09 Thread James Pye
On Sep 8, 2009, at 10:48 AM, David Fetter wrote: I'd like to see pseudo-types like ANYNUMERIC, and allow it to take an array decorator, which would really help for math-ish functions. Not sure where that fits in this discussion. Perhaps typcategory could be leveraged here? ..Tho, if I unders

Re: [HACKERS] RfD: more powerful "any" types

2009-09-09 Thread James Pye
On Sep 9, 2009, at 4:44 AM, Peter Eisentraut wrote: That's beginning to sound a bit like a generics feature. E.g., CREATE FUNCTION the_same(arg_a T, arg_b T) RETURNS bool AS $$ SELECT arg_a IS DISTINCT FROM arg_b; $$; mmm, yeah... ISTM that expansion in this area should probably head toward

Re: [HACKERS] Triggers on columns

2009-09-08 Thread James Pye
On Sep 8, 2009, at 5:33 PM, Itagaki Takahiro wrote: WHEN clause in other times [1][2][3]. (All of them use "WHEN" for the syntax; that's why I proposed "WHEN" but not "WHERE".) Well, looks like WHEN is, or is going to be standard: ::= [ FOREACH { ROW | STATEMENT } ] [ WHEN ] (page 653

Re: [HACKERS] Triggers on columns

2009-09-08 Thread James Pye
On Sep 8, 2009, at 7:38 AM, Kevin Grittner wrote: David Fetter wrote: CREATE TRIGGER trig BEFORE UPDATE ON tbl FOR EACH ROW WHEN (NEW.col IS DISTINCT FROM OLD.col) EXECUTE PROCEDURE trigger_func(); How much does that buy you versus including this at the start of trigger_func: On

[HACKERS] still a wip, plpython3

2009-08-21 Thread James Pye
Thought another message might be appropriate as I've made some progress: finished up PEP302 interfaces on PyPgFunction objects(provides linecache support for tracebacks), IST support, DB error handling(pg error -> pyexc -> pg error), and, recently, some annoying type interface improvements.

Re: [HACKERS] [PATCH] plpythonu datatype conversion improvements

2009-08-16 Thread James Pye
On Aug 15, 2009, at 4:44 PM, Peter Eisentraut wrote: What's needed here, I think, is an API that takes a datum plus type information and checks whether the datum is valid within the domain. /agree =) -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your

Re: [HACKERS] xpath not a good replacement for xpath_string

2009-07-30 Thread James Pye
On Jul 29, 2009, at 12:12 PM, Andrew Dunstan wrote: As I said upthread, I think we can easily provide some extra convenience functions which will do what you want. The only thing I was really arguing about was the function name for such a gadget. +1. "xpath_string" does seem unfortunate, bu

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

[HACKERS] WIP: plpython3

2009-07-23 Thread James Pye
http://github.com/jwp/postgresql-plpython3/tree/plpython3 [branch name: plpython3] [src/pl/plpython3] (Yeah, I'm going to try to move it to git.postgresql.org soon-ish) In a recent thread[1], Peter said: That also means that maintaining a separate, parallel code base for a Python 3

Re: [HACKERS] git.postgresql.org vs. REL8_1_STABLE

2009-07-10 Thread James Pye
On Jul 10, 2009, at 11:03 AM, Joshua Tolley wrote: Am I the only one having problems building 8.1 from git? (Am I the only one building 8.1 from git?) In a clean repository, I've checked out REL8_1_STABLE, configured with only one argument, to set --prefix, and make gives me this: While n

Re: [HACKERS] Python 3.0 does not work with PL/Python

2009-05-29 Thread James Pye
On May 29, 2009, at 1:17 AM, Peter Eisentraut wrote: On Friday 29 May 2009 04:06:14 Andrew Dunstan wrote: Otherwise, I'm not too keen simply to throw Python 2.x overboard until it's no longer common on platforms people are likely to want to install Postgres on, if that's what's implied by th

Re: [HACKERS] Python 3.0 does not work with PL/Python

2009-05-04 Thread James Pye
On May 3, 2009, at 11:02 PM, Peter Eisentraut wrote: http://www.joelonsoftware.com/articles/fog69.html Good read. =) However, complete rewrite being relative in this case: WIP: http://github.com/jwp/postgresql-plpython3/tree/c804e693b6a0df98c0e5c465e75ba2e9014ebf37/src/pl/plpython3

Re: [HACKERS] Array types

2009-04-07 Thread James Pye
On Apr 7, 2009, at 12:54 PM, John Lister wrote: Cheers, nice to know it is possible... Now to see if i can get java/ python to do the same :) or to use a modified libpq somehow... http://python.projects.postgresql.org will do it for Python. =D tho, only supports Python 3, which is still quite

Re: [HACKERS] Python 3.0 does not work with PL/Python

2009-04-05 Thread James Pye
On Apr 5, 2009, at 8:54 AM, Tom Lane wrote: Hm, did you read the link I cited? It's not so surprising that 3.0 should have broken distutils, but what I found distressing is that they fixed distutils and then 3.0.1 broke it *again*. I stand by my opinion that Python 3 isn't stable yet. Ye

Re: [HACKERS] xpath processing brain dead

2009-03-20 Thread James Pye
On Mar 20, 2009, at 8:56 AM, Andrew Dunstan wrote: Andrew Dunstan wrote: A "/" at the beginning of a path expression is an abbreviation for the initial step fn:root(self::node()) treat as document-node()/ (however, if the "/" is the entire path expression, the trailing "/" is omitted

Re: [HACKERS] xpath processing brain dead

2009-02-28 Thread James Pye
On Feb 28, 2009, at 7:53 AM, Andrew Dunstan wrote: This is entirely out of the question for 8.3, as it's a significant change of behaviour. Yep. Even with implicit prefixing, the semantics are very different. What got me thinking about it was this: http://archives.postgresql.org/pgsql-bugs

Re: [HACKERS] xpath processing brain dead

2009-02-28 Thread James Pye
sigh.. I got curious. :P On Feb 27, 2009, at 7:19 PM, James Pye wrote: Well, that or force the user to call it explicitly. Attached is the patch that I used to get the results below.. This is just a proof of concept, so it's quite lacking. Notably, it doesn't even try to ide

Re: [HACKERS] xpath processing brain dead

2009-02-27 Thread James Pye
On Feb 26, 2009, at 7:03 PM, Andrew Dunstan wrote: can you point me at any call in libxml2 which will evaluate an xpath expression in the context of a nodeset instead of a document? No, I can't. node-sets are XPath objects not xmlNode objects, so I don't think it would be as simple as modify

Re: [HACKERS] xpath processing brain dead

2009-02-26 Thread James Pye
On Feb 26, 2009, at 5:41 PM, Andrew Dunstan wrote: http://www.exslt.org/exsl/functions/node-set/index.html A node-set isn't a document. yes.. :) I guess what I'm saying is that if: tinman=# SELECT XML''; xml -- (1 row) is considered to be valid per *SQL-XML*, then it sho

Re: [HACKERS] xpath processing brain dead

2009-02-26 Thread James Pye
On Feb 26, 2009, at 9:37 AM, Peter Eisentraut wrote: It's not about ill-formed pieces, it is about (well-formed) content fragments that are not full documents (exactly one root element). libxml2 doesn't support xpath on content fragments. exslt:node-set() to the rescue? Or is that/equivalent

[HACKERS] plpython

2003-09-04 Thread James Pye
Greetings, I've recently been spending some quality time with the plpython module, and I think I'm well on the road to an improved version of it(although, nothing about a trusted variant). By improved, I mostly mean cleaned up, and reorganized.. Here are some of the changes that I hav

[HACKERS] persistant psql feature suggestion

2003-06-27 Thread James Pye
Greets, Just a thought for a psql enhancement, afiak, it is not easily possible for persistent connections to a database in a shell script.. The ability for psql to remain in the background reading from stdin and writing to stdout until explicitly killed. More specifically, so a

[HACKERS] FROM ONLY limitation in RICs

2003-06-08 Thread James Pye
Does the SQL(99?) spec specify that referential integrity checks should have the FROM ONLY limitation? I ask because(afiak; I've googled and such, only found 92 which apparently does not specify anything about inheritance.) I have no access to the specs without spending money th