Re: plpgsql and escape

Поиск
Список
Период
Сортировка
От Richard Huxton
Тема Re: plpgsql and escape
Дата
Msg-id 200210211659.47154.dev@archonet.com
обсуждение исходный текст
Ответ на plpgsql and escape  (darthxiong@libero.it)
Список pgsql-general
On Monday 21 Oct 2002 3:00 pm, darthxiong@libero.it wrote:
> hi all!
> i'm trying to do this ( converting unix time to human readable time in
> another table )
>
> create function align_vs() returns opaque as
> '
>         declare
>                 line_vs vs%ROWTYPE;
>                 itime vs.step_time%TYPE;
>         begin
>
>         itime := to_char( timestamp ''epoch'' + interval ''NEW.step_time
> seconds'', ''YYYY-MM-DD HH24:MI:SS'' ); update vs set w_id = NEW.w_id,

> the double ' around NEW.step_time blocks its interpolation. which is the
> correct escaping sintax here?

Try (NEW.step_time || '' seconds'') - that should do it. If not, try casting
step_time to text first.

--
  Richard Huxton

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

Предыдущее
От: Richard Huxton
Дата:
Сообщение: Re: Security implications of (plpgsql) functions
Следующее
От: Jeffrey Bohmer
Дата:
Сообщение: Re: Buffers and MacOS X