Re: build array of composites in SPI - Mailing list pgsql-general

From Tom Lane
Subject Re: build array of composites in SPI
Date
Msg-id 2717.1258485587@sss.pgh.pa.us
Whole thread Raw
In response to Re: build array of composites in SPI  (Merlin Moncure <mmoncure@gmail.com>)
Responses Re: build array of composites in SPI  (Merlin Moncure <mmoncure@gmail.com>)
List pgsql-general
Merlin Moncure <mmoncure@gmail.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

pgsql-general by date:

Previous
From: Merlin Moncure
Date:
Subject: Re: build array of composites in SPI
Next
From: shohorab hossain
Date:
Subject: Postgresql Database Lock Problem