Overloading || ( text,text ) operator

Поиск
Список
Период
Сортировка
От trisuresh@yahoo.co.in (Suresh Tri)
Тема Overloading || ( text,text ) operator
Дата
Msg-id a8de98e.0409030549.78dbcba1@posting.google.com
обсуждение исходный текст
Ответы Re: Overloading || ( text,text ) operator  (Richard Huxton <dev@archonet.com>)
Список pgsql-general
Hi,

I was trying to overload concat operator ||(text,text) such a way that
it behaves like Oracle. i.e. I want 'abc' || null to return 'abc'
instead of null.
I know that it is not the expected  behaviour in postgres, but since I
am migrating the database from oracle to postgres , I need this
behaviour.

But when I try to drop the existing || operator, I get the following
error
ERROR:  cannot drop operator ||(text,text) because it is required by
the database system

Also I cannot modify the application which runs over the database.
Hence I cannot overload || (varchar,varchar) and use it.

Is there any way of overloading the || operator , such that it behaves
like Oracle? ( I know that Oracle behaviour is wrong , but my aim is
to move an existing application which runs on Oracle to Postgres :-(
)

Thanks,
Abhiman

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

Предыдущее
От: Frank Knobbe
Дата:
Сообщение: Re: postgres "on in the internet"
Следующее
От: Shelby Cain
Дата:
Сообщение: pl/pgsql exceptions