Stefan Urbanek <stefan.urba...@gmail.com> writes:

> Is there some "correct" way how I can determine version of the server or at 
> least some list of properties from which I can determine existence of such 
> functionality?

I used something like the following:

    cursor.execute("SELECT version()")
    v = cursor.fetchone()
    m = re.match('PostgreSQL (\d+)\.(\d+)\.(\d+)', v[0])
    if m is None:
        # Maybe a beta?
        m = re.match('PostgreSQL (\d+)\.(\d+)(beta\d+)', v[0])
    assert m, u"Could not determine postgres version"
    pg_version = tuple([int(x) for x in m.group(1, 2)])

hth, ciao, lele.
-- 
nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri
real: Emanuele Gaifas | comincerò ad aver paura di chi mi copia.
l...@metapensiero.it  |                 -- Fortunato Depero, 1929.

-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sqlalchemy+unsubscr...@googlegroups.com.
To post to this group, send email to sqlalchemy@googlegroups.com.
Visit this group at http://groups.google.com/group/sqlalchemy?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to