From: | Adam Mackler <postgres(at)mackler(dot)org> |
---|---|
To: | pgsql-general(at)postgresql(dot)org |
Subject: | Can a view represent a schedule for all days into the future? |
Date: | 2013-10-10 17:16:48 |
Message-ID: | 20131010171648.GR26883@mackler.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
Hi:
I recently posted a question on stackoverflow, but I suspect it may
require specific PostgreSQL knowledge, so I'm cross-posting a
reference to it here.
The gist is that I have information representing companies' daily
schedules in some tables, and I want to be able to do a SELECT to get
the business hours for any given day, arbitrarily far into the future
(and past, but I can live with a limit in that direction). I want to
encapsulate any messy SQL in a single location where it can be hidden
from client usage, presumably in a view.
I currently have a user-defined function that returns the results I
want, but the problem is in the invocation: Some host-language client
libraries aren't so graceful with user-defined functions, especially
when they return multiple rows of multiple columns. I would like to
be able to do a simple table-style SELECT query, presumably on a view.
But if I can put any date into the WHERE clause, then that means the
view would represent a table with an infinite number of rows, would it
not?
The posting on SO clarifies the specifics of what I'm trying to. It
seems like there ought to be a way, but I haven't figured it out.
Thanks very much.
--
Adam Mackler
From | Date | Subject | |
---|---|---|---|
Next Message | David Johnston | 2013-10-10 17:42:47 | Re: Can a view represent a schedule for all days into the future? |
Previous Message | Bruce Momjian | 2013-10-10 16:47:12 | Re: Segmentation fault: pg_upgrade 9.1 to 9.3: pg_dump: row number 0 is out of range 0..-1 |