Skip to content

Commit 764ce22

Browse files
committed
Revert: Honor OID status of CREATE LIKE'd tables
Reverts d992f8a Report by Tom Lane
1 parent ee8d392 commit 764ce22

File tree

1 file changed

+1
-15
lines changed

1 file changed

+1
-15
lines changed

src/backend/parser/parse_utilcmd.c

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@
5656
#include "rewrite/rewriteManip.h"
5757
#include "utils/acl.h"
5858
#include "utils/builtins.h"
59-
#include "utils/guc.h"
6059
#include "utils/lsyscache.h"
6160
#include "utils/rel.h"
6261
#include "utils/syscache.h"
@@ -223,7 +222,7 @@ transformCreateStmt(CreateStmt *stmt, const char *queryString)
223222
cxt.blist = NIL;
224223
cxt.alist = NIL;
225224
cxt.pkey = NULL;
226-
cxt.hasoids = default_with_oids;
225+
cxt.hasoids = interpretOidsOption(stmt->options, true);
227226

228227
Assert(!stmt->ofTypename || !stmt->inhRelations); /* grammar enforces */
229228

@@ -282,17 +281,6 @@ transformCreateStmt(CreateStmt *stmt, const char *queryString)
282281
* Output results.
283282
*/
284283
stmt->tableElts = cxt.columns;
285-
/*
286-
* Add WITH/WITHOUT OIDS, if necessary. A literal statement-specified
287-
* WITH/WITHOUT OIDS will still take precedence because the first
288-
* matching "oids" in "options" is used.
289-
*/
290-
if (cxt.hasoids && !interpretOidsOption(stmt->options, true))
291-
stmt->options = lappend(stmt->options, makeDefElem("oids",
292-
(Node *)makeInteger(TRUE)));
293-
else if (!cxt.hasoids && interpretOidsOption(stmt->options, true))
294-
stmt->options = lappend(stmt->options, makeDefElem("oids",
295-
(Node *)makeInteger(FALSE)));
296284
stmt->constraints = cxt.ckconstraints;
297285

298286
result = lappend(cxt.blist, stmt);
@@ -861,8 +849,6 @@ transformTableLikeClause(CreateStmtContext *cxt, TableLikeClause *table_like_cla
861849
}
862850
}
863851

864-
cxt->hasoids = relation->rd_rel->relhasoids;
865-
866852
/*
867853
* Copy CHECK constraints if requested, being careful to adjust attribute
868854
* numbers so they match the child.

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy