some question about column constraints

Started by Bjoern Schmidtover 22 years ago2 messagesgeneral
Jump to latest
#1Bjoern Schmidt
bjoern.schmidt@sourcepark.de

hi,
I work on a tool that generates a creat script for an existing table.
My problem is to find out if a column is a constraint.
For example, I have the following creat script

create table abc(
xyz serial primary key
)

The metadata say that xyz is an int4 and not nullable.
Where I can recognize that it is a serial primary key?
Is it true that xyz always - if it is a serial primary key - will be
stored as a sequence like abc_xyz_seq?
how will others column constraints (check, unique) be stored?

Thanks,
Bjoern

#2Peter Eisentraut
peter_e@gmx.net
In reply to: Bjoern Schmidt (#1)
Re: some question about column constraints

Bjoern Schmidt writes:

I work on a tool that generates a creat script for an existing table.
My problem is to find out if a column is a constraint.

Look at how pg_dump does it. Or use pg_dump in the first place. What
functionlity does pg_dump lack for your task?

--
Peter Eisentraut peter_e@gmx.net