From: Ross J. Reedstrom <reedstrm@rice.edu>
To: Alan Gutierrez <alangutierrez@hotmail.com>
Cc: Bill <bchie@opensys.com.hk>
Cc: pgsql-sql@postgresql.org
Subject: Re: Re: DateDiff, IsNull?
Date: Tue, 14 Aug 2001 10:34:51 -0500
Message-ID: <20010814103451.A15790@rice.edu> (raw)
In-Reply-To: <Pine.WNT.4.33.0108140634400.1680-100000@CX1198465-B>
References: <9lb25o$psq$1@news.tht.net>
<Pine.WNT.4.33.0108140634400.1680-100000@CX1198465-B>
On Tue, Aug 14, 2001 at 06:51:33AM +0000, Alan Gutierrez wrote:
>
> Overloading operators? *Please* tell me that this is impossible.
Well, Alan, overloading operators is sort of important to the user
definable types in postgresql. And any cross-type functionality, actually.
Bill's original question was looking for 'text1' + 'text2' to mean
concatentation. The right (SQL92) spelling for that is:
'text1' || 'text2'
Currently, since there is no '+' operator for the types 'text' and
'text', you probably could define it as a synonym for ||. I wouldn't
expect your code to be very portable that way, but it might work. (BTW,
as written above, with string constants (type 'unknown'), the type
promotion system kicks in and turns the strings into 'char', I believe,
which it then adds the raw values of the first character, and produces
'æ' (sorry about the 8-bit character))
Check the manuals for 'CREATE OPERATOR', then grovel through the
pg_operator table to figure out what all you'd need to hand it for
procedure names, etc.
Ross
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: reedstrm@rice.edu, alangutierrez@hotmail.com, bchie@opensys.com.hk
Subject: Re: Re: DateDiff, IsNull?
In-Reply-To: <20010814103451.A15790@rice.edu>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox