Skip to content

Commit f6a9ed0

Browse files
committed
Hello,
I've been working on the following TODO list item: * psql \d on index with char()/varchar() fields shows improper length I've attached a simple patch to fix this. -Ryan
1 parent 983fc97 commit f6a9ed0

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/backend/commands/indexcmds.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/commands/indexcmds.c,v 1.1 1999/02/24 17:28:58 momjian Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/commands/indexcmds.c,v 1.2 1999/03/14 05:23:12 momjian Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -502,6 +502,9 @@ NormIndexAttrs(List *attList, /* list of IndexElem's */
502502
/* we just set the type name because that is all we need */
503503
attribute->typename = makeNode(TypeName);
504504
attribute->typename->name = nameout(&((Form_pg_type) GETSTRUCT(tuple))->typname);
505+
506+
/* we all need the typmod for the char and varchar types. */
507+
attribute->typename->typmod = attform->atttypmod;
505508
}
506509

507510
if (attribute->class == NULL)

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