this is very concerning, since other Postgresql functions only work if you *dont* put parenthesis, like "current_date". the parenthesis logic is currently based on the existence of arguments and was explicitly added for that reason.

so, we will either have to add a flag to "func" to indicate "no parenthesis", or somehow hardcode the postgres module to "know" when it needs to put parenthesis and when it doesnt, which seems like it would mean hardcoding of all the "non-parenthesis" function names.

what do you think ?

(to workaround immediately, use CURRENT_TIMESTAMP instead of now(), or comment out the "visit_function" function in PGCompiler, sqlalchemy/databases/postgres.py line 272)


On Mar 1, 2006, at 11:00 AM, Dennis wrote:

I'd like to use func.now() in my select statement to get the current
datetime from the db.. but I noticed that functions with no arguments
are outputted without parens in the select sql..

e.g.
s=select(]func.now()],engine=db)
str(s)
'select now'

It should be 'select now()'

Is there a workaround for this or is a patch needed?

Thanks
Dennis


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory! http://sel.as-us.falkag.net/sel? cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Sqlalchemy-users mailing list
Sqlalchemy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sqlalchemy-users



-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Sqlalchemy-users mailing list
Sqlalchemy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sqlalchemy-users

Reply via email to