Re: I can't get row type from tuple (SPI) - Mailing list pgsql-hackers

From Bruce Momjian
Subject Re: I can't get row type from tuple (SPI)
Date
Msg-id 200512040414.jB44Epq10958@candle.pha.pa.us
Whole thread Raw
In response to Re: I can't get row type from tuple (SPI)  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Added to TODO:
* Add SPI_gettypmod() to return the typemod for a TupleDesc


---------------------------------------------------------------------------

Tom Lane wrote:
> "Pavel Stehule" <pavel.stehule@hotmail.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
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 6: explain analyze is your friend
> 

--  Bruce Momjian                        |  http://candle.pha.pa.us pgman@candle.pha.pa.us               |  (610)
359-1001+  If your life is a hard drive,     |  13 Roberts Road +  Christ can be your backup.        |  Newtown Square,
Pennsylvania19073
 


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: [PATCHES] snprintf() argument reordering not working under
Next
From: Bruce Momjian
Date:
Subject: Re: pg_restore [archiver] file offset in dump file is too