Skip to content

Commit e276d8a

Browse files
committed
Can't COPY TO sequence relation.
Can't inherits from ...
1 parent e8647c4 commit e276d8a

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

src/backend/commands/copy.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*
77
*
88
* IDENTIFICATION
9-
* $Header: /cvsroot/pgsql/src/backend/commands/copy.c,v 1.22 1997/03/12 20:47:32 scrappy Exp $
9+
* $Header: /cvsroot/pgsql/src/backend/commands/copy.c,v 1.23 1997/04/02 03:57:03 vadim Exp $
1010
*
1111
*-------------------------------------------------------------------------
1212
*/
@@ -119,6 +119,8 @@ DoCopy(char *relname, bool binary, bool oids, bool from, bool pipe,
119119
/* Above should not return. */
120120
else {
121121
if (from) { /* copy from file to database */
122+
if ( rel->rd_rel->relkind == RELKIND_SEQUENCE )
123+
elog (WARN, "You can't change sequence relation %s", relname);
122124
if (pipe) {
123125
if (IsUnderPostmaster) {
124126
ReceiveCopyBegin();

src/backend/commands/creatinh.c

Lines changed: 6 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/Attic/creatinh.c,v 1.5 1997/01/10 20:17:11 momjian Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/commands/Attic/creatinh.c,v 1.6 1997/04/02 03:57:06 vadim Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -264,6 +264,11 @@ MergeAttributes(List *schema, List *supers)
264264
"MergeAttr: Can't inherit from non-existent superclass '%s'",
265265
name);
266266
}
267+
if ( relation->rd_rel->relkind == 'S' )
268+
{
269+
elog(WARN, "MergeAttr: Can't inherit from sequence superclass '%s'",
270+
name);
271+
}
267272
tupleDesc = RelationGetTupleDescriptor(relation);
268273

269274
for (attrno = relation->rd_rel->relnatts - 1; attrno >= 0; attrno--) {

0 commit comments

Comments
 (0)