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@epg.lewis.army.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
----------------------------------