88 *
99 *
1010 * IDENTIFICATION
11- * $Header: /cvsroot/pgsql/src/backend/commands/Attic/command.c,v 1.106 2000/10/10 17:13:30 momjian Exp $
11+ * $Header: /cvsroot/pgsql/src/backend/commands/Attic/command.c,v 1.107 2000/10/16 17:08:05 momjian Exp $
1212 *
1313 * NOTES
1414 * The PerformAddAttribute() code, like most of the relation
@@ -311,10 +311,8 @@ AlterTableAddColumn(const char *relationName,
311311if (!allowSystemTableMods && IsSystemRelationName (relationName ))
312312elog (ERROR ,"ALTER TABLE: relation \"%s\" is a system catalog" ,
313313relationName );
314- #ifndef NO_SECURITY
315314if (!pg_ownercheck (GetUserId (),relationName ,RELNAME ))
316315elog (ERROR ,"ALTER TABLE: permission denied" );
317- #endif
318316
319317/*
320318 * Grab an exclusive lock on the target table, which we will NOT
@@ -1149,7 +1147,7 @@ AlterTableAddConstraint(char *relationName,
11491147scan = heap_beginscan (rel , false,SnapshotNow ,0 ,NULL );
11501148AssertState (scan != NULL );
11511149
1152- /*
1150+ /*
11531151 * We need to make a parse state and range table to allow
11541152 * us to transformExpr and fix_opids to get a version of
11551153 * the expression we can pass to ExecQual
@@ -1195,7 +1193,7 @@ AlterTableAddConstraint(char *relationName,
11951193rte -> eref -> relname = relationName ;
11961194rtlist = makeList1 (rte );
11971195
1198- /*
1196+ /*
11991197 * Scan through the rows now, making the necessary things
12001198 * for ExecQual, and then call it to evaluate the
12011199 * expression.
@@ -1224,13 +1222,13 @@ AlterTableAddConstraint(char *relationName,
12241222pfree (rte );
12251223
12261224heap_endscan (scan );
1227- heap_close (rel ,NoLock );
1225+ heap_close (rel ,NoLock );
12281226
1229- if (!successful )
1227+ if (!successful )
12301228{
12311229elog (ERROR ,"AlterTableAddConstraint: rejected due to CHECK constraint %s" ,name );
12321230}
1233- /*
1231+ /*
12341232 * Call AddRelationRawConstraints to do the real adding --
12351233 * It duplicates some of the above, but does not check the
12361234 * validity of the constraint against tuples already in
@@ -1274,7 +1272,7 @@ AlterTableAddConstraint(char *relationName,
12741272
12751273pkrel = heap_openr (fkconstraint -> pktable_name ,AccessExclusiveLock );
12761274if (pkrel -> rd_rel -> relkind != RELKIND_RELATION )
1277- elog (ERROR ,"referenced table \"%s\" not a relation" ,
1275+ elog (ERROR ,"referenced table \"%s\" not a relation" ,
12781276fkconstraint -> pktable_name );
12791277
12801278/*
@@ -1328,7 +1326,7 @@ AlterTableAddConstraint(char *relationName,
13281326}
13291327}
13301328if (found )
1331- break ;
1329+ break ;
13321330indexStruct = NULL ;
13331331}
13341332if (!found )
@@ -1591,7 +1589,7 @@ AlterTableCreateToastTable(const char *relationName, bool silent)
15911589
15921590if (((Form_pg_class )GETSTRUCT (reltup ))-> reltoastrelid != InvalidOid )
15931591{
1594- if (silent )
1592+ if (silent )
15951593{
15961594heap_close (rel ,NoLock );
15971595heap_close (class_rel ,NoLock );
@@ -1601,14 +1599,14 @@ AlterTableCreateToastTable(const char *relationName, bool silent)
16011599
16021600elog (ERROR ,"ALTER TABLE: relation \"%s\" already has a toast table" ,
16031601relationName );
1604- }
1602+ }
16051603
16061604/*
16071605 * Check to see whether the table actually needs a TOAST table.
16081606 */
16091607if (!needs_toast_table (rel ))
16101608{
1611- if (silent )
1609+ if (silent )
16121610{
16131611heap_close (rel ,NoLock );
16141612heap_close (class_rel ,NoLock );
@@ -1784,7 +1782,7 @@ LockTableCommand(LockStmt *lockstmt)
17841782if (rel -> rd_rel -> relkind != RELKIND_RELATION )
17851783elog (ERROR ,"LOCK TABLE: %s is not a table" ,lockstmt -> relname );
17861784
1787- if (is_view (rel ))
1785+ if (is_view (rel ))
17881786elog (ERROR ,"LOCK TABLE: cannot lock a view" );
17891787
17901788if (lockstmt -> mode == AccessShareLock )
@@ -1842,7 +1840,7 @@ is_view(Relation rel)
18421840
18431841while (HeapTupleIsValid (tuple = heap_getnext (scanDesc ,0 )))
18441842{
1845- if (tuple -> t_data != NULL )
1843+ if (tuple -> t_data != NULL )
18461844{
18471845data = (Form_pg_rewrite )GETSTRUCT (tuple );
18481846if (data -> ev_type == '1' )
@@ -1856,6 +1854,6 @@ is_view(Relation rel)
18561854
18571855heap_endscan (scanDesc );
18581856heap_close (RewriteRelation ,RowExclusiveLock );
1859-
1857+
18601858return retval ;
18611859}