By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,834 Members | 2,240 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,834 IT Pros & Developers. It's quick & easy.

functions/operators with 2 sets as arguments

P: n/a
While trying to create an operator to test if 2 intervals
overlap, I ran into the following limitation:

ERROR: Functions and operators can take only one set argument
(PostgreSQL 7.3.2 on OpenBSD)

Does anybody know any workarounds (or if this limitation has been
removed from 7.4)?

Jochem

--
When you don't want to be surprised by the revolution
organize one yourself
- Loesje


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

Nov 12 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Jochem van Dieten <jo*****@oli.tudelft.nl> writes:
While trying to create an operator to test if 2 intervals
overlap, I ran into the following limitation: ERROR: Functions and operators can take only one set argument
(PostgreSQL 7.3.2 on OpenBSD) Does anybody know any workarounds (or if this limitation has been
removed from 7.4)?


It's still there, and is unlikely to go away (I think future development
is more likely to go in the direction of deprecating/removing set-valued
functions in SELECT expressions than extending the facility).

Why would interval overlap testing require such a function? What are
you trying to do, exactly?

Also, have you looked at the SQL OVERLAPS operator? Your problem might
be solved already, if what you are after corresponds to what the SQL
authors thought would be useful ...

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to ma*******@postgresql.org so that your
message can get through to the mailing list cleanly

Nov 12 '05 #2

P: n/a
Tom Lane wrote:
Jochem van Dieten <jo*****@oli.tudelft.nl> writes:

While trying to create an operator to test if 2 intervals
overlap, I ran into the following limitation:

ERROR: Functions and operators can take only one set argument
(PostgreSQL 7.3.2 on OpenBSD)
It's still there, and is unlikely to go away (I think future development
is more likely to go in the direction of deprecating/removing set-valued
functions in SELECT expressions than extending the facility).

Why would interval overlap testing require such a function? What are
you trying to do, exactly?

Also, have you looked at the SQL OVERLAPS operator? Your problem might
be solved already, if what you are after corresponds to what the SQL
authors thought would be useful ...


The SQL OVERLAPS predicate is almost what I want, but I would
like to have an operator that returns TRUE if the end of the
first interval is the beginning of the second interval. But since
2 sets can't be used, I will fix it by simply adding an extra
condition to the query.

Jochem

--
When you don't want to be surprised by the revolution
organize one yourself
- Loesje

---------------------------(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

Nov 12 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.