Re: How to get CURRENT_DATE in a pl/pgSQL function
| От | Jasen Betts |
|---|---|
| Тема | Re: How to get CURRENT_DATE in a pl/pgSQL function |
| Дата | |
| Msg-id | ht0hs5$i3d$2@reversiblemaps.ath.cx обсуждение исходный текст |
| Ответ на | How to get CURRENT_DATE in a pl/pgSQL function (Kenneth Marshall <ktm@rice.edu>) |
| Список | pgsql-sql |
On 2010-05-18, Kenneth Marshall <ktm@rice.edu> wrote: > I am trying to write a function that updates the > date column to the current date. According to: > > http://www.postgresql.org/docs/8.4/static/functions-datetime.html#FUNCTIONS-DATETIME-CURRENT > > you can use CURRENT_DATE. When I try to use it in > the following pl/pgSQL function it gives the error: > > ERROR: date/time value "current" is no longer supported > CONTEXT: PL/pgSQL function "merge_data" line 4 at assignment > > Here is the code I am using: > > CREATE FUNCTION merge_data(key INT, i INT) RETURNS > VOID AS > $$ > DECLARE > curtime date; > BEGIN > curtime := 'CURRENT_DATE'; use one of CURRENT_DATE 'today' NOW() CURRENT_TIMESTAMP 'now' there are probably others which will work too.
В списке pgsql-sql по дате отправления: