I'm not sure I completely understand what's going on, so I apologize
is this is obvious use error :)

I'm trying to add to the create_all() method (by wrapping in my own
method) for some custom SQL to be executed after the basic
metadata.create_all() method is finished.

More specifically, I have something like this:

def create_all(metadata, engine):
    metadata.create_all(engine)
    s = Session()
    s.begin()
    engine.func.AddGeometryColumn('mytable', 'geo_col', 4326, 'POINT',
2).execute()
    s.commit()

(This is PostGIS releated, but the problem appears to be unrelated to
that specifically.)

When I run my version of create_all(), I don't get any errors, but the
subsequent statement(s) are executed within a transaction that gets
rolled back.  This happens regardless of whether I encapsulate my unit
of work in a new Session.

In the postgresql logs, I see:

<a whole bunch of expected log lines about creating my tables, etc.>
2008-06-17 10:28:09 EDT LOG:  statement: COMMIT
2008-06-17 10:28:09 EDT LOG:  statement: BEGIN; SET TRANSACTION
ISOLATION LEVEL READ COMMITTED
2008-06-17 10:28:09 EDT LOG:  statement: SELECT
AddGeometryColumn(E'mytable', E'geo_col', 4326, E'POINT', 2) AS
"AddGeometryColumn_1"
2008-06-17 10:28:09 EDT LOG:  statement: ROLLBACK

Is this expected / am I doing something wrong?

Thanks in advance -

Hans


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to