From:
Florian Weimer <fw(at)deneb(dot)enyo(dot)de>
To:
Jeff Davis <pgsql(at)j-davis(dot)com>
Cc:
PostgreSQL-development <pgsql-hackers(at)postgreSQL(dot)org>
Subject:
Re: Confusion over Python drivers
Date:
2010-02-14 19:43:03
Message-ID:
87ocjrr4c8.fsf@mid.deneb.enyo.de (view raw or flat )
Thread:
2010-02-05 14:19:26 from Bruce Momjian <bruce(at)momjian(dot)us>
2010-02-05 14:28:10 from "Massa, Harald Armin" <chef(at)ghum(dot)de>
2010-02-05 14:38:33 from Bruce Momjian <bruce(at)momjian(dot)us>
2010-02-05 19:22:50 from Jeff Davis <pgsql(at)j-davis(dot)com>
2010-02-05 14:43:18 from Peter Eisentraut <peter_e(at)gmx(dot)net>
2010-02-05 14:45:45 from Bruce Momjian <bruce(at)momjian(dot)us>
2010-02-05 18:35:57 from Josh Berkus <josh(at)agliodbs(dot)com>
2010-02-05 18:50:32 from Bruce Momjian <bruce(at)momjian(dot)us>
2010-02-05 19:32:10 from Jeff Davis <pgsql(at)j-davis(dot)com>
2010-02-05 14:45:32 from Tim Bunce <Tim(dot)Bunce(at)pobox(dot)com>
2010-02-05 14:46:14 from Bruce Momjian <bruce(at)momjian(dot)us>
2010-02-05 15:00:45 from Peter Eisentraut <peter_e(at)gmx(dot)net>
2010-02-05 17:01:42 from Bruce Momjian <bruce(at)momjian(dot)us>
2010-02-05 18:34:23 from Josh Berkus <josh(at)agliodbs(dot)com>
2010-02-05 19:54:39 from James William Pye <lists(at)jwp(dot)name>
2010-02-05 20:34:53 from Marko Kreen <markokr(at)gmail(dot)com>
2010-02-05 20:49:01 from Bruce Momjian <bruce(at)momjian(dot)us>
2010-02-06 00:39:53 from Andres Freund <andres(at)anarazel(dot)de>
2010-02-06 00:42:35 from Josh Berkus <josh(at)agliodbs(dot)com>
2010-02-06 02:18:58 from James William Pye <lists(at)jwp(dot)name>
2010-02-07 00:51:18 from Josh Berkus <josh(at)agliodbs(dot)com>
2010-02-07 04:50:31 from James William Pye <lists(at)jwp(dot)name>
2010-02-06 22:38:37 from Greg Smith <greg(at)2ndquadrant(dot)com>
2010-02-06 23:55:30 from Bruce Momjian <bruce(at)momjian(dot)us>
2010-02-07 00:48:33 from Marko Kreen <markokr(at)gmail(dot)com>
2010-02-07 02:11:01 from Robert Haas <robertmhaas(at)gmail(dot)com>
2010-02-07 10:20:13 from Marko Kreen <markokr(at)gmail(dot)com>
2010-02-07 11:27:45 from "Massa, Harald Armin" <chef(at)ghum(dot)de>
2010-02-07 19:50:05 from Josh Berkus <josh(at)agliodbs(dot)com>
2010-02-07 20:23:06 from Greg Smith <greg(at)2ndquadrant(dot)com>
2010-02-07 10:18:26 from Greg Smith <greg(at)2ndquadrant(dot)com>
2010-02-07 19:54:35 from Greg Smith <greg(at)2ndquadrant(dot)com>
2010-02-08 09:06:46 from Gabriele Bartolini <gabriele(dot)bartolini(at)2ndQuadrant(dot)it>
2010-02-11 05:26:56 from Andrew McNamara <andrewm(at)object-craft(dot)com(dot)au>
2010-02-11 05:46:32 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2010-02-11 06:04:08 from Andrew McNamara <andrewm(at)object-craft(dot)com(dot)au>
2010-02-07 23:53:26 from Andrew McNamara <andrewm(at)object-craft(dot)com(dot)au>
2010-02-08 00:19:33 from Greg Smith <greg(at)2ndquadrant(dot)com>
2010-02-08 01:25:43 from Andrew McNamara <andrewm(at)object-craft(dot)com(dot)au>
2010-02-08 06:56:20 from Jeff Davis <pgsql(at)j-davis(dot)com>
2010-02-08 19:50:37 from Florian Weimer <fw(at)deneb(dot)enyo(dot)de>
2010-02-08 22:15:57 from Andrew McNamara <andrewm(at)object-craft(dot)com(dot)au>
2010-02-08 23:34:25 from Jeff Davis <pgsql(at)j-davis(dot)com>
2010-02-08 23:46:54 from Andrew McNamara <andrewm(at)object-craft(dot)com(dot)au>
2010-02-09 00:01:55 from Jeff Davis <pgsql(at)j-davis(dot)com>
2010-02-09 01:51:09 from Andrew McNamara <andrewm(at)object-craft(dot)com(dot)au>
2010-02-09 02:38:47 from Jeff Davis <pgsql(at)j-davis(dot)com>
2010-02-09 02:56:49 from Andrew McNamara <andrewm(at)object-craft(dot)com(dot)au>
2010-02-09 04:20:19 from Jeff Davis <pgsql(at)j-davis(dot)com>
2010-02-09 04:32:26 from Jeff Davis <pgsql(at)j-davis(dot)com>
2010-02-09 06:53:54 from Andrew McNamara <andrewm(at)object-craft(dot)com(dot)au>
2010-02-11 17:08:30 from "Greg Sabino Mullane" <greg(at)turnstep(dot)com>
2010-02-12 07:28:26 from Andrew McNamara <andrewm(at)object-craft(dot)com(dot)au>
2010-02-12 14:31:27 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2010-02-13 01:07:42 from Andrew McNamara <andrewm(at)object-craft(dot)com(dot)au>
2010-02-08 08:14:22 from "Massa, Harald Armin" <chef(at)ghum(dot)de>
2010-02-08 08:36:52 from Greg Smith <greg(at)2ndquadrant(dot)com>
2010-02-08 11:55:11 from "Massa, Harald Armin" <chef(at)ghum(dot)de>
2010-02-08 23:50:53 from Jeff Davis <pgsql(at)j-davis(dot)com>
2010-02-05 19:08:31 from James William Pye <lists(at)jwp(dot)name>
2010-02-05 20:51:06 from Greg Smith <greg(at)2ndquadrant(dot)com>
2010-02-05 21:01:52 from Bruce Momjian <bruce(at)momjian(dot)us>
2010-02-05 23:47:19 from Marko Kreen <markokr(at)gmail(dot)com>
2010-02-07 06:40:35 from Jeff Davis <pgsql(at)j-davis(dot)com>
2010-02-08 14:32:08 from "Greg Sabino Mullane" <greg(at)turnstep(dot)com>
2010-02-08 19:29:42 from Florian Weimer <fw(at)deneb(dot)enyo(dot)de>
2010-02-08 20:38:40 from Jeff Davis <pgsql(at)j-davis(dot)com>
2010-02-14 19:43:03 from Florian Weimer <fw(at)deneb(dot)enyo(dot)de>
2010-02-16 03:48:32 from Jeff Davis <pgsql(at)j-davis(dot)com>
Lists:
pgsql-hackers
* Jeff Davis:
> Agreed. Ultimately, the conversion has to be done somewhere, but I don't
> believe the driver is the place for it. Type conversions are always
> going to be imperfect, and this has some important consequences:
> * The type conversion system will be endlessly tweaked to improve it
> * Developers will always run into problems with it in any complex
> application, so we need to allow them to circumvent the system and do it
> themselves when necessary.
The downside is that passing strings up to the application may have
distinctly worse performance characteristics than passing a number.
> In ruby-pg, you can just do:
>
> conn.exec("INSERT INTO foo VALUES($1)", ["Jeff"])
>
> And I think that's appropriate. What I'm saying is that there should
> still exist some way to pass explicit types or formats (although that
> should still be easier than it is in C ;). Here's the long form:
>
> conn.exec("INSERT INTO foo VALUES($1)",
> [{:value => "Jeff", :format => 0, :type => 0}])
Okay, this isn't too bad an API. I will use the same approach. In my
case, it means no transparent support for arrays, but per your own
guidelines, this is okay.
> That copies value so that foo and bar have the same contents: a 4 byte
> value "\000". What would happen though, if val was transparently
> decoded? It would decode it once in ruby, and again inside of postgres
> (in byteain), leaving you with a one byte value in bar, even though foo
> has a four-byte value.
I've never viewed it from this angle, and I agree that it makes sense.
Thanks for your observations and explanations, they were helpful.
In response to
Responses
pgsql-hackers by date
Next :From: Peter EisentrautDate: 2010-02-14 20:02:00
Subject : Re: Streaming Replication docs
Previous :From : Tom LaneDate : 2010-02-14 18:47:41
Subject : Re: Listen / Notify - what to do when the queue is full