Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitb6564c4

Browse files
committed
Disable COPY TO/FROM on views.
1 parent75d872a commitb6564c4

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

‎src/backend/commands/copy.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
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 */
308308
if (rel->rd_rel->relkind==RELKIND_SEQUENCE)
309309
elog(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);
310312
if (pipe)
311313
{
312314
if (IsUnderPostmaster)
@@ -330,6 +332,8 @@ DoCopy(char *relname, bool binary, bool oids, bool from, bool pipe,
330332
}
331333
else
332334
{/* copy from database to file */
335+
if (rel->rd_rel->relkind==RELKIND_VIEW)
336+
elog(ERROR,"You cannot copy view %s",relname);
333337
if (pipe)
334338
{
335339
if (IsUnderPostmaster)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp