Hello! I need get ordered length of the varchcar field in PHP. But pg_FieldLength return -1 (it's right), but I need to get max length for this field. For example, create table t ( str varchar(40) ); I need to get 40... Help me please!
Here's what I came up with: select format_type(a.atttypid, a.atttypmod) from pg_attribute a, pg_class c where a.attrelid = c.oid and a.attname = '<field>' and c.relname = '<relation>' The result needs to be parsed... Tony On Jul 15, 2004, at 1:38 AM, Constantin Khatsckevich wrote: > Hello! > > I need get ordered length of the varchcar field in PHP. But > pg_FieldLength return -1 (it's right), but I need to get max length > for this field. For example, > create table t ( > str varchar(40) > ); > > I need to get 40... > > > Help me please! > > > ---------------------------(end of > broadcast)--------------------------- > TIP 6: Have you searched our list archives? > > http://archives.postgresql.org >
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера