Skip site navigation (1) Skip section navigation (2)

Peripheral Links

Header And Logo

PostgreSQL
| The world's most advanced open source database.

Site Navigation

Search for
  Advanced Search

Re: FW: Re: Part 1 of several - Converting a varchar to an interval



On Wed, Mar 26, 2008 at 5:45 PM, Shawn <postgres(at)xmtservices(dot)net> wrote:
>  obviously it doesn't like the extra single quotes around the 1 msec.  Any
>  suggestions for a work around?

Use dollar quoting, e.g.:

create or replace function dur_interval_msec(int) returns interval
as
$$
select ($1 * interval '1 msec');
$$
language sql
immutable
returns null on null input;



Home | Main Index | Thread Index

Privacy Policy | PostgreSQL Archives hosted by Command Prompt, Inc. | Designed by tinysofa
Copyright © 1996 – 2008 PostgreSQL Global Development Group