Re: build array of composites in SPI

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Merlin Moncure <mmoncure(at)gmail(dot)com>
Cc: PostgreSQL General <pgsql-general(at)postgresql(dot)org>
Subject: Re: build array of composites in SPI
Date: 2009-11-17 19:19:47
Message-ID: 2717.1258485587@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Merlin Moncure <mmoncure(at)gmail(dot)com> writes:
> right...makes sense. converted. one last question: can you save off
> the blessed TupleDesc (that is, make it static) between invocations of
> the function (I'm not worried about it changing)?

You could probably get away with copying it into some long-term memory
context. Once you've blessed it the record typmod should remain the
same for the rest of the session.

If you're feeling bloody-minded you could remember the pointer returned
by lookup_rowtype_tupdesc(), but that strikes me as assuming too much
about the behavior of typcache.c.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message shohorab hossain 2009-11-17 19:25:51 Postgresql Database Lock Problem
Previous Message Merlin Moncure 2009-11-17 19:11:48 Re: build array of composites in SPI