mirror of
https://github.com/postgres/postgres.git
synced 2025-07-03 20:02:46 +03:00
Revert "Logical decoding of sequences"
This reverts a sequence of commits, implementing features related to logical decoding and replication of sequences: -0da92dc530
-80901b3291
-b779d7d8fd
-d5ed9da41d
-a180c2b34d
-75b1521dae
-2d2232933b
-002c9dd97a
-05843b1aa4
The implementation has issues, mostly due to combining transactional and non-transactional behavior of sequences. It's not clear how this could be fixed, but it'll require reworking significant part of the patch. Discussion: https://postgr.es/m/95345a19-d508-63d1-860a-f5c2f41e8d40@enterprisedb.com
This commit is contained in:
@ -42,7 +42,6 @@
|
||||
#include "catalog/pg_inherits.h"
|
||||
#include "catalog/pg_namespace.h"
|
||||
#include "catalog/pg_opclass.h"
|
||||
#include "catalog/pg_publication_namespace.h"
|
||||
#include "catalog/pg_statistic_ext.h"
|
||||
#include "catalog/pg_tablespace.h"
|
||||
#include "catalog/pg_trigger.h"
|
||||
@ -16409,14 +16408,11 @@ AlterTableNamespace(AlterObjectSchemaStmt *stmt, Oid *oldschema)
|
||||
* Check that setting the relation to a different schema won't result in a
|
||||
* publication having both a schema and the same schema's table, as this
|
||||
* is not supported.
|
||||
*
|
||||
* XXX We do this for tables and sequences, but it's better to keep the two
|
||||
* blocks separate, to make the strings easier to translate.
|
||||
*/
|
||||
if (stmt->objectType == OBJECT_TABLE)
|
||||
{
|
||||
ListCell *lc;
|
||||
List *schemaPubids = GetSchemaPublications(nspOid, PUB_OBJTYPE_TABLE);
|
||||
List *schemaPubids = GetSchemaPublications(nspOid);
|
||||
List *relPubids = GetRelationPublications(RelationGetRelid(rel));
|
||||
|
||||
foreach(lc, relPubids)
|
||||
@ -16434,27 +16430,6 @@ AlterTableNamespace(AlterObjectSchemaStmt *stmt, Oid *oldschema)
|
||||
get_publication_name(pubid, false)));
|
||||
}
|
||||
}
|
||||
else if (stmt->objectType == OBJECT_SEQUENCE)
|
||||
{
|
||||
ListCell *lc;
|
||||
List *schemaPubids = GetSchemaPublications(nspOid, PUB_OBJTYPE_SEQUENCE);
|
||||
List *relPubids = GetRelationPublications(RelationGetRelid(rel));
|
||||
|
||||
foreach(lc, relPubids)
|
||||
{
|
||||
Oid pubid = lfirst_oid(lc);
|
||||
|
||||
if (list_member_oid(schemaPubids, pubid))
|
||||
ereport(ERROR,
|
||||
errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
|
||||
errmsg("cannot move sequence \"%s\" to schema \"%s\"",
|
||||
RelationGetRelationName(rel), stmt->newschema),
|
||||
errdetail("The schema \"%s\" and same schema's sequence \"%s\" cannot be part of the same publication \"%s\".",
|
||||
stmt->newschema,
|
||||
RelationGetRelationName(rel),
|
||||
get_publication_name(pubid, false)));
|
||||
}
|
||||
}
|
||||
|
||||
/* common checks on switching namespaces */
|
||||
CheckSetNamespace(oldNspOid, nspOid);
|
||||
|
Reference in New Issue
Block a user