Search Postgresql Archives

Re: Detecting autoincrement columns

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Try this:

SELECT *
    FROM information_schema.columns
WHERE UPPER(column_default) LIKE 'NEXTVAL%'
ORDER BY 1, 2, 3;

On Tue, Sep 1, 2015 at 6:33 PM, Tom Lane <tgl@xxxxxxxxxxxxx> wrote:
"FarjadFarid\(ChkNet\)" <farjad.farid@xxxxxxxxxxxxxxxxx> writes:
> Can someone please direct me as how to detect columns (serial) with
> autoincrement option ?

They have a default that depends on a nextval() call.

                        regards, tom lane


--
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general



--
Melvin Davidson
I reserve the right to fantasize.  Whether or not you
wish to share my fantasy is entirely up to you.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux