| От | Dan Harris |
|---|---|
| Тема | Function to offset current timestamp |
| Дата | |
| Msg-id | 46605886.1070404@drivefaster.net обсуждение исходный текст |
| Ответы |
Re: Function to offset current timestamp
Re: Function to offset current timestamp |
| Список | pgsql-admin |
I'm trying to write a function that can do a select on an integer value from a table and subtract that value from current_timestamp. Let's say I have a table called users and a field called tz_offset.. I want my function to do something like : select current_timestamp - '( select tz_offset from users where userid = ? ) hours'::interval Obviously this syntax is incorrect, but I'm not quite sure how to do the subquery and make the integer result of it part of the quoted interval expression. Any tips? Thx
В списке pgsql-admin по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера