I've been hacking a bit, and I've come to a conclusion, which may or may
not be true; to implement quite a number of things in the
ResultSetMetaData class, we'll need to implement getTableName(int colnum),
and to implement getTable(), we need additional information from the
backend, like the relid from pg_class, where relid is SELECT relid FROM
pg_class WHERE relname = 'table_where_col_is_from', added to the Field
class. It would, too, be good to include attnum from pg_attribute, too.

This will also ease implementation of things like isAutoIncrement(int
colnum), if you define auto incrementation as having a DEFAULT value
which is read from a sequence that is incremented one step at a time. I
really need this feature (and I want it to behave like I described, as you
might have guessed :). An idea, to make the definition of a column which
"auto increments", is to alter table pg_attribute add attisserial boolean,
and then just set that, if the newly-created column is serial, and use
the pg_attribute column to check whether it is auto incrementing, or not.

Now, I know of two things that you probably will say:

a) Feature freeze - not in 7.1 (naturally). I can understand that, and I
can also, sorta, wait until 7.2 development starts...but I'd love to see
this asap, naturall
b) Postgresql doesn't really support auto incrementation. I know that,
too, but I want, due to ejb-specific reasons, be able to gather
information about whether the column is auto-incrementing, or not. I can,
of course, write a small hack in my own app, but this seems much
neater. :)

OK, did that make sense at all?


Ola Sundell
PGP key information:
pub  1024/744E6D8D 2000/02/13 Ola Sundell <[EMAIL PROTECTED]>
Key fingerprint = 8F CA 7C 6F EC 0D C0 23  1E 08 BF 32 FC 37 24 E3

---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]

Reply via email to