Re: Setting expire date on insert/modify

Поиск
Список
Период
Сортировка
От Michael Glaesemann
Тема Re: Setting expire date on insert/modify
Дата
Msg-id 780F3D40-B0FE-4BB1-94E0-9A1A11D9AC99@myrealbox.com
обсуждение исходный текст
Ответ на Re: Setting expire date on insert/modify  ("Foster, Stephen" <stephenlfoster@comcast.net>)
Список pgsql-general
On Jan 25, 2006, at 10:12 , Foster, Stephen wrote:

> If I try to save without which was what I did in the first place I
> receive this using "ExpireDate := (date StartDate + integer
> NumOfDays);"
>
> ERROR:  syntax error at or near "$1" at character 16
> QUERY:  SELECT  (date  $1  + integer  $2 )
> CONTEXT:  SQL statement in PL/PgSQL function "TF_BannerAd_Ads_InsMod"
> near line 8

The  common ways of casting in PostgreSQL are some_value::some_type,
e.g., "ExpireDate"::date, or using CAST, e.g., CAST ("ExpireDate" as
date). In the general case, some_type some_value will not work.

The docs can also be very helpful. I myself just looked up the syntax
of the CAST expression (I generally use the double-colon method).

See if that makes a difference.

Michael Glaesemann
grzm myrealbox com




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

Предыдущее
От: Benjamin Smith
Дата:
Сообщение: Postgresql Segfault in 8.1
Следующее
От: Stephan Szabo
Дата:
Сообщение: Re: Setting expire date on insert/modify