Re: contrib mode - pgenv

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: Mike Mascari <mascarm(at)mascari(dot)com>, pgsql-patches(at)postgresql(dot)org
Subject: Re: contrib mode - pgenv
Date: 2003-09-21 16:32:24
Message-ID: 10709.1064161944@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

Peter Eisentraut <peter_e(at)gmx(dot)net> writes:
> Mike Mascari writes:
>> Well, I basically implemented it as a result of this thread:
>> http://archives.postgresql.org/pgsql-general/2003-09/msg01347.php

> We've rejected session variables many times before because they duplicate
> temporary tables. I don't see anything new added by this proposal.

I should think there would be a notable performance advantage, since
one need not create a temp table (which in our current implementation is
just as expensive as creating a permanent table); not to mention
dropping the temp table later, vacuuming up the resulting dead rows in
pg_class and pg_attribute, etc. Whether that advantage is great enough
to justify a nonstandard feature is unproven, but I imagine Mike could
answer it with a little experimentation.

I guess the main limitation that I see in this proposal is that it can
only handle a single variable datatype (namely text). In a temp-table
design you can of course make the column datatype(s) whatever you need.
This objection could perhaps be answered just by making the function
names be get_session_variable_text() and set_session_variable_text(),
to leave room for variants for other data types.

regards, tom lane

In response to

Responses

Browse pgsql-patches by date

  From Date Subject
Next Message Tom Lane 2003-09-21 18:04:12 Re: Align large shared memory allocations
Previous Message Peter Eisentraut 2003-09-21 13:01:01 Re: contrib mode - pgenv