RE: [INTERFACES] error insert

From: Craig Orsinger <orsingerc(at)epg-gw1(dot)lewis(dot)army(dot)mil>
To: pgsql-interfaces(at)postgreSQL(dot)org
Cc: abdelkrim <haj(at)idianet(dot)net>
Subject: RE: [INTERFACES] error insert
Date: 1999-05-10 18:58:25
Message-ID: XFMail.990510115825.orsingerc@epg-gw1.lewis.army.mil
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-interfaces


On 10-May-99 Craig Orsinger wrote:
>> CREATE FUNCTION complex_in(opaque)
>> RETURNS complex
>> AS '/usr/local/pgsql/postgresql-6.4.2/src/tutorial/complex.so'
>> LANGUAGE 'c';
>> NOTICE: ProcedureCreate: type 'complex' is not yet defined
>> NOTICE: ProcedureCreate: type 'complex' is not yet defined
>> CREATE
>
> Hmmm. Looks like the 'complex' type needs to be defined first.
> I used a different example as a basis for adding types and functions,
> it returned 'opaque' rather than a new type.

I'd suggest replacing "RETURNS complex" with "RETURNS opaque" and
see how that goes.

>> CREATE FUNCTION complex_out(opaque)
>> RETURNS opaque
>> AS '/usr/local/pgsql/postgresql-6.4.2/src/tutorial/complex.so'
>> LANGUAGE 'c';
>> CREATE
>>
>>
>> CREATE TYPE complex (
>> internallength = 16,
>> input = complex_in,
>> output = complex_out
>> );
>> CREATE
>
> Have you tried putting this CREATE TYPE statement before the
> first CREATE FUNCTION statement?

This will not work, for reasons that should have been obvious -
the input and output functions would not have been CREATE'd yet.

----------------------------------
Date: 10-May-99 Time: 11:55:53

Craig Orsinger (email: <orsingerc(at)epg(dot)lewis(dot)army(dot)mil>)
Logicon RDA
Bldg. 8B28 "Just another megalomaniac with ideas above his
6th & F Streets station. The Universe is full of them."
Ft. Lewis, WA 98433 - The Doctor
----------------------------------

In response to

Browse pgsql-interfaces by date

  From Date Subject
Next Message barreiro 1999-05-10 19:13:03 Re: [INTERFACES] Error linking C++ code.
Previous Message Craig Orsinger 1999-05-10 18:32:59 RE: [INTERFACES] error insert