Search Postgresql Archives

Getting sequence name for a non-serial column

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

 



Hi,
I've read several solutions to get the sequence name for a field defined as serial by create/alter table, but when I
define a default expression (e.g. like next_val('foo_seq') ) for an integer column pg_depend will not contain
information to describe this relation.

Is there a backward compatible method (back to 7.3 or 7.4) to get the sequence name for these fields? I know
pg_get_serial_sequence which works correctly only for serial fields and on versions 8.0+. It's a convenient and easy way, but I also need this information on v7.3 servers and for non-serial columns.

I also can retrieve column_default from information_schema.columns view, but it contains an expression not a sequence name.

Any suggestions are appreciated.

Many thanks,

  -- E.Cs.


---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
      choose an index scan if your joining column's datatypes do not
      match

[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