Where to get column length

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I know it is in the docs, but right now I can't see it.

How do I pull the length of a specific varchar column?  I have just found a problem with our schema being out of sync on one specific column, and need to find out how many of our 200+ databases need to be fixed.

Here is what I have so far:
select *
from pg_class, pg_attribute
where pg_class.relkind = 'r' and
pg_attribute.attrelid = pg_class.oid and
pg_class.relname = 'mytable' and
pg_attribute.attname = 'problem_column' and
???? != 256;  -- need to report anytime this column is not a varchar(256).

Thanks,

Chris

[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux