Re: strange system columns

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

 



On Thu, Jan 05, 2006 at 03:17:02PM -0500, Colton A Smith wrote:
> SELECT attname, typname, attnum
>                    FROM pg_attribute INNER JOIN pg_type
>                      ON pg_attribute.atttypid = pg_type.typelem
>                        WHERE pg_attribute.attrelid = $oid (derived above)
>                              AND NOT attisdropped;

The join condition for pg_type should be against pg_type.oid, not
pg_type.typelem.  A simplified version of your two queries is:

SELECT attname, atttypid::regtype, attnum
FROM pg_attribute
WHERE attrelid = 'organic_matter'::regclass AND NOT attisdropped;

-- 
Michael Fuhr


[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