Re: get sequence name from table name

From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Uwe Maiwald <u(dot)maiwald(at)kiss-net(dot)de>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: get sequence name from table name
Date: 2009-12-04 19:24:34
Message-ID: 20091204192434.GF4705@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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.

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Jasen Betts 2009-12-06 08:55:43 Re: Getting more than one row in UNIQUE fields
Previous Message Gerardo Herzig 2009-12-04 18:02:37 Re: get sequence name from table name