Re: OID Usage
| От | Michael Fuhr |
|---|---|
| Тема | Re: OID Usage |
| Дата | |
| Msg-id | 20050115173504.GA1536@winnie.fuhr.org обсуждение |
| Ответ на | Re: OID Usage (Bo Lorentsen <bl@netgroup.dk>) |
| Список | pgsql-general |
On Sat, Jan 15, 2005 at 05:53:08PM +0100, Bo Lorentsen wrote:
> Michael Fuhr wrote:
>
> >The view assumes single-column primary keys defined as SERIAL types.
> >
> is this the "c2.relkind = 'S'" in the view ?
That restricts the view to show only dependent objects that are
sequences ('S'). Defining a column as SERIAL puts a row in pg_depend
that establishes the link between the table and the sequence; if
you explicitly create a sequence and declare the primary key to be
INTEGER with a default value of nextval('sequence_name') then you
don't get the pg_depend link, even though that method is functionally
equivalent to SERIAL. So the view is flawed in that it won't show
a row for the latter case, hence my warning about the view's
assumption.
Other methods are possible. One way might involve joining with
pg_attrdef and extracting the sequence name from the adsrc column.
--
Michael Fuhr
http://www.fuhr.org/~mfuhr/
В списке pgsql-general по дате отправления: