Re: use of dblink_build_sql_insert() induces a server crash

From: Joe Conway <mail(at)joeconway(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Rushabh Lathia <rushabh(dot)lathia(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: use of dblink_build_sql_insert() induces a server crash
Date: 2010-02-03 19:39:14
Message-ID: 4B69D0E2.4000703@joeconway.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 02/03/2010 10:18 AM, Tom Lane wrote:
> Joe Conway <mail(at)joeconway(dot)com> writes:
>> The problem exists with all three dblink_build_sql_* functions. Here is
>> a more complete patch. If there are no objections I'll apply this to
>> HEAD and look at back-patching -- these functions have hardly been
>> touched since inception.
>
> Do you really need to copy the relation tupdesc when you only are going
> to make a one-time check of the number of attributes? This coding would
> make some sense if you intended to use the tupdesc again later in the
> functions, but it appears you don't.
>
> Also, what about cases where the relation contains dropped columns ---
> it's not obvious whether this test is correct in that case.

Good input, as always. Here's another whack at it.

Thanks,

Joe

Attachment Content-Type Size
fix-dblink_build_sql.r1.patch text/x-patch 6.8 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2010-02-03 19:41:13 Re: PG 9.0 and standard_conforming_strings
Previous Message Tim Bunce 2010-02-03 19:38:38 Re: Add on_trusted_init and on_untrusted_init to plperl UPDATED [PATCH]