From: Carroll Kong <me@ca...> - 2004-06-25 13:30:45
Using Postgresql with SQLObject (svn updated a few days ago, shouldn't matter in
this case anyway)
I created a "writeable" view (using rules). However because the viewname is
different than the actual primary key, then my inserts fail
line 62, in _queryInsertID
c.execute("SELECT NEXTVAL('%s_%s_seq')" % (table, idName))
psycopg.ProgrammingError: ERROR: relation "clients_view_clients_id_seq" does
clients_view is a composite of multiple tables, the actual sequence is in
another table "clients", so the sequence is really clients_clients_id_seq.
Can we add a simple parameter to allow arbitrary sequence names instead?
Or is there some other work around?
(I could wrap all of the inserts in another transaction, but for other reasons,
I want to avoid doing that).
From: Ivo van der Wijk <vladdrac@gm...> - 2004-06-25 18:19:00
On Fri, 25 Jun 2004 13:22:29 +0000 (UTC), Carroll Kong
> Using Postgresql with SQLObject (svn updated a few days ago, shouldn't matter in
> this case anyway)
> I created a "writeable" view (using rules). However because the viewname is
> different than the actual primary key, then my inserts fail
I ran into exactly the same problem when experimenting with views, and
I ran into it recently again when I wanted to use a global sequence to
get unique id's across tables (don't ask why :)
I'd like a feature like this. It should probably part of the id column
definition, which is not present at this moment (why can't id columns
be defined explicitly?)
it would also make it easier for DBMSs like Oracle that only provide
sequences in the first place. Oracle specific code for ids would be
reduced to a one liner. Nice!
Dirk J. Evers dirk.evers@...
NRW Graduate School in +49 (0)521/106-3793
Bioinformatics and Genome Research, CeBiTec - Center for Biotechnology
University of Bielefeld, D-33594 Bielefeld, Germany