Re: existence of column name

From: Eric Smith <eric_h_smith(at)mac(dot)com>
To: John R Pierce <pierce(at)hogranch(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: existence of column name
Date: 2009-04-16 03:34:24
Message-ID: D392651E-56C7-4AE9-BA5E-E9EA85EECAC4@mac.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Tried this out, and got a very familiar error that I don't know what
to do with : "Error: expected just one rule action".

I'm using 8.3.5, and see this error quite a bit. Anyone know what's
behind this error?

Thanks,
Eric

On Apr 8, 2009, at 8:54 PM, John R Pierce wrote:

> 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.
>
>

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2009-04-16 04:14:54 Re: existence of column name
Previous Message Quan Zongliang 2009-04-16 01:26:35 Re: how to escape back-slash mark.