Re: Analysis Function
От | Heikki Linnakangas |
---|---|
Тема | Re: Analysis Function |
Дата | |
Msg-id | 4C14746F.9050603@enterprisedb.com обсуждение исходный текст |
Ответ на | Re: Analysis Function (David Jarvis <thangalin@gmail.com>) |
Ответы |
Re: Analysis Function
Re: Analysis Function |
Список | pgsql-performance |
On 11/06/10 23:38, David Jarvis wrote: > I added an explicit cast in the SQL: > > dateserial(extract(YEAR FROM > m.taken)::int,'||p_month1||','||p_day1||') d1, > dateserial(extract(YEAR FROM > m.taken)::int,'||p_month2||','||p_day2||') d2 > > The function now takes three integer parameters; there was no performance > loss. We had a little chat about this with Magnus. It's pretty surprising that there's no built-in function to do this, we should consider adding one. We could have a function like: construct_timestamp(year int4, month int4, date int4, hour int4, minute int4, second int4, milliseconds int4, timezone text) Now that we have named parameter notation, callers can use it to conveniently fill in only the fields needed: SELECT construct_timestamp(year := 1999, month := 10, date := 22); -- Heikki Linnakangas EnterpriseDB http://www.enterprisedb.com
В списке pgsql-performance по дате отправления: