pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pb when creating  user type
7+ messages / 3 participants
[nested] [flat]

* pb when creating  user type
@ 1999-05-03 17:46 abdelkrim <haj@idianet.net>
  1999-05-03 18:18 ` RE: [INTERFACES] pb when creating  user type Craig Orsinger <orsingerc@epg-gw1.lewis.army.mil>
  0 siblings, 1 reply; 7+ messages in thread

From: abdelkrim @ 1999-05-03 17:46 UTC (permalink / raw)
  To: pgsql-interfaces

hello
I try to create a type complex, i generate a complex.so and when to insert
one complex into a table i have some problems
please help me


CREATE FUNCTION complex_out(opaque)
   RETURNS opaque
   AS '/usr/local/pgsql/complex.so'
   LANGUAGE 'c';
CREATE

CREATE TYPE complex (
   internallength = 16,
   input = complex_in,
   output = complex_out
);
CREATE


CREATE TABLE test_complex (
        a       complex,
        b       complex
);
CREATE

INSERT INTO test_complex VALUES ('(1.0, 2.5)', '(4.2, 3.55 )');
ERROR:  Can't find function complex_in in file /usr/local/pgsql/complex.so
ERROR:  Can't find function complex_in in file /usr/local/pgsql/complex.so
INSERT INTO test_complex VALUES ('(33.0, 51.4)', '(100.42, 93.55)');
ERROR:  Can't find function complex_in in file /usr/local/pgsql/complex.so
ERROR:  Can't find function complex_in in file /usr/local/pgsql/complex.so





^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* RE: [INTERFACES] pb when creating  user type
  1999-05-03 17:46 pb when creating  user type abdelkrim <haj@idianet.net>
@ 1999-05-03 18:18 ` Craig Orsinger <orsingerc@epg-gw1.lewis.army.mil>
  1999-05-03 18:35   ` RE: [INTERFACES] pb when creating  user type Craig Orsinger <orsingerc@epg-gw1.lewis.army.mil>
  0 siblings, 1 reply; 7+ messages in thread

From: Craig Orsinger @ 1999-05-03 18:18 UTC (permalink / raw)
  To: pgsql-interfaces


On 03-May-99 abdelkrim wrote:
> hello
> I try to create a type complex, i generate a complex.so and when to insert
> one complex into a table i have some problems
> please help me
> 
> 
> CREATE FUNCTION complex_out(opaque)
>    RETURNS opaque
>    AS '/usr/local/pgsql/complex.so'
>    LANGUAGE 'c';
> CREATE
> 
> CREATE TYPE complex (
>    internallength = 16,
>    input = complex_in,
>    output = complex_out
> );
> CREATE
> 
> 
> CREATE TABLE test_complex (
>         a       complex,
>         b       complex
> );
> CREATE
> 
> INSERT INTO test_complex VALUES ('(1.0, 2.5)', '(4.2, 3.55 )');
> ERROR:  Can't find function complex_in in file /usr/local/pgsql/complex.so
> ERROR:  Can't find function complex_in in file /usr/local/pgsql/complex.so
> INSERT INTO test_complex VALUES ('(33.0, 51.4)', '(100.42, 93.55)');
> ERROR:  Can't find function complex_in in file /usr/local/pgsql/complex.so
> ERROR:  Can't find function complex_in in file /usr/local/pgsql/complex.so

        The first question that occurs to me is, what version of 
PostgreSQL are you trying this with, and on what operating system?

        Second question: How did you generate the "complex.so"
library? You need to turn it into a shared library, which generally
requires that you first compile using a position independent code
option. With GNU utilities, it would go something like this:

        gcc -c -g -fpic -o complex.o complex.c
        ld -Bshareable -o complex.so complex.o 

        Then of course, you'll have to copy it to the /usr/local/pgsql
directory (since your installation script looks for it there), and you
may have to make sure that you have read AND execute permissions set.
HPUX requires this, and other OSs may, as well.

        As near as I can tell, the commands you listed should work,
provided you've installed per my directions. If that's not the problem
then we'll need more information, I suspect.

----------------------------------
Date: 03-May-99  Time: 11:06:27

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
----------------------------------



^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* RE: [INTERFACES] pb when creating  user type
  1999-05-03 17:46 pb when creating  user type abdelkrim <haj@idianet.net>
  1999-05-03 18:18 ` RE: [INTERFACES] pb when creating  user type Craig Orsinger <orsingerc@epg-gw1.lewis.army.mil>
