Skip site navigation (1) Skip section navigation (2)

Re: find the sequence name from schema, table, field

From: johnf <jfabiani(at)yolo(dot)com>
To: pgsql-admin(at)postgresql(dot)org
Subject: Re: find the sequence name from schema, table, field
Date: 2008-01-10 15:12:39
Message-ID: 200801100712.39496.jfabiani@yolo.com (view raw or flat)
Thread:
Lists: pgsql-admin
On Thursday 10 January 2008 06:12:43 am Alvaro Herrera wrote:
> pg_get_serial_sequence

But it only works with a serial data type.  

Create a sequence "mySequence"
Create a field "myField smallint NOT NULL  DEFAULT 
nextval('mysequence'::regclass)"

So given the name of the table and the name of the field. How can I find the 
name of the associated squence?



-- 
John Fabiani

In response to

pgsql-admin by date

Next:From: Scott MarloweDate: 2008-01-10 15:19:58
Subject: Re: Postgres replication
Previous:From: Kevin KempterDate: 2008-01-10 15:10:39
Subject: Re: Postgres replication

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group