On Mon, 17 Sep 2001 14:51:52 +0000 (UTC), ke wang <kw68(at)cornell(dot)edu> wrote:
> Is there any command or query to see the definition of an existing table,
> like which is the primary key, which is not null etc.
>
In psql:
\d tablename
to see what the exact query is, start psql with the -E flag:
psql -E
\d tablename