Обсуждение: Methods declaration

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

Methods declaration

От
Gianvito Pio
Дата:
Hello,<br /> I've just started working with ordbms. I'm searching for differences between postgresql and oracle...<br
/><br/> Btw, I've found it's possible to declare a method for a specific type in oracle...so if I create a type MyType,
Ican associate it also a method MyMethod....using the costructors:<br /><br /> CREATE TYPE MyType AS OBJECT<br />( <br
/>...<br/>...<br />...<br />MEMBER FUNCTION MyMethod(parameterName  parameterType)<br />RETURN ReturnType);<br /><br />
Isit possible to do the same with postgreSql? I've found the CREATE FUNCTION command...but it seems it creates global
functions,not associated to a particular type...<br /><br /> Thanks  

Re: Methods declaration

От
Tom Lane
Дата:
> Is it possible to do the same with postgreSql?

No, but you can overload function names in Postgres, which can provide a
lot of the same notational conveniences.
        regards, tom lane