Re: TupleDesc refcounting - Mailing list pgsql-patches

From Tom Lane
Subject Re: TupleDesc refcounting
Date
Msg-id 5148.1137080443@sss.pgh.pa.us
Whole thread Raw
In response to Re: TupleDesc refcounting  (Neil Conway <neilc@samurai.com>)
Responses Re: TupleDesc refcounting  (Neil Conway <neilc@samurai.com>)
List pgsql-patches
Neil Conway <neilc@samurai.com> writes:
> Ah, I see what you mean. In implementing this, I wasn't sure the best
> way to provide these two sorts of TupleDesc references. My first thought
> was to add a "use ResourceOwner?" boolean parameter to the routines that
> create and destroy references to TupleDescs:

No, I wouldn't do that.  I would keep the routines you mention ignorant
of ResourceOwner, because I think that the vast majority of tupdesc
usage will NOT be using ResourceOwners.  Only the places where a pointer
to a cached tupdesc is handed out need to deal with this.  This excludes
practically all of the executor, for instance.

If you're finding yourself writing a large and invasive patch, I think
you're doing it wrong.  I'm envisioning something pretty localized.

            regards, tom lane

pgsql-patches by date:

Previous
From: Neil Conway
Date:
Subject: Re: TupleDesc refcounting
Next
From: Alvaro Herrera
Date:
Subject: Re: Summary table trigger example race condition