Re: Function Returning SETOF RECORD: Trouble With Char Type

From: "Angus B(dot) Atkins-Trimnell" <trimnell(at)uic(dot)edu>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Function Returning SETOF RECORD: Trouble With Char Type
Date: 2008-03-20 14:12:23
Message-ID: 47E270C7.602@uic.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Thanks a lot. I missed your post when it first came up, but I just
tried double-quoting the type indicator and it worked like a charm!

--Angus

Tom Lane wrote:
> "Angus B. Atkins-Trimnell" <trimnell(at)uic(dot)edu> writes:
>
>> I am having trouble with a function designed to return all column
>> constraints on a table.
>>
>
> I think the problem is that you're declaring the contype return column
> as char (ie, character(1)) when pg_constraint.contype is actually "char"
> (a historical PG datatype that's really just a single byte). The naming
> confusion is unfortunate but we've never bitten the bullet to rename
> "char" to something else.
>
> Use quotes, or explicitly cast the catalog column to regular char
> in the function's query.
>
> regards, tom lane
>
>
>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Zubkovsky, Sergey 2008-03-20 14:24:38 Re: Row size overhead
Previous Message Selena Deckelmann 2008-03-20 13:52:03 OSCON PostgreSQL Day July 20, 2008 - Save the date!