Spent a little more time with this one, the problem seems to be autoload-ing a table that has an array of reals like:
CREATE TABLE test_tbl
(
  pk integer NOT NULL,
  newcol text,
  real_array real[],
  CONSTRAINT test_tbl_pkey PRIMARY KEY (pk)
)
WITH (
  OIDS=FALSE
);
ALTER TABLE test_tbl OWNER TO dgardner;

INSERT INTO test_tbl (pk, newcol, real_array) VALUES (6, '6', '{3.4000001,5.5}');

Then the following code will fail:

import sqlalchemy
print sqlalchemy.__version__
from sqlalchemy import *
from sqlalchemy.orm import *

engine = create_engine('postgresql+psycopg2://testuser:testu...@localhost/testdb')
metadata = MetaData(engine)

class A(object):
    pass

a_table = Table('test_tbl', metadata,autoload=True)


mapper(A, a_table)

session=create_session()

node = session.query(A).get(6)
print node.real_array


--
David Gardner
Pipeline Tools Programmer
Jim Henson Creature Shop
[email protected]


--
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to [email protected].
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