<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress/2.0.2" -->
<rss version="2.0" 
	xmlns:content="http://purl.org/rss/1.0/modules/content/">
<channel>
	<title>Comments on: pg8000 v1.00 &#8212; a new PostgreSQL/Python interface</title>
	<link>http://mathieu.fenniak.net/pg8000_v100/</link>
	<description>The Ordinary Life of Some Guy</description>
	<pubDate>Mon, 01 Dec 2008 20:18:53 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.0.2</generator>

	<item>
		<title>by: Strictly Business &#187; Blog Archive &#187; Antithesis</title>
		<link>http://mathieu.fenniak.net/pg8000_v100/#comment-23827</link>
		<pubDate>Sat, 04 Aug 2007 02:54:05 +0000</pubDate>
		<guid>http://mathieu.fenniak.net/pg8000_v100/#comment-23827</guid>
					<description>[...] I haven&amp;#8217;t tried it yet, but assuming that I can make easy use ofpg8000, a PostgreSQL that throws out c-based bindings and speaking postgresql-ish in native python, then it&amp;#8217;s an example of the anti-thesis of &amp;#8220;dragon tea&amp;#8221;. It doesn&amp;#8217;t appear to require hunting down obscure dependencies, it doesn&amp;#8217;t require that you build ten other equally obscure things before you can use it, and if it delivers what it promises it will make developer&amp;#8217;s lives much easier. [...]</description>
		<content:encoded><![CDATA[<p>[&#8230;] I haven&#8217;t tried it yet, but assuming that I can make easy use ofpg8000, a PostgreSQL that throws out c-based bindings and speaking postgresql-ish in native python, then it&#8217;s an example of the anti-thesis of &#8220;dragon tea&#8221;. It doesn&#8217;t appear to require hunting down obscure dependencies, it doesn&#8217;t require that you build ten other equally obscure things before you can use it, and if it delivers what it promises it will make developer&#8217;s lives much easier. [&#8230;]
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Luis Bruno</title>
		<link>http://mathieu.fenniak.net/pg8000_v100/#comment-7389</link>
		<pubDate>Mon, 12 Mar 2007 17:35:07 +0000</pubDate>
		<guid>http://mathieu.fenniak.net/pg8000_v100/#comment-7389</guid>
					<description>Speaking for myself, I don't think binary client libraries are a &quot;bad&quot; dependency. OTOH, I strongly dislike having to *compile* something to access a database.

I actually like the Windows model: Next -&amp;#62; Next -&amp;#62; Next -&amp;#62; Install. .oO(OT: except that now I use .msi files and a silent installation)</description>
		<content:encoded><![CDATA[<p>Speaking for myself, I don&#8217;t think binary client libraries are a &#8220;bad&#8221; dependency. OTOH, I strongly dislike having to *compile* something to access a database.</p>
<p>I actually like the Windows model: Next -&gt; Next -&gt; Next -&gt; Install. .oO(OT: except that now I use .msi files and a silent installation)
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Luis Bruno</title>
		<link>http://mathieu.fenniak.net/pg8000_v100/#comment-7388</link>
		<pubDate>Mon, 12 Mar 2007 17:32:04 +0000</pubDate>
		<guid>http://mathieu.fenniak.net/pg8000_v100/#comment-7388</guid>
					<description>I meant: use pg_config during &quot;setup.py install&quot;, not in &quot;runtime&quot;; then &quot;hardcode&quot; the value you find.

I was *so* sure that pg_config provides the socket path. My experience with pg_config comes from psycopg2, which is a different use case.

I guess I'll have a look around.</description>
		<content:encoded><![CDATA[<p>I meant: use pg_config during &#8220;setup.py install&#8221;, not in &#8220;runtime&#8221;; then &#8220;hardcode&#8221; the value you find.</p>
<p>I was *so* sure that pg_config provides the socket path. My experience with pg_config comes from psycopg2, which is a different use case.</p>
<p>I guess I&#8217;ll have a look around.
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Joel Lawhead</title>
		<link>http://mathieu.fenniak.net/pg8000_v100/#comment-7386</link>
		<pubDate>Mon, 12 Mar 2007 14:57:48 +0000</pubDate>
		<guid>http://mathieu.fenniak.net/pg8000_v100/#comment-7386</guid>
					<description>Mathieu,

This is great. Pure Python libraries are way underrated.  Python's ability to interface with C libraries is great but it's nice to have pure Python alternatives with no dependencies.</description>
		<content:encoded><![CDATA[<p>Mathieu,</p>
<p>This is great. Pure Python libraries are way underrated.  Python&#8217;s ability to interface with C libraries is great but it&#8217;s nice to have pure Python alternatives with no dependencies.
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Paul Boddie</title>
		<link>http://mathieu.fenniak.net/pg8000_v100/#comment-7385</link>
		<pubDate>Mon, 12 Mar 2007 14:37:42 +0000</pubDate>
		<guid>http://mathieu.fenniak.net/pg8000_v100/#comment-7385</guid>
					<description>I think the PostgreSQL people really need to provide some kind of API which can say whether a statement can use cursors. It took a while for bind parameters/variables to be supported properly via the client APIs, as far as I recall, but anything of this nature is really important for anyone doing stuff outside the database. One suggestion with psycopg2 was to use &quot;named cursors&quot; explicitly, but that's really inconvenient if you're keeping an eye on portability with other database modules - I'd have to employ another layer just to hide such incompatibilities.

I'll keep an eye on your project, however, and hope that I can use it in preference to the other modules in the future. It's true that pyPgSQL does some tests on statements to see if they're likely to work with cursors, and my patch to psycopg2 does similar things. The big problem with PostgreSQL, in my opinion, is that it's often very good technically in so many areas, only to be let down by one or two minor details which can &quot;sour the deal&quot;.</description>
		<content:encoded><![CDATA[<p>I think the PostgreSQL people really need to provide some kind of API which can say whether a statement can use cursors. It took a while for bind parameters/variables to be supported properly via the client APIs, as far as I recall, but anything of this nature is really important for anyone doing stuff outside the database. One suggestion with psycopg2 was to use &#8220;named cursors&#8221; explicitly, but that&#8217;s really inconvenient if you&#8217;re keeping an eye on portability with other database modules - I&#8217;d have to employ another layer just to hide such incompatibilities.</p>
<p>I&#8217;ll keep an eye on your project, however, and hope that I can use it in preference to the other modules in the future. It&#8217;s true that pyPgSQL does some tests on statements to see if they&#8217;re likely to work with cursors, and my patch to psycopg2 does similar things. The big problem with PostgreSQL, in my opinion, is that it&#8217;s often very good technically in so many areas, only to be let down by one or two minor details which can &#8220;sour the deal&#8221;.
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Mathieu Fenniak</title>
		<link>http://mathieu.fenniak.net/pg8000_v100/#comment-7384</link>
		<pubDate>Mon, 12 Mar 2007 14:21:48 +0000</pubDate>
		<guid>http://mathieu.fenniak.net/pg8000_v100/#comment-7384</guid>
					<description>Paul -- pyPgSQL has always been my favourite PostgreSQL wrapper library.  So, to anyone reading this, I'm not criticizing.  I like the approach taken in pg8000 because it is simpler, and requires less code.

For example, pyPgSQL compares queries against regular expressions to determine whether &quot;DECLARE CURSOR&quot; can use the query.  This obviously works, but I believe it is inflexible.  An SQL command &quot;EXECUTE&quot;, to run a prepared statement, would not use the cursor functionality because it doesn't match the &quot;SELECT&quot; regular expression.  Assuming that the regular expressions in the library are perfect, they wouldn't be future-proof -- what if new versions of PostgreSQL add some new statement that returns a result set?  pg8000 would work the same as usual with the new statement.

One of my favourite facts about pg8000 is that it uses the binary data transfer format selectively for some types.  For example, floats are transmitted in binary format, which actually has impact on their value as compared to text formats.  The bytea type, which isn't implemented yet in pg8000, will not require escaping the text being sent across the wire.  The timestamp type does not work well with the binary transfer format since it can sometimes be a float8, and sometimes not, so the text format is used again.  Very flexible type implementation that I am happy with.</description>
		<content:encoded><![CDATA[<p>Paul &#8212; pyPgSQL has always been my favourite PostgreSQL wrapper library.  So, to anyone reading this, I&#8217;m not criticizing.  I like the approach taken in pg8000 because it is simpler, and requires less code.</p>
<p>For example, pyPgSQL compares queries against regular expressions to determine whether &#8220;DECLARE CURSOR&#8221; can use the query.  This obviously works, but I believe it is inflexible.  An SQL command &#8220;EXECUTE&#8221;, to run a prepared statement, would not use the cursor functionality because it doesn&#8217;t match the &#8220;SELECT&#8221; regular expression.  Assuming that the regular expressions in the library are perfect, they wouldn&#8217;t be future-proof &#8212; what if new versions of PostgreSQL add some new statement that returns a result set?  pg8000 would work the same as usual with the new statement.</p>
<p>One of my favourite facts about pg8000 is that it uses the binary data transfer format selectively for some types.  For example, floats are transmitted in binary format, which actually has impact on their value as compared to text formats.  The bytea type, which isn&#8217;t implemented yet in pg8000, will not require escaping the text being sent across the wire.  The timestamp type does not work well with the binary transfer format since it can sometimes be a float8, and sometimes not, so the text format is used again.  Very flexible type implementation that I am happy with.
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Paul Boddie</title>
		<link>http://mathieu.fenniak.net/pg8000_v100/#comment-7378</link>
		<pubDate>Mon, 12 Mar 2007 11:24:45 +0000</pubDate>
		<guid>http://mathieu.fenniak.net/pg8000_v100/#comment-7378</guid>
					<description>How about using various techniques employed by pyPgSQL to get cursors working properly? I've been using psycopg2 and have had to patch it to have &quot;server-side&quot; cursors, mostly because my client balloons like an overfed python with the amounts of data I'm working with if it all gets transferred back to the client.</description>
		<content:encoded><![CDATA[<p>How about using various techniques employed by pyPgSQL to get cursors working properly? I&#8217;ve been using psycopg2 and have had to patch it to have &#8220;server-side&#8221; cursors, mostly because my client balloons like an overfed python with the amounts of data I&#8217;m working with if it all gets transferred back to the client.
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Mathieu Fenniak</title>
		<link>http://mathieu.fenniak.net/pg8000_v100/#comment-7315</link>
		<pubDate>Sun, 11 Mar 2007 06:24:38 +0000</pubDate>
		<guid>http://mathieu.fenniak.net/pg8000_v100/#comment-7315</guid>
					<description>Seo -- I wasn't aware of bpgsql when I began this project.  A quick review shows quite a few similarities between the modules, but I prefer the approach I have taken.

For example, bpgsql escapes strings on the client side and builds a complete command to upload to the server, whereas pg8000 uses PG bind variables to avoid having to escape the string.  If both are implemented right, I don't think there's a practical difference between the two.  I believe my approach is more conservative in letting the database server handle what has traditionally been a source of security problems in databases (SQL injection possibilities).  On the other hand, creating a DB-API compliant interface that supports another parameter quoting style means that I need to rewrite the query into a new parameter style, which could be a source of obscure bugs too.

pg8000 uses the PostgreSQL &quot;extended query&quot; protocol for queries, which means that prepared statements and cursors come for free.  I've built the API to represent that, and it has allowed me to reduce memory consumption by caching a limited number of rows from the server response.  I think that's a valuable feature in the library.  But it could be done with some clever middleware around any PostgreSQL library.

There are lots of differences between the two libraries.  My opinion about them is bound to be biased, as I am proud of my work.  Maybe once pg8000 supports DB-API 2.0 we'll be on even ground to compare the two.</description>
		<content:encoded><![CDATA[<p>Seo &#8212; I wasn&#8217;t aware of bpgsql when I began this project.  A quick review shows quite a few similarities between the modules, but I prefer the approach I have taken.</p>
<p>For example, bpgsql escapes strings on the client side and builds a complete command to upload to the server, whereas pg8000 uses PG bind variables to avoid having to escape the string.  If both are implemented right, I don&#8217;t think there&#8217;s a practical difference between the two.  I believe my approach is more conservative in letting the database server handle what has traditionally been a source of security problems in databases (SQL injection possibilities).  On the other hand, creating a DB-API compliant interface that supports another parameter quoting style means that I need to rewrite the query into a new parameter style, which could be a source of obscure bugs too.</p>
<p>pg8000 uses the PostgreSQL &#8220;extended query&#8221; protocol for queries, which means that prepared statements and cursors come for free.  I&#8217;ve built the API to represent that, and it has allowed me to reduce memory consumption by caching a limited number of rows from the server response.  I think that&#8217;s a valuable feature in the library.  But it could be done with some clever middleware around any PostgreSQL library.</p>
<p>There are lots of differences between the two libraries.  My opinion about them is bound to be biased, as I am proud of my work.  Maybe once pg8000 supports DB-API 2.0 we&#8217;ll be on even ground to compare the two.
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Seo Sanghyeon</title>
		<link>http://mathieu.fenniak.net/pg8000_v100/#comment-7313</link>
		<pubDate>Sun, 11 Mar 2007 05:34:00 +0000</pubDate>
		<guid>http://mathieu.fenniak.net/pg8000_v100/#comment-7313</guid>
					<description>How does this compare to bpgsql, another pure Python PostgreSQL client?
http://barryp.org/software/bpgsql/</description>
		<content:encoded><![CDATA[<p>How does this compare to bpgsql, another pure Python PostgreSQL client?<br />
<a href='http://barryp.org/software/bpgsql/' rel='nofollow'>http://barryp.org/software/bpgsql/</a>
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Kye</title>
		<link>http://mathieu.fenniak.net/pg8000_v100/#comment-7263</link>
		<pubDate>Sat, 10 Mar 2007 18:06:11 +0000</pubDate>
		<guid>http://mathieu.fenniak.net/pg8000_v100/#comment-7263</guid>
					<description>May I suggest a more standard layout (trunk, tags, branches)?

Anyway, congratulations for your pure python approach. To my
understanding, in this field the java people is far far away from
us, because they *believe* in their language. Just in the DB case,
they have all those type 4 drivers for all mayor db vendors.
That's pure java!. No clients, no deployment nightmare. And this
is even worst in the python world because creating C extensions
for windows can be a headache (because compiler dependences).

So I hope the best for this project (if you open the development
or try to join the psycopg people, there will be more possibilities
of success, but it's your call).</description>
		<content:encoded><![CDATA[<p>May I suggest a more standard layout (trunk, tags, branches)?</p>
<p>Anyway, congratulations for your pure python approach. To my<br />
understanding, in this field the java people is far far away from<br />
us, because they *believe* in their language. Just in the DB case,<br />
they have all those type 4 drivers for all mayor db vendors.<br />
That&#8217;s pure java!. No clients, no deployment nightmare. And this<br />
is even worst in the python world because creating C extensions<br />
for windows can be a headache (because compiler dependences).</p>
<p>So I hope the best for this project (if you open the development<br />
or try to join the psycopg people, there will be more possibilities<br />
of success, but it&#8217;s your call).
</p>
]]></content:encoded>
				</item>
</channel>
</rss>
