Re: Can a view represent a schedule for all days into the future?

Поиск
Список
Период
Сортировка
От David Johnston
Тема Re: Can a view represent a schedule for all days into the future?
Дата
Msg-id 1381426967827-5774076.post@n5.nabble.com
обсуждение исходный текст
Ответ на Can a view represent a schedule for all days into the future?  (Adam Mackler <postgres@mackler.org>)
Ответы Re: Can a view represent a schedule for all days into the future?  (Adam Mackler <postgres@mackler.org>)
Список pgsql-general
Adam Mackler-3 wrote
>
http://stackoverflow.com/questions/19237450/can-sql-view-have-infinite-number-of-rows-repeating-schedule-each-row-a-day
>
> 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.

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.

The use-case you are stating is best solved via the creation of a
user-defined function.  I would implement that and then, in the off chance
there is some kind of client-library interface issue, solve that specific
problem when it arises.  Implementing a less-than-ideal solution today for a
problem that may never even come up is foolish.

More specifically you cannot model infinity in this situation.  The best you
could do is use "generate_series(...)" to construct and appropriately large
domain of values which would then be filtered.

If you want to provide a concrete situation that you must handle and that
the function-invocation form of the API will not work please do so and maybe
some advice can be provided to solve that problem.  Unless and until you can
do that just use the function-invocation form and be content.

David J.




--
View this message in context:
http://postgresql.1045698.n5.nabble.com/Can-a-view-represent-a-schedule-for-all-days-into-the-future-tp5774069p5774076.html
Sent from the PostgreSQL - general mailing list archive at Nabble.com.


В списке pgsql-general по дате отправления:

Предыдущее
От: Adam Mackler
Дата:
Сообщение: Can a view represent a schedule for all days into the future?
Следующее
От: Marc Mamin
Дата:
Сообщение: Re: Why doesn't update syntax match insert syntax?