Re: existence of column name - Mailing list pgsql-general

From John R Pierce
Subject Re: existence of column name
Date
Msg-id 49DD7179.9030100@hogranch.com
Whole thread Raw
In response to existence of column name  (Eric Smith <eric_h_smith@mac.com>)
Responses Re: existence of column name
List pgsql-general
Eric Smith wrote:
> All,
>
> From the C API, how do I check for the existence of a column name in a
> given table?

    select data_type from information_schema.columns where
table_schema='public' and table_name='given_table' and
column_name='some_column';

that will return the data_type if the column exists, or return zero rows
if it doesn't.



pgsql-general by date:

Previous
From: Eric Smith
Date:
Subject: existence of column name
Next
From: Craig Ringer
Date:
Subject: Re: database corruption