On Thu, Oct 10, 2013 at 10:42:47AM -0700, David Johnston wrote: > Adam Mackler-3 wrote > > http://stackoverflow.com/questions/19237450/can-sql-view-have-infinite-number-of-rows-repeating-schedule-each-row-a-day > > > Not sure how you can state "But I'm willing to agree never to query such a > view without a WHERE clause that restricts the number of rows." when you > cannot even guarantee which host-language client libraries you need to > support. I'm willing to agree that if I ever query such a view without a WHERE clause that restricts the number of rows, then I won't blame anyone but myself for the consequences. If someone can answer this challenge without imposing that requirement, then I shall be all the more impressed. The library I'm using is SLICK: http://slick.typesafe.com/ As far as I can tell it can't handle user-defined functions that return multiple rows nor multiple columns, except perhaps through some low-level SQL interface that would defeat my idea of the purpose of using a database interface library. As I mention in the post on SO, my understanding of relational database theory tells me that tables/relations ARE functions, in the sense of being a mapping between a primary key and a row. So there's nothing ambiguous about issuing a SELECT query for some particular date, and if I'm only querying for one date, then there's only one day in the resulting table. It wouldn't surprise me if there were some way to create a view based on underlying tables that contain schedules for each day of the week that I could query in such a fashion for any day arbitrarily far into the future. If this is possible, then I would be interested in knowing what the creation of such a view looks like, independently of my immediate practical needs. Call me academic. -- Adam Mackler -- Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general