[storm] How to CREATE DATABASE using Storm
Mario Zito
mazito at analyte.com
Wed Apr 21 23:37:33 BST 2010
Hi, All:
I'd like to to connect to a db server, create a
database, and then start using it. However, it appears that the
Storm api assumes the existence of a database to connect to, before you
can execute some sql. I'm not able to connect to the server without a
database specified.
So, I tried:
db= create_database("postgres://postgres:password@localhost/postgres")
cx= db.connect()
cx.execute("CREATE DATABASE demo_1")
But I get:
psycopg2.InternalError: CREATE DATABASE cannot run inside a transaction block
I tried some alternatives, like using raw_execute(), but have no success. Is
there a solution to this using Storm ?
I know I can resolve this starting a child process and executing pgsql with
a sql script, but would like a better solution :-)
Thanks !!!
Mario
--
Mario A. Zito
ANALYTE SRL
Parana 457, piso 2, of. 'A'
(C1033AAI) Buenos Aires, Argentina
tel: (54-11) 5258-0205 int 138
mazito at analyte.com
www.analyte.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://lists.ubuntu.com/archives/storm/attachments/20100421/38b57cb3/attachment.htm
More information about the storm
mailing list