derive the sequence name of a column - Mailing list pgsql-novice

From Mel Jamero
Subject derive the sequence name of a column
Date
Msg-id 000001c39a02$2b8674f0$1b06a8c0@cmpmel
Whole thread Raw
In response to Re: libpq  (Bruno LEVEQUE <bruno.leveque@net6d.com>)
Responses Re: derive the sequence name of a column
List pgsql-novice
Hi!

Can anyone please tell me exactly how the name of a sequence a field is
using (manually created or generated by a serial) could be derived
programmatically (using libpq or through SQL)?

Thus:

CREATE SEQUENCE an_unknown_sequence_name;
CREATE TABLE test (
  test_id   integer default nextval('an_unknown_sequence_name'),
  useless_redundant_test_id serial
);

How do I programmatically extract that column 'test_id' in table 'test'
is using 'an_unknown_sequence_name'

TIA!

Mel








pgsql-novice by date:

Previous
From: Bruno LEVEQUE
Date:
Subject: Re: libpq
Next
From: Paul Linehan
Date:
Subject: Installing on Red Hat 9?