Re: Re: C language function dump problem

From: Philip Warner <pjw(at)rhyme(dot)com(dot)au>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Re: C language function dump problem
Date: 2000-07-10 00:38:30
Message-ID: 3.0.5.32.20000710103830.0094fc40@mail.rhyme.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

At 13:25 9/07/00 -0400, Tom Lane wrote:
>Philip Warner <pjw(at)rhyme(dot)com(dot)au> writes:
>> It seems some code disappeared from pg_dump.c between 7.0.2 and current,
>> ...
>> P.S. The specific problem is that it now uses plsrc as the definition for
>> all functions, whereas the (C language) plpgsql call handler requires plbin
>> to be used.
>
>Now that I think about it, the code was actually broken before that,
>because for a C-language function it needs to produce two AS items
>specifying the link symbol and the library path. Looks like we
>neglected to update pg_dump when that feature was added.
>

Looking at the code, it *seems* that I should be able to (in pseudo-code):

if ( finfo[i].probin != "-")
defn = defn || "AS " || finfo[i].probin;

if ( finfo[i].prosrc != "-")
defn = defn || "AS " || finfo[i].prosrc;

ie. Use probin is it is not "-", and use prosrc if it is not "-".

This gets around hard coding for C & newC, so reduces the chance of
problems in the future...I think.

Does that sound reasonable to everyone?

----------------------------------------------------------------
Philip Warner | __---_____
Albatross Consulting Pty. Ltd. |----/ - \
(A.C.N. 008 659 498) | /(@) ______---_
Tel: (+61) 0500 83 82 81 | _________ \
Fax: (+61) 0500 83 82 82 | ___________ |
Http://www.rhyme.com.au | / \|
| --________--
PGP key available upon request, | /
and from pgp5.ai.mit.edu:11371 |/

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2000-07-10 01:13:19 Re: Re: C language function dump problem
Previous Message Bruce Momjian 2000-07-10 00:37:46 Re: Re: [GENERAL] PostgreSQL vs. MySQL