On Fri, 4 Jan 2013 11:47:34 -0500
Patrick TJ McPhee <[email protected]> wrote:
> I just had an inconsistency in db.insert and db.update brought to my 
> attention. Previous versions of pygresql accepted the various date
> literals (current_timestamp et al) as values in db.insert() and
> db.update(). Since the new version no longer quotes values, the way
> these values were massaged before is no longer applied. I don't
> believe there's a loss of functionality since you can always use
> 'now' or 'today', but there's the potential to break existing code.

Can you suggest some unit tests that fail for 4.1 that work in 4.0?  I
would like to make sure that we don't have any regressions.

> There's something similar for booleans, but all the "true" values
> listed there appear to still work, and the obvious antonyms still
> work for false. However, previously any string not listed as "true"
> evaluated to false, and any other type of python value would be
> evaluated based on its python boolean. This no longer works.

Hmm.  That code does not appear to have changed.  How far back do you
see the behaviour that you describe?  What value does not work?

> NULL values are also set differently with this version. With the
> previous implementation, "" was inserted as NULL for boolean and
> money, any value which evaluates to false in python was inserted as
> NULL for dates, and any value which evaluates to false except for 0
> was inserted as NULL for numerics. This doesn't work any more.

How so?  I tested False and 0 and both evaluate to NULL.

> I have a patch which sets NULL values and non-string booleans the way
> they were before. There's no reason it couldn't also handle the date
> literals and string booleans -- I personally would prefer not to have
> that if it's not causing major pain for anyone.

Let's see the patch as well as the unit tests.  Knowing where you work
I assume that you are OK with unit tests.  :-)

> While I'm reporting things, I found the change in return values from 
> getnotify() has broken pgnotify. pgnotify hasn't changed since 2001
> and doesn't appear to be on the net any more -- it provides a class
> that selects on db.fileno() and calls a callback function with the
> results of getnotify(), but it provides a convenient interface for
> processing notifications synchronously.

It is part of the classic interface now.

-- 
D'Arcy J.M. Cain
PyGreSQL Development Group
http://www.PyGreSQL.org IM:[email protected]
_______________________________________________
PyGreSQL mailing list
[email protected]
https://mail.vex.net/mailman/listinfo.cgi/pygresql

Reply via email to