Testing Views

Поиск
Список
Период
Сортировка
От Andy Chambers
Тема Testing Views
Дата
Msg-id CAHnaAczEU5hFGTw1EmsCK4yrwXqTqsVO32EqZXWDh5x+TedR+A@mail.gmail.com
обсуждение исходный текст
Ответы Re: Testing Views
Список pgsql-general
Hello All,

I have a problem for which a view seems like a nice solution. Basically we want to see all records in some table that are older than 5 days and haven't yet gone through further processing.

This particular view is probably simple enough that it doesn't require unit tests but I wonder how people test complex views that depend on the current date or time. I found a thread on the hackers list [1] that talked about stubbing pg_catalog.now() but was wondering if any TDD minded developers had invented anything better since then.

One option I thought of was to just not use views that depend on the current date or time and instead create a set returning function that takes the time as a parameter. Would such a function have similar performance characteristics to an equivalent view?

Cheers,
Andy

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

Предыдущее
От: Sachin Srivastava
Дата:
Сообщение: Memory Utilization Issue
Следующее
От: Sameer Thakur
Дата:
Сообщение: Re: Optimizing a read-only database