is defined only for integer data types, not for float8. So, if we
try a similar case with <literal>!</>, we get:
<screen>
-tgl=> select text '44' ! as "factorial";
+tgl=> select text '20' ! as "factorial";
ERROR: Unable to identify a postfix operator '!' for type 'text'
You may need to add parentheses or an explicit cast
</screen>
possible <literal>!</> operators should be preferred. We can help
it out with an explicit cast:
<screen>
-tgl=> select cast(text '44' as int8) ! as "factorial";
+tgl=> select cast(text '20' as int8) ! as "factorial";
factorial
---------------------
- 2673996885588443136
+ 2432902008176640000
(1 row)
</screen>
</para>
### module interface
# connects to a database
-def connect(dsn = None, user = None, password = None, host = None, database = None):
+def connect(dsn = None, user = None, password = None, xhost = None, database = None):
# first get params from DSN
dbport = -1
dbhost = ""
dbpasswd = password
if database != None:
dbbase = database
- if host != None:
+ if xhost != None:
try:
- params = string.split(host, ":")
+ params = string.split(xhost, ":")
dbhost = params[0]
dbport = int(params[1])
except: