pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Function x returns opaque in error typeidTypeRelid
2+ messages / 2 participants
[nested] [flat]

* Function x returns opaque in error typeidTypeRelid
@ 2001-03-28 08:29  Sondaar Roelof <roelof.sondaar@scania.com>
  0 siblings, 1 reply; 2+ messages in thread

From: Sondaar Roelof @ 2001-03-28 08:29 UTC (permalink / raw)
  To: pgsql-sql

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 ?

Thanks in advance.
Best regards,
Roelof Sondaar

dhcp=# drop function lalala();
DROP
dhcp=# create function lalala() returns opaque as '
dhcp'# declare
dhcp'#     sname       text;
dhcp'# begin
dhcp'#     sname:= ''lalala'';
dhcp'# end;
dhcp'# ' language 'plpgsql';
CREATE
dhcp=#
dhcp=# select lalala();
ERROR:  typeidTypeRelid: Invalid type - oid = 0
dhcp=#
dhcp=# drop function lalala2();
DROP
dhcp=# create function lalala2() returns text as '
dhcp'# declare
dhcp'#     sname       text;
dhcp'# begin
dhcp'#     sname:= ''lalala'';
dhcp'#     return sname;
dhcp'# end;
dhcp'# ' language 'plpgsql';
CREATE
dhcp=#
dhcp=# select lalala2();
 lalala2
---------
 lalala
(1 row)




^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: Function x returns opaque in error typeidTypeRelid
@ 2001-03-31 07:41  Richard Huxton <dev@archonet.com>
  parent: Sondaar Roelof <roelof.sondaar@scania.com>
  0 siblings, 0 replies; 2+ messages in thread

From: Richard Huxton @ 2001-03-31 07:41 UTC (permalink / raw)
  To: Sondaar Roelof <roelof.sondaar@scania.com>; +Cc: 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



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2001-03-31 07:41 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2001-03-28 08:29 Function x returns opaque in error typeidTypeRelid Sondaar Roelof <roelof.sondaar@scania.com>
2001-03-31 07:41 ` Richard Huxton <dev@archonet.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox