77 *
88 *
99 * IDENTIFICATION
10- * $Header: /cvsroot/pgsql/src/backend/commands/copy.c,v 1.139 2001/06/08 21:16:48 petere Exp $
10+ * $Header: /cvsroot/pgsql/src/backend/commands/copy.c,v 1.140 2001/07/11 21:53:59 momjian Exp $
1111 *
1212 *-------------------------------------------------------------------------
1313 */
@@ -307,6 +307,8 @@ DoCopy(char *relname, bool binary, bool oids, bool from, bool pipe,
307307{/* copy from file to database */
308308if (rel -> rd_rel -> relkind == RELKIND_SEQUENCE )
309309elog (ERROR ,"You cannot change sequence relation %s" ,relname );
310+ if (rel -> rd_rel -> relkind == RELKIND_VIEW )
311+ elog (ERROR ,"You cannot copy view %s" ,relname );
310312if (pipe )
311313{
312314if (IsUnderPostmaster )
@@ -330,6 +332,8 @@ DoCopy(char *relname, bool binary, bool oids, bool from, bool pipe,
330332}
331333else
332334{/* copy from database to file */
335+ if (rel -> rd_rel -> relkind == RELKIND_VIEW )
336+ elog (ERROR ,"You cannot copy view %s" ,relname );
333337if (pipe )
334338{
335339if (IsUnderPostmaster )