in reply to Perl 6 Junctions and Postgres SQL

In other words, PostgreSQL provides an alias for "WHERE s IN (...)" and calls it "WHERE s = ANY(...)". Forgive me for being underwhelmed.

It's not surprising that SQL is going to look at a lot like the junction operators - both operate on sets*. A relational database is nothing more than a set theory machine. The junction operators are similar. You even have all() and one() in SQL; they're just not in the forms you're thinking of.

*: Yes, the junction operators deal with lists, but they treat the lists as sets.


My criteria for good software:
  1. Does it work?
  2. Can someone else come in, make a change, and be reasonably certain no bugs were introduced?

Replies are listed 'Best First'.
Re^2: Perl 6 Junctions and Postgres SQL
by grinder (Bishop) on Dec 22, 2007 at 16:20 UTC

    I share your sentiments. Still, all is not lost. I was happy to hear of the generate_series thing. I don't know how directly this can be transposed to another DB, (thinking of Oracle here), but I do know that at times it can be nice to have a select generate a huge amount of arbitary data on the fly.

    The other day I needed to blend the numbers 1..19999 into a select, and after considering a select ... union select from dual for about a microsecond, I created a table with a single column containing the numbers from 1 to 19999. Sort of ugly, but it got the job done.

    • another intruder with the mooring in the heart of the Perl