On Tue, 21 Oct 2003, Josh Berkus wrote:
> > heute := ''today'';
> > Select Into vk ourcolumn From table where other = foo;
> > If vk > 0 Then
> > vk_txt := ''Vorkuehlung notwendig'';
> > ez := heute + interval ''vk days'';
>
> PL/pgSQL handles variable like SQL, not like PHP or Perl. You can't do a
> variable substitution inside quotes, and you need to cast:
>
> ez := heute + interval (cast(vk as text) || '' days'');
I think that something like
ez := heute + vk * interval '1 day';
might be better in general.