Re: [GENERAL] overloading LIKE operator to handle integer + text

2012-10-30 Thread Shaun Thomas
On 10/30/2012 03:14 PM, David Johnston wrote: "LIKE" is apparently not an operator but a special SQL construct. Almost. :) The real problem is this, from the manual: "The operator name is a sequence of up to NAMEDATALEN-1 (63 by default) characters from the following list: + - * / < > = ~

Re: [GENERAL] overloading LIKE operator to handle integer + text

2012-10-30 Thread David Johnston
> -Original Message- > From: pgsql-general-ow...@postgresql.org [mailto:pgsql-general- > ow...@postgresql.org] On Behalf Of Thalis Kalfigkopoulos > Sent: Tuesday, October 30, 2012 3:55 PM > To: pgsql-general@postgresql.org > Subject: [GENERAL] overloading LIKE operator

[GENERAL] overloading LIKE operator to handle integer + text

2012-10-30 Thread Thalis Kalfigkopoulos
Hi all, I'd like to be able to operate LIKE using as arguments an integer and a text value. In postgresql 9.0 the following raises an error: # SELECT 123 LIKE '123'; ERROR: operator does not exist: integer ~~ unknown LINE 1: select 123 like '123'; ^ HINT: No operator matches t

Re: [GENERAL] Overloading

2008-06-14 Thread D Galen
Ralph Smith wrote: I never did get an answer to this. I get: ERROR: cannot change return type of existing function HINT: Use DROP FUNCTION first. ** Error ** ERROR: cannot change return type of existing function SQL state: 42P13 Hint: Use DROP FUNCTION first. When I try t

Re: [GENERAL] Overloading

2008-06-13 Thread Andrew Sullivan
On Fri, Jun 13, 2008 at 06:11:43PM -0700, Ralph Smith wrote: > I get: > ERROR: cannot change return type of existing function > HINT: Use DROP FUNCTION first. Don't use CREATE OR REPLACE for the second one. The OR REPLACE is trying to replace a function of the same name. A -- Andrew Sulliva

[GENERAL] Overloading

2008-06-13 Thread Ralph Smith
I never did get an answer to this. I get: ERROR: cannot change return type of existing function HINT: Use DROP FUNCTION first. ** Error ** ERROR: cannot change return type of existing function SQL state: 42P13 Hint: Use DROP FUNCTION first. When I try to: CREATE OR REPLAC

Re: [GENERAL] Overloading || ( text,text ) operator

2004-09-06 Thread Richard Huxton
Suresh Tri wrote: 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 u

[GENERAL] Overloading || ( text,text ) operator

2004-09-03 Thread Suresh Tri
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 behav

Re: [GENERAL] Overloading '<' operator

2004-08-31 Thread Suresh Tri
I used the internal function text_pattern_lt and it is working fine! Thanks for helping. cheers Suresh ---(end of broadcast)--- TIP 9: the planner will ignore your desire to choose an index scan if your joining column's datatypes do not match

Re: [GENERAL] Overloading '<' operator

2004-08-31 Thread Tom Lane
Peter Eisentraut <[EMAIL PROTECTED]> writes: > Am Dienstag, 31. August 2004 15:18 schrieb Suresh Tri: >> Can any one tell how to use the previous version of ooperator while >> overloading one. > Don't call the previous operator, call the function underlying the previous > operator. Or put them i