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

Commitdc4e983

Browse files
committed
Produce a somewhat-useful error message, namely
ERROR: Cannot display a value of type RECORDrather than a random integer when someone tries to SELECT a tuplevalue. Per pghackers discussion around 26-May-02.
1 parent99fd5cb commitdc4e983

File tree

2 files changed

+17
-11
lines changed

2 files changed

+17
-11
lines changed

‎src/backend/catalog/heap.c

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/backend/catalog/heap.c,v 1.222 2002/08/2900:17:02 tgl Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/catalog/heap.c,v 1.223 2002/08/2904:38:04 tgl Exp $
1212
*
1313
*
1414
* INTERFACE ROUTINES
@@ -623,6 +623,12 @@ AddNewRelationType(const char *typeName,
623623
Oidnew_type_oid)
624624
{
625625
/*
626+
* We set the I/O procedures of a complex type to record_in and
627+
* record_out, so that a user will get an error message not a weird
628+
* number if he tries to SELECT a complex type.
629+
*
630+
* OLD and probably obsolete comments:
631+
*
626632
* The sizes are set to oid size because it makes implementing sets
627633
* MUCH easier, and no one (we hope) uses these fields to figure out
628634
* how much space to allocate for the type. An oid is the type used
@@ -639,8 +645,8 @@ AddNewRelationType(const char *typeName,
639645
sizeof(Oid),/* internal size */
640646
'c',/* type-type (complex) */
641647
',',/* default array delimiter */
642-
F_OIDIN,/* input procedure */
643-
F_OIDOUT,/* output procedure */
648+
F_RECORD_IN,/* input procedure */
649+
F_RECORD_OUT,/* output procedure */
644650
InvalidOid,/* array element type - irrelevant */
645651
InvalidOid,/* domain base type - irrelevant */
646652
NULL,/* default type value - none */

‎src/include/catalog/pg_type.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
99
* Portions Copyright (c) 1994, Regents of the University of California
1010
*
11-
* $Id: pg_type.h,v 1.131 2002/08/2900:17:06 tgl Exp $
11+
* $Id: pg_type.h,v 1.132 2002/08/2904:38:04 tgl Exp $
1212
*
1313
* NOTES
1414
* the genbki.sh script reads this file and generates .bki
@@ -296,13 +296,13 @@ DESCR("array of INDEX_MAX_KEYS oids, used in system tables");
296296
DATA(insertOID=32 (SETPGNSPPGUID-1fbt \05400unknowninunknownoutipf0-10_null__null_ ));
297297
DESCR("set of tuples");
298298

299-
DATA(insertOID=71 (pg_typePGNSPPGUID4tct \05412470int4inint4outipf0-10_null__null_ ));
300-
DATA(insertOID=75 (pg_attributePGNSPPGUID4tct \05412490int4inint4outipf0-10_null__null_ ));
301-
DATA(insertOID=81 (pg_procPGNSPPGUID4tct \05412550int4inint4outipf0-10_null__null_ ));
302-
DATA(insertOID=83 (pg_classPGNSPPGUID4tct \05412590int4inint4outipf0-10_null__null_ ));
303-
DATA(insertOID=86 (pg_shadowPGNSPPGUID4tct \05412600int4inint4outipf0-10_null__null_ ));
304-
DATA(insertOID=87 (pg_groupPGNSPPGUID4tct \05412610int4inint4outipf0-10_null__null_ ));
305-
DATA(insertOID=88 (pg_databasePGNSPPGUID4tct \05412620int4inint4outipf0-10_null__null_ ));
299+
DATA(insertOID=71 (pg_typePGNSPPGUID4tct \05412470record_inrecord_outipf0-10_null__null_ ));
300+
DATA(insertOID=75 (pg_attributePGNSPPGUID4tct \05412490record_inrecord_outipf0-10_null__null_ ));
301+
DATA(insertOID=81 (pg_procPGNSPPGUID4tct \05412550record_inrecord_outipf0-10_null__null_ ));
302+
DATA(insertOID=83 (pg_classPGNSPPGUID4tct \05412590record_inrecord_outipf0-10_null__null_ ));
303+
DATA(insertOID=86 (pg_shadowPGNSPPGUID4tct \05412600record_inrecord_outipf0-10_null__null_ ));
304+
DATA(insertOID=87 (pg_groupPGNSPPGUID4tct \05412610record_inrecord_outipf0-10_null__null_ ));
305+
DATA(insertOID=88 (pg_databasePGNSPPGUID4tct \05412620record_inrecord_outipf0-10_null__null_ ));
306306

307307
/* OIDS 100 - 199 */
308308

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp