Skip site navigation (1) Skip section navigation (2)

Re: Confusion over Python drivers

From: "Greg Sabino Mullane" <greg(at)turnstep(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Confusion over Python drivers
Date: 2010-02-11 17:08:30
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-hackers
Hash: RIPEMD160

>>The solution is to write the query in an unambiguous way:
>>  SELECT $1::date + 1;
>>which is good practice, anyway. If it's not obvious to the type
>>inference system, it's probably not obvious to you, and will probably
>>surprise you ;)
> That address this specific case, but it's ugly and not general. The right
> thing is to set the correct type when you're marshalling the parameters...

Well, ugly is in the eye of the beholder, and it certainly is a general 
solution. Any query with ambiguity in its parameters should explicitly 
declare the types, inside the query itself. Having the driver indicate 
the type should be the exception, not the rule.

- -- 
Greg Sabino Mullane greg(at)turnstep(dot)com
End Point Corporation
PGP Key: 0x14964AC8 201002091811

In response to


pgsql-hackers by date

Next:From: Kris JurkaDate: 2010-02-11 17:23:03
Subject: Re: TCP keepalive support for libpq
Previous:From: Tollef Fog HeenDate: 2010-02-11 17:08:03
Subject: Re: TCP keepalive support for libpq

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group