On 10/1/06 11:11 AM, Randal L. Schwartz wrote:
> And 'now' it simplifies a bunch of my code.

Keep in mind that there's a subtle difference between "now" used in a
database like Pg that understands the value, and "now" used in a db like
MySQL that doesn't.

When "now" is evaluated by the database in Pg, the same value is used for an
entire transaction.  When it's evaluated client-side by Perl, different
objects may get different values for "now" if some significant time has
passed between each parse_date() call.

Since values that look like function calls are passed through in all cases,
one way to force the server-side evaluation is to use "now()" instead.  If a
database does not have a now() function (e.g., Postgres) it's should be
trivial to write one.  DateTime->now is always client-side, of course.

If you don't care about using the same value for every possible database,
then just be aware of the differences and use the appropriate value for your
database.  

-John



-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Rose-db-object mailing list
Rose-db-object@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rose-db-object

Reply via email to