Re: [SQL] Why no exprs in format string to RAISE

2004-07-05 Thread Richard Huxton
Markus Bertheau wrote:
Hi,
is there a non-implementation reason as to why there are no expressions
allowed in the arguments to the format string to RAISE, or is that just
not implemented yet?
Just not done yet AFAIK. It would require some changes to the parser for 
 plpgsql, but nothing too extreme. Might make a good project for 
someone learning more about PG's code.

--
  Richard Huxton
  Archonet Ltd
---(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


[SQL] Custom type where not all elements are comparable

2004-07-05 Thread Markus Bertheau
Hi,

Is it possible to define or implement a type in PostgreSQL not all
values of which are comparable to each other? In particular I'm thinking
of a duration type similar to the XML Schema duration type[1]. For
example P2D (2 days) is less than P4D (4 days), but P1M (1 month) and
P30D (30 days) are not comparable.

Thanks.

[1] http://www.w3.org/TR/xmlschema-2/#duration

-- 
Markus Bertheau <[EMAIL PROTECTED]>


---(end of broadcast)---
TIP 4: Don't 'kill -9' the postmaster


Re: [SQL] Custom type where not all elements are comparable

2004-07-05 Thread Tom Lane
Markus Bertheau <[EMAIL PROTECTED]> writes:
> Is it possible to define or implement a type in PostgreSQL not all
> values of which are comparable to each other?

Certainly, as long as you don't expect to be able to btree-index it,
sort it, or DISTINCT it.  (In theory we could probably handle DISTINCT
using hash aggregation, as long as equality behaves sanely; but that's
not implemented now.)

Probably it'd be reasonable for the comparison operators to return
NULL for a noncomparable pair of inputs.

regards, tom lane

---(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: [SQL] Custom type where not all elements are comparable

2004-07-05 Thread Peter Eisentraut
Markus Bertheau wrote:
> Is it possible to define or implement a type in PostgreSQL not all
> values of which are comparable to each other? In particular I'm
> thinking of a duration type similar to the XML Schema duration
> type[1]. For example P2D (2 days) is less than P4D (4 days), but P1M
> (1 month) and P30D (30 days) are not comparable.

Smells like the interval type.


---(end of broadcast)---
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])