>
> In the latter case, I would suggest an additional SQL command for open
> cursors,
> or a pseudo table for open cursor where you could do a simple select
> statement:
>
> DECLARE CURSOR FOO_CURSOR FOR SELECT * FROM MYTABLE;
>
> SELECT _FIELD_NAME,_FIELD_TYPE,_FIELD_SIZE FROM
> FOO_CURSOR_INFO_PSEUTOTABLE;
The information you want is in pg_attribute.atttypmod. It is normally
-1, but is set for char() and varchar() fields, and includes the 4-byte
length. See bin/psql/psql.c for a sample of its use.
--
Bruce Momjian | 830 Blythe Avenue
maillist@candle.pha.pa.us | Drexel Hill, Pennsylvania 19026
+ If your life is a hard drive, | (610) 353-9879(w)
+ Christ can be your backup. | (610) 853-3000(h)