@ 1999-05-03 18:35   ` Craig Orsinger <orsingerc@epg-gw1.lewis.army.mil>
  0 siblings, 0 replies; 7+ messages in thread

From: Craig Orsinger @ 1999-05-03 18:35 UTC (permalink / raw)
  To: pgsql-interfaces


On 03-May-99 Craig Orsinger wrote:
>> hello
>> I try to create a type complex, i generate a complex.so and when to insert
>> one complex into a table i have some problems
>> please help me
>> 
>> 
>> CREATE FUNCTION complex_out(opaque)
>>    RETURNS opaque
>>    AS '/usr/local/pgsql/complex.so'
>>    LANGUAGE 'c';
>> CREATE

        Is this a test? If so, I failed. I don't see where you create your
'complex_in()' function. Is it in a part of a script you forgot to include
in your original post?

        Anyway, if that's the entire script, add a "CREATE FUNCTION"
statement for 'complex_in()' and it should work a lot better.

----------------------------------
Date: 03-May-99  Time: 11:32:36

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
----------------------------------



^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: [INTERFACES] pb when creating  user type
@ 1999-05-04 08:21 abdelkrim <haj@idianet.net>
  1999-05-04 17:04 ` Re: [INTERFACES] pb when creating  user type Craig Orsinger <orsingerc@epg-gw1.lewis.army.mil>
  0 siblings, 1 reply; 7+ messages in thread

From: abdelkrim @ 1999-05-04 08:21 UTC (permalink / raw)
  To: Craig Orsinger <orsingerc@epg-gw1.lewis.army.mil>; pgsql-interfaces

>        Is this a test? If so, I failed. I don't see where you create your
>'complex_in()' function. Is it in a part of a script you forgot to include
>in your original post?


 complex_in(), complex_out() and complex_add() fonctions are defined in
complex.c

>
>        Anyway, if that's the entire script, add a "CREATE FUNCTION"
>statement for 'complex_in()' and it should work a lot better.
>


thanks for your help,
my operating system is FreeBSD 3.1
I use Postgresql-6.4.2

I tried :
            gcc -g -c -fpic -o complex.o complex.c
            ld -Bshareable -o complex.so complex.o

 it is the same error.





^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: [INTERFACES] pb when creating  user type
  1999-05-04 08:21 Re: [INTERFACES] pb when creating  user type abdelkrim <haj@idianet.net>
