| От | Jim Nasby |
|---|---|
| Тема | Re: to_timestamp alternatives |
| Дата | |
| Msg-id | 568C7A5D.1050605@BlueTreble.com обсуждение исходный текст |
| Ответ на | Re: to_timestamp alternatives (Thomas Kellerer <spam_eater@gmx.net>) |
| Список | pgsql-general |
On 1/1/16 4:11 AM, Thomas Kellerer wrote: > You only need to provide the text value to be casted (no format mask). > Use only a single expression without those unnecessary parentheses: > > SELECT gmt_date||' '||lpad(gmt_time,8,'0')::timestamp > > You don't need the lpad() either: > > SELECT gmt_date||' '||gmt_time::timestamp I suspect you need to wrap that in (). Even if the parser does the right thing there, it'd certainly make the intent a lot clearer. SELECT (gmt_date || ' ' || gmt_time)::timestamp -- Jim Nasby, Data Architect, Blue Treble Consulting, Austin TX Experts in Analytics, Data Architecture and PostgreSQL Data in Trouble? Get it in Treble! http://BlueTreble.com
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера