[Mono-list] Which postgres client library?
Thu, 08 May 2003 12:09:40 -0400
> I've been using Npgsql and it is working pretty good. With that words he
> means that it is not full-implemented and it is not tested to work in
> all ways. I have a few table access (select, insert, update) and it
> works right for me.
Are you using query parameters at all? I ask because as far as I can
tell they're completely botched in the release that comes with Mono
0.24. Here's an excerpt from the Npgsql log file that I turned on (kudos
to the Npgsql developers for that awesome feature!)
--- Begin log excerpt ---
05/08/2003 11:56:45 3199 Debug Query sent: insert into
"core_compass_site" ("name", "title", "description", "keywords",
"show_module_titles", "current_revision_id", "pending_revision_id")
values (TestSite, A test site, , , False, 0, 0)
--- End log excerpt ---
Clearly, the bit after "values (" isn't *remotely* valid SQL. The SQL
string I specified had "values (:name, :title, :description, " etc, and
then I bound those parameters to the values "TestSite", "A test site",
DBNull.Value, etc. Obviously those should at LEAST be quoted before
sending them to the server, or better yet, not sent in the literal
string at all, but actually transmitted as parameters.
It clearly *is* sending it as a literal string, because the next thing
that happens is an error along the lines of "parse error near 'test'".
The Npgsql webpage
(http://gborg.postgresql.org/project/npgsql/projdisplay.php) seems to
suggest that parameters are working okay (look in the right-hand
column), but the behavior I'm seeing is nowhere near okay - is Mono
shipping an old version by any chance?
Anyone know if Mono.Data.PostgreSqlClient works any better, and whether
there's any docs on it anywhere?
Stuart Ballard, Senior Web Developer
FASTNET - Web Solutions
(215) 283-2300, ext. 126