Skip site navigation (1) Skip section navigation (2)

Re: I can't get row type from tuple (SPI)

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Pavel Stehule" <pavel(dot)stehule(at)hotmail(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: I can't get row type from tuple (SPI)
Date: 2005-11-07 01:59:01
Message-ID: 24458.1131328741@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-hackers
"Pavel Stehule" <pavel(dot)stehule(at)hotmail(dot)com> writes:
> rettupdesc = lookup_rowtype_tupdesc(rettype,0);

This is wrong --- if you don't know what typmod to use, *always* pass -1
not 0.  (I suspect that rettype is RECORD and that -1 would have
resulted in a NULL result.)

It seems like SPI is missing a needed function: it should have an
SPI_gettypmod to go along with SPI_gettypeid.  This would probably
give you the correct typmod to pass to lookup_rowtype_tupdesc here.

			regards, tom lane

In response to

Responses

pgsql-hackers by date

Next:From: Robert CreagerDate: 2005-11-07 03:00:38
Subject: Re: SIGSEGV taken on 8.1 during dump/reload
Previous:From: Hiroshi SaitoDate: 2005-11-07 01:16:35
Subject: Re: pgInstaller 8.1 built

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group