pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Glaesemann <grzm@seespotcode.net>
To: Ranieri Mazili <ranieri.oliveira@terra.com.br>
Cc: pgsql-general@postgresql.org
Cc: pgsql-sql@postgresql.org
Subject: Re: [SQL] Setting variable
Date: Mon, 18 Jun 2007 09:43:55 -0500
Message-ID: <0AF9CCEA-787E-42F3-8EFB-3CCF684A3D70@seespotcode.net> (raw)
In-Reply-To: <467696D7.2090703@terra.com.br>
References: <467696D7.2090703@terra.com.br>


On Jun 18, 2007, at 9:29 , Ranieri Mazili wrote:

> CREATE OR REPLACE FUNCTION lost_hours_temp(date)
> RETURNS text AS
> $BODY$
> DECLARE
>    START_DATE date;
>    END_DATE date;
>    QUERY text;
> BEGIN
>    START_DATE := $1;
>    END_DATE := START_DATE - interval '3 year';
>
> The last line (END_DATE := START_DATE - interval '3 year';)  
> generate the following error:
>
> ERROR: operator is not unique: "unknown" / "unknown"
> SQL state: 42725
> Hint: Could not choose a best candidate operator. You may need to  
> add explicit type casts.
> Context: PL/pgSQL function "lost_hours_temp" line 10 at assignment

Note that the error is at line 10. You've only shown lines 1 through  
7 of the function body, so you haven't actually shown us where the  
error is.

Michael Glaesemann
grzm seespotcode net





view thread (2+ messages)

Message-ID: <0AF9CCEA-787E-42F3-8EFB-3CCF684A3D70@seespotcode.net>
Permalink:  ../0AF9CCEA-787E-42F3-8EFB-3CCF684A3D70@seespotcode.net/
Also on:    postgresql.org/message-id/0AF9CCEA-787E-42F3-8EFB-3CCF684A3D70@seespotcode.net

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: grzm@seespotcode.net, ranieri.oliveira@terra.com.br, pgsql-general@postgresql.org
  Subject: Re: [SQL] Setting variable
  In-Reply-To: <0AF9CCEA-787E-42F3-8EFB-3CCF684A3D70@seespotcode.net>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox