Help using SELECT INTO to make schema

From: Robert James <srobertjames(at)gmail(dot)com>
To: Postgres General <pgsql-general(at)postgresql(dot)org>
Subject: Help using SELECT INTO to make schema
Date: 2009-07-22 22:15:05
Message-ID: e09785e00907221515uec2315bqe1fadd2c758d5c4c@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I'd like to SELECT INTO one table into another one. However, I'd like to do
two things that I don't know how to do using SELECT INTO:

1. Copy over the indexes and constraints of the first table into the second
2. Do SELECT INTO even if the second table already exists.

Is there anyway to do either one of those?

Failing that, is there a way to copy a table's schema - its columns,
indexes, and constraints - into a new (empty) table?

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Robert James 2009-07-22 22:17:58 Re: Documentation Improvement suggestions
Previous Message Jeff Davis 2009-07-22 21:44:29 Re: Select Column Auditing/Logging