Re: get sequence name from table name - Mailing list pgsql-sql

From Alvaro Herrera
Subject Re: get sequence name from table name
Date
Msg-id 20091204192434.GF4705@alvh.no-ip.org
Whole thread Raw
In response to get sequence name from table name  (Uwe Maiwald <u.maiwald@kiss-net.de>)
List pgsql-sql
Uwe Maiwald wrote:
> how to get the name of the sequence that is responsible for setting
> the autoincrement value of a tables primary key column?

You can use the pg_get_serial_sequence() function.  You need the name of
the column in addition to the table name though.

-- 
Alvaro Herrera                                http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.


pgsql-sql by date:

Previous
From: Gerardo Herzig
Date:
Subject: Re: get sequence name from table name
Next
From: Jasen Betts
Date:
Subject: Re: Getting more than one row in UNIQUE fields