Обсуждение: Create lo Data type

Поиск
Список
Период
Сортировка

Create lo Data type

От
"A Mohan"
Дата:
We are having Postgrsql 7.3.2.
To create lo type we gave the following SQL.
CREATE TYPE lo (
     internallength=4,  externallength=10,
     input=int4in, output=int4out,
     default='',  passedbyvalue
);

But we could not create this lo type. It gives the following
error.
**********
Failed to execute SQL : SQL CREATE TYPE lo ( internallength=4,
externallength=10, input=int4in, output=int4out, default='',
passedbyvalue ); failed : ERROR: TypeCreate: function int4out(lo)
does not exist
*************

Can any one help us? please....

Regards,
A.Mohan
___________________________________________________
Click below to experience Sooraj Barjatya's latest offering
'Main Prem Ki Diwani Hoon' starring Hrithik Roshan,
Abhishek Bachchan & Kareena Kapoor http://www.mpkdh.com


Re: Create lo Data type

От
Tom Lane
Дата:
"A  Mohan" <abmohan75@rediffmail.com> writes:
> To create lo type we gave the following SQL.
> CREATE TYPE lo (
>      internallength=4,  externallength=10,
>      input=int4in, output=int4out,
>      default='',  passedbyvalue
> );

> But we could not create this lo type.

You can't cheat like that anymore in defining a type.  You have to
provide real I/O functions for it.

A more appropriate way to define LO in 7.3 is as a domain:

    CREATE DOMAIN lo AS int4;

(although actually I'd think it should be a domain of OID not INT4).

            regards, tom lane