Re: CREATE TABLE LIKE x INCLUDING CONSTRAINTS

From: Greg Stark <gsstark(at)mit(dot)edu>
To: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
Cc: Greg Stark <gsstark(at)mit(dot)edu>, pgsql-patches(at)postgresql(dot)org
Subject: Re: CREATE TABLE LIKE x INCLUDING CONSTRAINTS
Date: 2006-06-21 04:27:10
Message-ID: 871wtj3zhd.fsf@stark.xeocode.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches


Alvaro Herrera <alvherre(at)commandprompt(dot)com> writes:

> Hum, how are you handling the case where I specify
>
> CREATE TABLE LIKE x INCLUDING CONSTRAINTS EXCLUDING CONSTRAINTS ?

I have the last one taking priority. I could make it an error but don't see
much point in doing so. It seems to be making something an error for no
particular gain.

EXCLUDING CONSTRAINTS and EXCLUDING DEFAULTS are both kind of stupid since
they're the defaults. There's not much need for either except that EXCLUDING
DEFAULTS is in the standard and it would be weird not to follow the pattern.

And generally I feel like explaining corner cases like this -- when there's no
useful application of it -- to just clutter up documentation. The closest
analog is command-line options where often script writers want a way to
provide flags and then let a variable override those flags. But people rarely
do that kind of thing with SQL scripts. I suppose it does happen though. Maybe
it would be helpful to know how it will work.

--
greg

In response to

Browse pgsql-patches by date

  From Date Subject
Next Message Michael Meskes 2006-06-21 11:40:56 Re: [PATCH] 4 coverity patches for ECPG
Previous Message Alvaro Herrera 2006-06-21 03:13:13 Re: CREATE TABLE LIKE x INCLUDING CONSTRAINTS