Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 9ACFA2E008E for ; Wed, 26 Mar 2008 20:12:11 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 54526-02 for ; Wed, 26 Mar 2008 20:12:09 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.5 Received: from wx-out-0506.google.com (wx-out-0506.google.com [66.249.82.238]) by postgresql.org (Postfix) with ESMTP id 37DBF2E006B for ; Wed, 26 Mar 2008 20:12:09 -0300 (ADT) Received: by wx-out-0506.google.com with SMTP id r21so3777465wxc.28 for ; Wed, 26 Mar 2008 16:12:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=tFYLgnrUZbDB5rkxzfucqSTerlT+p1FAxkhDntPDXFA=; b=m4ulG9Ha1oqn3o5MWciaolX8/Wqge/lRN9lzh6Mmjs+oPL8fhHRwlyjGB5NK1IP5rCL/qSOuQJkcKGOkyK5kGdxY8hKuwi+YelsNlMK6iZVRr/Ix6vvEhrrlGtBa0rmgpLwJHGMtisgyof0p9rq/VBSZBt2+jyiW/mUH5KB/SiE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=KaJKA43Wk72jImuO2Aa64ImfYoS3AhLy/jSvMULuaqCFs5VdzC9IWwEF+vphZ5lMSlZ+lIKkjm9T9AljW2wFJc2iOR90mubqP7gCLv5INOQ2lr3l02EsRYU4/ed5VgSqlucTxNMHIr6M3G5fk5yRdachrbwv9PTxG8nD9zuzbko= Received: by 10.100.110.16 with SMTP id i16mr1354267anc.40.1206573127864; Wed, 26 Mar 2008 16:12:07 -0700 (PDT) Received: by 10.100.122.9 with HTTP; Wed, 26 Mar 2008 16:12:07 -0700 (PDT) Message-ID: Date: Wed, 26 Mar 2008 18:12:07 -0500 From: "=?UTF-8?Q?Rodrigo_E._De_Le=C3=B3n_Plicet?=" To: Shawn Subject: Re: FW: Re: Part 1 of several - Converting a varchar to an interval Cc: pgsql-sql@postgresql.org In-Reply-To: <200803262245.53968.postgres@xmtservices.net> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <032620081632.25756.47EA7AA200070FAB0000649C22007374789D0A900E04050E@comcast.net> <29426.1206551668@sss.pgh.pa.us> <200803262245.53968.postgres@xmtservices.net> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200803/188 X-Sequence-Number: 30516 On Wed, Mar 26, 2008 at 5:45 PM, Shawn 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;