Re: CREATE TABLE LIKE x INCLUDING CONSTRAINTS - Mailing list pgsql-patches

From Greg Stark
Subject Re: CREATE TABLE LIKE x INCLUDING CONSTRAINTS
Date
Msg-id 871wtj3zhd.fsf@stark.xeocode.com
Whole thread Raw
In response to Re: CREATE TABLE LIKE x INCLUDING CONSTRAINTS  (Alvaro Herrera <alvherre@commandprompt.com>)
List pgsql-patches
Alvaro Herrera <alvherre@commandprompt.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

pgsql-patches by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: CREATE TABLE LIKE x INCLUDING CONSTRAINTS
Next
From: Michael Meskes
Date:
Subject: Re: [PATCH] 4 coverity patches for ECPG