Forum OpenACS Q&A: Response to Postgres feature questions

Collapse
Posted by Ben Adida on
Andrew,

1. No, PG does not have materialized views, but you can sort of
simulate them with triggers (probably not what you want to do,
but if you really need the efficiency of materialized views, that's
really what you're going to have to do).

2. You are right on. PG does not currently allow you to return REF
cursors, but will eventually allow you to return an arbitrary
relation, which is effectively what you're talking about, and brings
a certain amount of closure to plpgsql that LISP lovers dream
about every night.

3. you got me. Sounds like you know as much as I do on that
topic.

4. uggh. That's ugly. So what you're asking is, in PG, can you do
something as ugly as what you just did in Oracle? :) There is no
pseudo-column like rownum in PG, so I'd be tempted to say that
you can't do that. However, there are some monster SQL
hackers in this community (DanW? Don?) who might be able to
pull some amazing trick to do just this... anyone?