[pgsql-jp: 41251] Re: ユーザー定義関数の作り方
山田 明
lennygcc @ infoseek.jp
2012年 10月 17日 (水) 15:07:42 JST
佐藤様
いただいたソースコードをGCC 4.3.2でコンパイルし、下記のように関数登録したところ、
実数配列について、引数にエラーを生じました。
このエラーとは関係ないと思いますが、CRETAE FUNCTIONの際に、戻り値をREALとしたいと考えています。
他にも、この2,3日中に、当方の動作状況をUPしてゆく予定です。
よろしく、お願いいたします。
Welcome to psql 8.3.17, the PostgreSQL interactive terminal.
Type: \copyright for distribution terms
\h for help with SQL commands
\? for help with psql commands
\g or terminate with semicolon to execute query
\q to quit
postgres=# CREATE FUNCTION sum_array(anyarray)
RETURNS REAL
AS '/tmp/sum_array.so', 'sum_array'
LANGUAGE 'c'
;
CREATE FUNCTION
postgres=# SELECT * FROM SUM_ARRAY(ARRAY[0.1,0.2,0.3]);
ERROR: could not determine data type of input
postgres=# SELECT * FROM SUM_ARRAY(ARRAY[1,2,3]);
The connection to the server was lost. Attempting reset: Failed.
!> \q
pgsql-jp メーリングリストの案内