| From: | Neil Conway <neilc(at)samurai(dot)com> |
|---|---|
| To: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
| Cc: | PostgreSQL Patches <pgsql-patches(at)postgresql(dot)org> |
| Subject: | Re: revised patch for PL/PgSQL table functions |
| Date: | 2002-08-30 04:55:50 |
| Message-ID: | 87sn0xlzc9.fsf@mailbox.samurai.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-patches |
Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> writes:
> I've applied this patch with some editorializing --- mainly, I didn't
> like hardwiring the functionality to plpgsql, so I extended the
> ReturnSetInfo interface instead. Now anybody can use the
> return-a-tuplestore mechanism for SRFs.
Thanks Tom.
> There is a rather nasty bug left (Sir Mordred would likely call it a
> DOS possibility ;-)) --- RETURN NEXT doesn't seem to be checking that
> the row or record variable it is given actually matches the declared
> return type of the plpgsql function.
Yes, I probably should have mentioned that. I considered adding the
code to generate a TupleDesc for each call of RETURN NEXT and compare
that to the TupleDesc used for the previous RETURN NEXT statement, but
that seems to be quite expensive: equalTupleDescs() is not cheap, and
neither is TyoeGetTupleDesc() (which is required for returning
non-RECORD vars). Since RETURN NEXT will often be called many times
within a single function, the performance hit seems unappealing. Is
there a better way?
Cheers,
Neil
--
Neil Conway <neilc(at)samurai(dot)com> || PGP Key ID: DB3C29FC
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Neil Conway | 2002-08-30 05:10:29 | Re: fix for palloc() of user-supplied length |
| Previous Message | Joe Conway | 2002-08-30 04:29:49 | Re: SRF memory mgmt patch (was [HACKERS] Concern about |