Thread: How to create a new operator inpg for spec data type?

How to create a new operator inpg for spec data type?

From
"jacktby@gmail.com"
Date:
I need to create a new operator like '<->' and its syntax is that text1 <-> text2,
for the usage like this: 'a' <-> 'b' = 'a1b1', so how could I realize this one?
Can you give me some exmaples.

--------------
jacktby@gmail.com



Re: How to create a new operator inpg for spec data type?

From
Erik Wienhold
Date:
> On 01/02/2023 06:40 CET jacktby@gmail.com <jacktby@gmail.com> wrote:
>
> I need to create a new operator like '<->' and its syntax is that text1 <-> text2,
> for the usage like this: 'a' <-> 'b' = 'a1b1', so how could I realize this one?
> Can you give me some exmaples.

https://www.postgresql.org/docs/current/sql-createoperator.html

But why use an operator and not just the function that you must create anyway?

--
Erik