@ 1999-05-04 17:04 ` Craig Orsinger <orsingerc@epg-gw1.lewis.army.mil>
  0 siblings, 0 replies; 7+ messages in thread

From: Craig Orsinger @ 1999-05-04 17:04 UTC (permalink / raw)
  To: pgsql-interfaces; +Cc: abdelkrim <haj@idianet.net>


On 04-May-99 abdelkrim wrote:
>  complex_in(), complex_out() and complex_add() fonctions are defined in
> complex.c
> 
>>
>>        Anyway, if that's the entire script, add a "CREATE FUNCTION"
>>statement for 'complex_in()' and it should work a lot better.
>>

        Actually, I was referring to your SQL script. I did not see a
"CREATE FUNCTION" statement for the 'complex_in()' function, only the
'complex_out()' function. You need to have one for each function in
your library ("complex.so").

        I'm doing similar things with PostgreSQL 6.4.2 on Linux and HPUX,
and both are working fine - so it is possible.

> 
> thanks for your help,
> my operating system is FreeBSD 3.1
> I use Postgresql-6.4.2
> 

----------------------------------
Date: 04-May-99  Time: 10:00:07

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
----------------------------------



^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: [INTERFACES] pb when creating  user type
@ 1999-05-04 18:15 abdelkrim <haj@idianet.net>
  0 siblings, 0 replies; 7+ messages in thread

From: abdelkrim @ 1999-05-04 18:15 UTC (permalink / raw)
  To: pgsql-interfaces


>On 04-May-99 abdelkrim wrote:
>>  complex_in(), complex_out() and complex_add() fonctions are defined in
>> complex.c
>> 
>>>
>>>        Anyway, if that's the entire script, add a "CREATE FUNCTION"
>>>statement for 'complex_in()' and it should work a lot better.
>>>
>
>        Actually, I was referring to your SQL script. I did not see a
>"CREATE FUNCTION" statement for the 'complex_in()' function, only the
>'complex_out()' function. You need to have one for each function in
>your library ("complex.so").


the complex_in() function  is defined in script

>
>        I'm doing similar things with PostgreSQL 6.4.2 on Linux and HPUX,
>and both are working fine - so it is possible.
>
>> 
>> thanks for your help,
>> my operating system is FreeBSD 3.1
>> I use Postgresql-6.4.2
>> 





^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: [INTERFACES] pb when creating user type
@ 1999-05-05 14:16 Michael Davis <Michael.Davis@tvguide.com>
  0 siblings, 0 replies; 7+ messages in thread

From: Michael Davis @ 1999-05-05 14:16 UTC (permalink / raw)
  To: Craig Orsinger <orsingerc@epg-gw1.lewis.army.mil>; +Cc: Pgsql-Interfaces@Postgresql.Org, Abdelkrim <Haj@Idianet.Net>

	Your e-mail did not arrive at its intended destination. You need to
send it to Michael J. Davis, not Michael Davis.


	From:	Craig Orsinger <orsingerc @ epg-gw1.lewis.army.mil> on
05/04/99 01:04 PM
	To:	pgsql-interfaces @ postgreSQL.org@SMTP@EXCHANGE
	cc:	abdelkrim <haj @ idianet.net>@SMTP@EXCHANGE 
	Subject:	Re: [INTERFACES] pb when creating  user type


	On 04-May-99 abdelkrim wrote:
	>  complex_in(), complex_out() and complex_add() fonctions are
defined in
	> complex.c
	> 
	>>
	>>        Anyway, if that's the entire script, add a "CREATE
FUNCTION"
	>>statement for 'complex_in()' and it should work a lot better.
	>>

	        Actually, I was referring to your SQL script. I did not see
a
	"CREATE FUNCTION" statement for the 'complex_in()' function, only
the
	'complex_out()' function. You need to have one for each function in
	your library ("complex.so").

	        I'm doing similar things with PostgreSQL 6.4.2 on Linux and
HPUX,
	and both are working fine - so it is possible.

	> 
	> thanks for your help,
	> my operating system is FreeBSD 3.1
	> I use Postgresql-6.4.2
	> 

	----------------------------------
	Date: 04-May-99  Time: 10:00:07

	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
	----------------------------------






^ permalink  raw  reply  [nested|flat] 7+ messages in thread


end of thread, other threads:[~1999-05-05 14:16 UTC | newest]

Thread overview: 7+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
1999-05-03 17:46 pb when creating  user type abdelkrim <haj@idianet.net>
1999-05-03 18:18 ` Craig Orsinger <orsingerc@epg-gw1.lewis.army.mil>
1999-05-03 18:35   ` Craig Orsinger <orsingerc@epg-gw1.lewis.army.mil>
1999-05-04 08:21 Re: [INTERFACES] pb when creating  user type abdelkrim <haj@idianet.net>
1999-05-04 17:04 ` Craig Orsinger <orsingerc@epg-gw1.lewis.army.mil>
1999-05-04 18:15 Re: [INTERFACES] pb when creating  user type abdelkrim <haj@idianet.net>
1999-05-05 14:16 Re: [INTERFACES] pb when creating user type Michael Davis <Michael.Davis@tvguide.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox