From:
David Blewett <david(at)dawninglight(dot)net>
To:
James William Pye <lists(at)jwp(dot)name>
Cc:
Greg Smith <greg(at)2ndquadrant(dot)com>, Peter Eisentraut <peter_e(at)gmx(dot)net>, jd(at)commandprompt(dot)com, Josh Berkus <josh(at)agliodbs(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>, PostgreSQL-development Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject:
Re: plpython3
Date:
2010-01-17 22:15:47
Message-ID:
9d1f8d831001171415v2f78b339o3f071a6280c763dd@mail.gmail.com (view raw or flat )
Thread:
2009-11-20 00:41:30 from James Pye <lists(at)jwp(dot)name>
2009-12-13 22:02:26 from James Pye <lists(at)jwp(dot)name>
2010-01-13 03:05:27 from Robert Haas <robertmhaas(at)gmail(dot)com>
2010-01-13 04:06:14 from Josh Berkus <josh(at)agliodbs(dot)com>
2010-01-13 17:47:18 from "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>
2010-01-13 17:53:11 from Peter Eisentraut <peter_e(at)gmx(dot)net>
2010-01-13 18:08:48 from "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>
2010-01-13 18:16:21 from Josh Berkus <josh(at)agliodbs(dot)com>
2010-01-13 19:15:09 from Robert Haas <robertmhaas(at)gmail(dot)com>
2010-01-14 04:39:05 from James William Pye <lists(at)jwp(dot)name>
2010-01-13 20:06:58 from James William Pye <lists(at)jwp(dot)name>
2010-01-13 20:12:05 from "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>
2010-01-13 21:27:37 from Peter Eisentraut <peter_e(at)gmx(dot)net>
2010-01-13 21:33:14 from "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>
2010-01-13 21:46:26 from Peter Eisentraut <peter_e(at)gmx(dot)net>
2010-01-14 04:12:38 from James William Pye <lists(at)jwp(dot)name>
2010-01-14 07:17:04 from Greg Smith <greg(at)2ndquadrant(dot)com>
2010-01-14 12:39:51 from Aidan Van Dyk <aidan(at)highrise(dot)ca>
2010-01-14 12:39:53 from James William Pye <lists(at)jwp(dot)name>
2010-01-14 21:03:46 from "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>
2010-01-15 20:26:13 from James William Pye <lists(at)jwp(dot)name>
2010-01-15 20:46:24 from "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>
2010-01-21 02:32:04 from James William Pye <lists(at)jwp(dot)name>
2010-01-25 19:12:14 from "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>
2010-01-15 02:08:08 from Greg Smith <greg(at)2ndquadrant(dot)com>
2010-01-17 21:06:19 from James William Pye <lists(at)jwp(dot)name>
2010-01-17 21:07:07 from James William Pye <lists(at)jwp(dot)name>
2010-01-17 22:15:47 from David Blewett <david(at)dawninglight(dot)net>
2010-01-23 20:28:18 from James William Pye <lists(at)jwp(dot)name>
2010-01-26 23:23:38 from "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>
2010-02-01 18:20:47 from Robert Haas <robertmhaas(at)gmail(dot)com>
2010-02-01 18:29:10 from "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>
2010-02-01 18:37:57 from Robert Haas <robertmhaas(at)gmail(dot)com>
2010-02-01 19:18:02 from James William Pye <lists(at)jwp(dot)name>
2010-05-08 20:00:46 from James William Pye <lists(at)jwp(dot)name>
2010-02-01 18:53:23 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2010-02-01 19:00:08 from Alvaro Herrera <alvherre(at)commandprompt(dot)com>
2010-02-01 19:01:32 from Robert Haas <robertmhaas(at)gmail(dot)com>
2010-02-01 19:13:50 from "David E(dot) Wheeler" <david(at)kineticode(dot)com>
2010-02-01 20:01:28 from Nathan Boley <npboley(at)gmail(dot)com>
2010-02-01 20:12:41 from "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>
2010-02-01 20:13:43 from Robert Haas <robertmhaas(at)gmail(dot)com>
2010-02-01 20:23:21 from Nathan Boley <npboley(at)gmail(dot)com>
2010-02-01 22:35:38 from James William Pye <lists(at)jwp(dot)name>
2010-02-01 20:35:39 from Peter Eisentraut <peter_e(at)gmx(dot)net>
2010-02-01 20:57:54 from "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>
2010-02-01 21:11:51 from Alvaro Herrera <alvherre(at)commandprompt(dot)com>
2010-02-01 21:13:39 from Bruce Momjian <bruce(at)momjian(dot)us>
2010-02-01 21:30:29 from "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>
2010-02-01 21:31:41 from Bruce Momjian <bruce(at)momjian(dot)us>
2010-02-01 21:39:12 from "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>
2010-02-01 21:43:56 from Josh Berkus <josh(at)agliodbs(dot)com>
2010-02-01 22:09:14 from Robert Haas <robertmhaas(at)gmail(dot)com>
2010-02-01 21:38:48 from James William Pye <lists(at)jwp(dot)name>
Lists:
pgsql-hackers
On Sun, Jan 17, 2010 at 4:07 PM, James William Pye <lists(at)jwp(dot)name> wrote:
> The effect of this is that every time the FUNCTION is called from PG, the import statements are ran, a new class object, UrlOpener, is created, and a new function object, translate, is created. Granted, a minor amount of overhead in this case, but the point is that in order to avoid it the author would have to use SD:
>
> if "urlopener" in SD:
> UrlOpener = SD["urlopener"]
> else:
> class UrlOpener(urllib.UrlOpener):
> ...
> SD["urlopener"] = UrlOpener
>
> While some may consider this a minor inconvenience, the problem is that *setup code is common*, so it's, at least, a rather frequent, minor inconvenience.
>
>
> With function modules, users have a module body to run any necessary setup code.
Coming from a Python developer perspective, this is indeed an
improvement. I always thought the whole SD/GD thing was a little odd.
Doing the setup at the module level and relying on the interpreter to
keep it cached is much more "Pythonic" and is a common idiom.
David
In response to
pgsql-hackers by date
Next :From: Tom LaneDate: 2010-01-17 23:22:27
Subject : Re: Patch: Remove gcc dependency in definition of inline functions
Previous :From : Jeff DavisDate : 2010-01-17 22:03:00
Subject : is this a bug?