Re: Do all rows from a set have the same TupleDesc? - Mailing list pgsql-hackers

From Raúl Marín Rodríguez
Subject Re: Do all rows from a set have the same TupleDesc?
Date
Msg-id CAM6_UM6dJBRjpETY_+QbEdk=0aaBukSwvZrJ4FRW7MhG=NMrMA@mail.gmail.com
Whole thread Raw
In response to Re: Do all rows from a set have the same TupleDesc?  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Hi Tom,

> Yeah, caching such info is common.  It's traditional to code defensively
> about the validity of the cache (see e.g. record_out), but I'm not sure
> to what extent that's really necessary for aggregates. In the case of
> record_out, paranoia is probably justified because FmgrInfo structs for
> I/O functions may get cached and re-used across statements, but I doubt
> that can happen for an aggregate.

The implementation of record_out is exactly what I was planning plus some
extra defenses. I'd consider the record type changing mid aggregation a
race condition, so I'll drop those checks.

Thanks a lot for the information.

Regards,


--
Raúl Marín Rodríguez 
carto.com

pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: libpq should append auth failures, not overwrite
Next
From: Bruce Momjian
Date:
Subject: Re: POC for a function trust mechanism