From 077db40fa1f3ef93a60d995cc5b2666474f81302 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Wed, 5 May 2004 04:48:48 +0000 Subject: ALTER TABLE rewrite. New cool stuff: * ALTER ... ADD COLUMN with defaults and NOT NULL constraints works per SQL spec. A default is implemented by rewriting the table with the new value stored in each row. * ALTER COLUMN TYPE. You can change a column's datatype to anything you want, so long as you can specify how to convert the old value. Rewrites the table. (Possible future improvement: optimize no-op conversions such as varchar(N) to varchar(N+1).) * Multiple ALTER actions in a single ALTER TABLE command. You can perform any number of column additions, type changes, and constraint additions with only one pass over the table contents. Basic documentation provided in ALTER TABLE ref page, but some more docs work is needed. Original patch from Rod Taylor, additional work from Tom Lane. --- src/include/parser/analyze.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/include/parser') diff --git a/src/include/parser/analyze.h b/src/include/parser/analyze.h index e3cf88b4fd7..76c77025ece 100644 --- a/src/include/parser/analyze.h +++ b/src/include/parser/analyze.h @@ -6,7 +6,7 @@ * Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/include/parser/analyze.h,v 1.25 2004/01/23 02:13:12 neilc Exp $ + * $PostgreSQL: pgsql/src/include/parser/analyze.h,v 1.26 2004/05/05 04:48:47 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -22,6 +22,9 @@ extern List *parse_analyze_varparams(Node *parseTree, Oid **paramTypes, extern List *parse_sub_analyze(Node *parseTree, ParseState *parentParseState); extern List *analyzeCreateSchemaStmt(CreateSchemaStmt *stmt); +extern char *makeObjectName(const char *name1, const char *name2, + const char *typename); + extern void CheckSelectForUpdate(Query *qry); #endif /* ANALYZE_H */ -- cgit v1.2.3