looking up field names - Mailing list pgsql-general

From terry@greatgulfhomes.com
Subject looking up field names
Date
Msg-id 006001c229e4$b2dceae0$2766f30a@development.greatgulfhomes.com
Whole thread Raw
Responses Re: looking up field names
List pgsql-general
I am building a custom field engine.  But I want to stop the user from
creating custom fields of the same name as a standard field in the table.

Would this suffice to find if a column already existed in a table:

SELECT  count(*)
FROM    pg_attribute, pg_class
WHERE   pg_class.relname = '<table to check>'
    AND pg_class.reltype = pg_attribute.attrelid
    AND pg_attribute.attname = '<column name to check>'

Thanks in advance

Terry Fielder
Network Engineer
Great Gulf Homes / Ashton Woods Homes
terry@greatgulfhomes.com


pgsql-general by date:

Previous
From: Jan Wieck
Date:
Subject: Re: I am being interviewed by OReilly
Next
From: "scott.marlowe"
Date:
Subject: Re: 7.2.1 optimises very badly against 7.2