*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/commands/Attic/command.c,v 1.12 1997/08/21 03:01:27 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/commands/Attic/command.c,v 1.13 1997/08/22 14:22:07 vadim Exp $
*
* NOTES
* The PortalExecutorHeapMemory crap needs to be eliminated
* we can't add a not null attribute
*/
if (colDef->is_not_null)
- elog(WARN,"Can't add a not null attribute to a existent relation");
+ elog(WARN,"Can't add a not null attribute to a existent relation");
+ if (colDef->defval)
+ elog(WARN,"ADD ATTRIBUTE: DEFAULT is not implemented, yet");
/*
* if the first element in the 'schema' list is a "*" then we are
* supposed to add this attribute to all classes that inherit from
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/commands/copy.c,v 1.26 1997/08/19 04:43:28 vadim Exp $
+ * $Header: /cvsroot/pgsql/src/backend/commands/copy.c,v 1.27 1997/08/22 14:22:09 vadim Exp $
*
*-------------------------------------------------------------------------
*/
* ----------------
*/
- if (rel->rd_att->constr && rel->rd_att->constr->has_not_null)
- {
- int attrChk;
- for (attrChk = 1; attrChk <= rel->rd_att->natts; attrChk++) {
- if (rel->rd_att->attrs[attrChk-1]->attnotnull && heap_attisnull(tuple,attrChk))
- elog(WARN,"CopyFrom: Fail to add null value in not null attribute %s",
- rel->rd_att->attrs[attrChk-1]->attname.data);
- }
- }
+ if ( rel->rd_att->constr )
+ {
+ HeapTuple newtuple;
+
+ newtuple = ExecConstraints ("CopyFrom", rel, tuple);
+
+ if ( newtuple != tuple )
+ {
+ pfree (tuple);
+ tuple = newtuple;
+ }
+ }
heap_insert(rel, tuple);
typnam->arrayBounds = NULL;
coldef = makeNode(ColumnDef);
coldef->typename = typnam;
+ coldef->defval = NULL;
+ coldef->is_not_null = false;
null[i-1] = ' ';
switch (i)
stmt->archiveLoc = -1; /* default */
stmt->archiveType = ARCH_NONE;
stmt->inhRelnames = NIL;
+ stmt->constraints = NIL;
ItsSequenceCreation = true; /* hack */
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/commands/view.c,v 1.7 1997/01/10 20:17:20 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/commands/view.c,v 1.8 1997/08/22 14:22:14 vadim Exp $
*
*-------------------------------------------------------------------------
*/
def->colname = pstrdup(resname);
def->typename = typename;
+
+ def->is_not_null = false;
+ def->defval = (char*) NULL;
attrList = lappend(attrList, def);
}
createStmt.archiveType = ARCH_NONE;
createStmt.location = -1;
createStmt.archiveLoc = -1;
+ createStmt.constraints = NIL;
/*
* finally create the relation...