On Mon, 2003-03-31 at 10:43, Bud P.Bruegger wrote:
> 1. Does SQLObject support self-references back to the same class,
> such as they occur in parent/child relationships (or hierarchies)?
> Can I use the foreignKey keyword argument for that?
I can't see any reason it would be a problem, though I guess I haven't
thought about it specifically.
> 2. While I don't have much experience in Postgresql, I read up on the
> CREATE SEQUENCE statement. It seems there is an easier way to do this
> as illustrated in the following example from
> http://www.postgresql.org/docs/view.php?version=7.3&idoc=1&file=datatype.html#DATATYPE-SERIAL
>
> CREATE TABLE tablename (colname SERIAL);
>
> It seems that prior to version 7.3, SERIAL implied UNIQUE. I checked
> in older documentation (version 6.5), and SERIAL seems to be supported
> even back then.
>
> Is there a reason for using SEQUENCE instead of SERIAL?
AFAIK (but I'm not a Postgres expert), SERIAL is equivalent to creating
a sequence in the same way SQLObject expects. Maybe it'll even work.
It's easier for SQLObject to use the sequence directly rather than let
the ID be generated implicitly by the default, but obviously you don't
have to use the default.
Ian
|