Re: Re: DateDiff, IsNull?

Поиск
Список
Период
Сортировка
От Ross J. Reedstrom
Тема Re: Re: DateDiff, IsNull?
Дата
Msg-id 20010814103451.A15790@rice.edu
обсуждение исходный текст
Ответ на Re: DateDiff, IsNull?  (Alan Gutierrez <alangutierrez@hotmail.com>)
Ответы Re: Re: DateDiff, IsNull?
Список pgsql-sql
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


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Eh?
Следующее
От: "Josh Berkus"
Дата:
Сообщение: Re: problem connecting to pg.