Re: Q: unexpected result from SRF in SQL

From: Joe Conway <mail(at)joeconway(dot)com>
To: Ian Barwick <barwick(at)gmx(dot)net>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Q: unexpected result from SRF in SQL
Date: 2002-05-26 15:11:35
Message-ID: 3CF0FB27.4070806@joeconway.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Ian Barwick wrote:
> but also this:
>
> func_test=# select bar(1);
> bar
> -----------
> 139059784
> (1 row)
>
> What is this number? It often varies from query to query.
> Possibly an error-in-disguise because of something to do
> with the calling context?

This is an illustration of why the expression SRF API isn't very useful
for returning composite types ;)

The number is actually a pointer to the result row. There is no way
under the expression API to get at the individual columns directly. If
you're really curious, see contrib/dblink in 7.2.x for an example of a
(ugly) workaround.

Joe

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message lee 2002-05-26 15:15:45 Re: no pg_hba.conf
Previous Message Oleg Bartunov 2002-05-26 13:05:32 Re: strange update problem with 7.2.1