|
62 | 62 | #include"access/htup_details.h"
|
63 | 63 | #include"catalog/indexing.h"
|
64 | 64 | #include"catalog/namespace.h"
|
| 65 | +#include"catalog/pg_constraint_fn.h" |
65 | 66 | #include"pglogical_output/hooks.h"
|
66 | 67 | #include"parser/analyze.h"
|
67 | 68 | #include"parser/parse_relation.h"
|
@@ -5193,6 +5194,23 @@ static void MtmProcessUtility(Node *parsetree, const char *queryString,
|
5193 | 5194 | {
|
5194 | 5195 | MtmFinishDDLCommand();
|
5195 | 5196 | }
|
| 5197 | +if (nodeTag(parsetree)==T_CreateStmt) |
| 5198 | +{ |
| 5199 | +CreateStmt*create= (CreateStmt*)parsetree; |
| 5200 | +Oidrelid=RangeVarGetRelid(create->relation,NoLock, true); |
| 5201 | +if (relid!=InvalidOid) { |
| 5202 | +Oidconstraint_oid; |
| 5203 | +Bitmapset*pk=get_primary_key_attnos(relid, true,&constraint_oid); |
| 5204 | +if (pk==NULL) { |
| 5205 | +elog(WARNING, |
| 5206 | +MtmIgnoreTablesWithoutPk |
| 5207 | + ?"Table %s.%s without primary will not be replicated" |
| 5208 | + :"Updates and deletes of table %s.%s without primary will not be replicated", |
| 5209 | +create->relation->schemaname ?create->relation->schemaname :"public", |
| 5210 | +create->relation->relname); |
| 5211 | +} |
| 5212 | +} |
| 5213 | +} |
5196 | 5214 | }
|
5197 | 5215 |
|
5198 | 5216 | staticvoid
|
|