Re: Function x returns opaque in error typeidTypeRelid - Mailing list pgsql-sql

From Richard Huxton
Subject Re: Function x returns opaque in error typeidTypeRelid
Date
Msg-id 3AC58A47.71A4978C@archonet.com
Whole thread Raw
In response to Function x returns opaque in error typeidTypeRelid  (Sondaar Roelof <roelof.sondaar@scania.com>)
List pgsql-sql
Sondaar Roelof wrote:
> 
> Hello,
> 
> I am a bit at a loss here.
> If I create a function  which returns something it works fine.
> If it returns opaque I get the following: ERROR:  typeidTypeRelid: Invalid
> type - oid = 0
> What am I doing wrong ?
> 
> dhcp=# create function lalala() returns opaque as '
> dhcp=#
> dhcp=# select lalala();
> ERROR:  typeidTypeRelid: Invalid type - oid = 0

I believe you can only use opaque from triggers - if you call a function
with select, it not unreasonably expects to have data returned.

In the absence of anything relevent I tend to return either 1 or
'succeeded' or similar.

- Richard Huxton


pgsql-sql by date:

Previous
From: Richard Huxton
Date:
Subject: Re: date_part bug?
Next
From: Tom Lane
Date:
Subject: Re: Vacuum Error