Discussion:
[Modeling-users] modeling and Postgres array columns
ee
2003-12-19 04:53:01 UTC
Permalink
While we're at it, does the modeling.py framework support Postgres array
columns? If not, any sense of how hard it would be for an EOF-experienced
developer to add this?

Thx,

Ezra E.
Sebastien Bigaret
2003-12-20 13:59:01 UTC
Permalink
Post by ee
While we're at it, does the modeling.py framework support Postgres array
columns? If not, any sense of how hard it would be for an EOF-experienced
developer to add this?
I did not know anything about postgresql column arrays before i read
your mail :/ so it's hard for me to establish a precise timeframe.

To all: shortly put, array columns allows a table's column to receive
arrays of datas. For more you can refer to:
http://www.postgresql.org/docs/aw_pgsql_book/node95.html
http://www.postgresql.org/docs/7.3/interactive/arrays.html
http://www.postgresql.org/docs/7.4/interactive/arrays.html

Some quick investigations showed me that among the three supported
python-db adaptor for postgresql, i.e. psycopg, pgdb and pyPgSQL, only
the latter supports arrays; the first two do not and simply return
strings (NB: these preliminary tests were made w/ postgresql 7.3 and
the pyadaptors were compiled & linked w/ pg7.3 headers & lib., and
I've no idea on whether they behave the same w/ pg7.4). Does it mean
the framework will need to handle the array types by itself when using
psycopg or pgdb? I'm not sure I like that...

If you want to investigate how hard it can be to add support for this, I
suggest you first try to consider them as 'custom types' and design the
code for supporting them.
-- http://modeling.sourceforge.net/UserGuide/attribute-custom-type.html

Agreed, this is only a first step towards integration of this in the
framework, but at least if you need this you will probably get it really
quickly this way. BTW I've discovered that pyPgSQL has a useful fonction
that might be handy: PgArray._quote() impl. in PgSQL._handleArray().

Are you already using pg array columns w/ python? With which
pyadaptor? I think I also read that pg arrays are somehow an extension
of SQL99 array feature, do you have any hint about this? Is there any
equivalent in mysql, oracle, sqlite?

Last question: if you already manipulated array columns, can you tell if
some non-existing features would possibly be desirable/required in fetch
qualifiers?

-- Sébastien.

Loading...