Commit f6a9ed04 authored by Bruce Momjian's avatar Bruce Momjian

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
parent 983fc976
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/indexcmds.c,v 1.1 1999/02/24 17:28:58 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/commands/indexcmds.c,v 1.2 1999/03/14 05:23:12 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -502,6 +502,9 @@ NormIndexAttrs(List *attList, /* list of IndexElem's */ ...@@ -502,6 +502,9 @@ NormIndexAttrs(List *attList, /* list of IndexElem's */
/* we just set the type name because that is all we need */ /* we just set the type name because that is all we need */
attribute->typename = makeNode(TypeName); attribute->typename = makeNode(TypeName);
attribute->typename->name = nameout(&((Form_pg_type) GETSTRUCT(tuple))->typname); attribute->typename->name = nameout(&((Form_pg_type) GETSTRUCT(tuple))->typname);
/* we all need the typmod for the char and varchar types. */
attribute->typename->typmod = attform->atttypmod;
} }
if (attribute->class == NULL) if (attribute->class == NULL)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment