Search Postgresql Archives

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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.


-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux