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

Commit223b813

Browse files
committed
Remove some long-obsolete code that was causing a strange error message
when someone attempts to create a column of a composite datatype. Fornow, just make sure we produce a reasonable error at the 'right place'.Not sure if this will be made to work before 7.5, but make it actreasonably in case nothing more gets done.
1 parent7eb2ff7 commit223b813

File tree

2 files changed

+10
-21
lines changed

2 files changed

+10
-21
lines changed

‎src/backend/catalog/heap.c

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $PostgreSQL: pgsql/src/backend/catalog/heap.c,v 1.266 2004/05/31 19:24:05 tgl Exp $
11+
* $PostgreSQL: pgsql/src/backend/catalog/heap.c,v 1.267 2004/06/04 03:24:04 tgl Exp $
1212
*
1313
*
1414
* INTERFACE ROUTINES
@@ -417,9 +417,9 @@ CheckAttributeType(const char *attname, Oid atttypid)
417417
* (usually as a result of a 'retrieve into' - jolly)
418418
*
419419
* Refuse any attempt to create a pseudo-type column or one that uses a
420-
*standalonecomposite type. (Eventually weshould probably refuse
421-
*all references to complextypes, butfor now there's still some
422-
*Berkeley-derived code that thinks it can do this...)
420+
* composite type. (Eventually wewould like to allow standalone
421+
*compositetypes, butthat needs some nontrivial work yet,
422+
*particularly TOAST support.)
423423
*/
424424
if (atttypid==UNKNOWNOID)
425425
ereport(WARNING,
@@ -437,9 +437,11 @@ CheckAttributeType(const char *attname, Oid atttypid)
437437
}
438438
elseif (att_typtype=='c')
439439
{
440+
#if0
440441
Oidtyprelid=get_typ_typrelid(atttypid);
441442

442-
if (get_rel_relkind(typrelid)==RELKIND_COMPOSITE_TYPE)
443+
if (get_rel_relkind(typrelid)!=RELKIND_COMPOSITE_TYPE)
444+
#endif
443445
ereport(ERROR,
444446
(errcode(ERRCODE_INVALID_TABLE_DEFINITION),
445447
errmsg("column \"%s\" has composite type %s",

‎src/backend/parser/analyze.c

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
77
* Portions Copyright (c) 1994, Regents of the University of California
88
*
9-
*$PostgreSQL: pgsql/src/backend/parser/analyze.c,v 1.302 2004/05/30 23:40:32 neilc Exp $
9+
*$PostgreSQL: pgsql/src/backend/parser/analyze.c,v 1.303 2004/06/04 03:24:04 tgl Exp $
1010
*
1111
*-------------------------------------------------------------------------
1212
*/
@@ -3049,23 +3049,10 @@ makeFromExpr(List *fromlist, Node *quals)
30493049
staticvoid
30503050
transformColumnType(ParseState*pstate,ColumnDef*column)
30513051
{
3052-
TypeName*typename=column->typename;
3053-
Typectype=typenameType(typename);
3054-
30553052
/*
3056-
* Is this the name of a complex type? If so, implement it as a set.
3057-
*
3058-
* XXX this is a hangover from ancient Berkeley code that probably
3059-
* doesn't work anymore anyway.
3053+
* All we really need to do here is verify that the type is valid.
30603054
*/
3061-
if (typeTypeRelid(ctype)!=InvalidOid)
3062-
{
3063-
/*
3064-
* (Eventually add in here that the set can only contain one
3065-
* element.)
3066-
*/
3067-
typename->setof= true;
3068-
}
3055+
Typectype=typenameType(column->typename);
30693056

30703057
ReleaseSysCache(ctype);
30713058
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp