Re: [PATCHES] CREATE TABLE LIKE x INCLUDING CONSTRAINTS
Patch applied. Thanks. --- Greg Stark wrote: > > Fixed previous patch by calling change_varattnos_of_a_node() to fix up > constraint expressions in case attribute positions don't line up. > > change_varattnos_of_a_node is in tablecmds.c for inherited tables so this > means making it extern. I have a feeling it probably ought to move to some > file of functions for manipulating Nodes but I couldn't really find an > appropriate place. At first I was going to put it in ruleutils.c but then it > seems the other functions in that file go in builtins.h which would be a > strange place for this I think. > > So in the end I left the functions in tablecmds.[ch] at least until someone > more familiar with the source tree suggests another pair of files for them to > be defined in. > [ Attachment, skipping... ] > > -- > greg > > ---(end of broadcast)--- > TIP 6: explain analyze is your friend -- Bruce Momjian [EMAIL PROTECTED] EnterpriseDBhttp://www.enterprisedb.com + If your life is a hard drive, Christ can be your backup. + ---(end of broadcast)--- TIP 4: Have you searched our list archives? http://archives.postgresql.org
Re: [PATCHES] CREATE TABLE LIKE x INCLUDING CONSTRAINTS
Alvaro Herrera <[EMAIL PROTECTED]> 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 ---(end of broadcast)--- TIP 4: Have you searched our list archives? http://archives.postgresql.org
Re: [PATCHES] CREATE TABLE LIKE x INCLUDING CONSTRAINTS
Hum, how are you handling the case where I specify CREATE TABLE LIKE x INCLUDING CONSTRAINTS EXCLUDING CONSTRAINTS ? -- Alvaro Herrerahttp://www.CommandPrompt.com/ The PostgreSQL Company - Command Prompt, Inc. ---(end of broadcast)--- TIP 5: don't forget to increase your free space map settings