Opaque not working as documented

Поиск
Список
Период
Сортировка
От Steven Blundy
Тема Opaque not working as documented
Дата
Msg-id 3D10E921.4040308@clemson.edu
обсуждение исходный текст
Ответы Re: Opaque not working as documented
Список pgsql-novice
Hi, I'm having an odd problem with CREATE FUNCTION. Here are my statements:

CREATE FUNCTION ENCODE_BURY_TYPE (OPAQUE) RETURNS INT
    AS 'SELECT CASE
        WHEN $1 = \'EXACT\' THEN 1
        WHEN $1 = \'APPROX\' THEN 2
        WHEN $1 = \'PSUEDO\' THEN 3
        ELSE NULL
        END;'
    LANGUAGE 'SQL';

CREATE FUNCTION DECODE_BURY_TYPE (INT) RETURNS OPAQUE
    AS 'SELECT CASE
        WHEN $1 = 1 THEN \'EXACT\'
        WHEN $1 = 2 THEN \'APPROX\'
        WHEN $1 = 3 THEN \'PSUEDO\'
        ELSE \'NONE\'
        END;'
    LANGUAGE 'SQL';

CREATE TYPE BURY_TYPE (
    INPUT = ENCODE_BURY_TYPE,
    OUTPUT = DECODE_BURY_TYPE,
    INTERNALLENGTH = 16
);

This results in the error messages

ERROR: SQL functions cannot have arguments of type "opaque"
ERROR: SQL functions cannot return type "opaque"

Changing opaque to text results in the CREATE FUNCTION statements
working, while the CREATE TYPE statements throw a fit.

I suspect a configuration problem, but I have no idea where to look and
searches on google and the list archives haven't turned up anything. I'm
running the redhat rpms for Postgresql 7.2.1 on redhat 7.3.

Thank you,

Steve


В списке pgsql-novice по дате отправления:

Предыдущее
От: "Guthrie, John"
Дата:
Сообщение: Re: Pb with createdb
Следующее
От: John Taylor
Дата:
Сообщение: Re: What gets inherited