X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 717CAD1B562 for ; Tue, 21 Oct 2003 13:56:26 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 72729-02 for ; Tue, 21 Oct 2003 10:55:59 -0300 (ADT) Received: from bal_proxy00.BAL (mail.bal.bmlf.gv.at [193.170.250.86]) by svr1.postgresql.org (Postfix) with ESMTP id C5CD6D1B554 for ; Tue, 21 Oct 2003 10:55:27 -0300 (ADT) Received: by BAL_PROXY00 with Internet Mail Service (5.5.2653.19) id ; Tue, 21 Oct 2003 15:58:21 +0200 Message-ID: <40925A3BA1EBD711A35C000102B6E57D06C9A7@BAL_PROXY00> From: Wilhelm Graiss To: "'pgsql-sql@postgresql.org'" Subject: plpgsql related question: intervals and variables Date: Tue, 21 Oct 2003 15:58:20 +0200 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2653.19) Content-Type: text/plain; charset="iso-8859-1" X-Virus-Scanned: by amavisd-new at postgresql.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200310/268 X-Sequence-Number: 15668 Hello out there, We have a problem in plpgsql: We want to add variable periods (result of a query) to a timestamp. Our Code looks like this: Begin heute := ''today''; Select Into vk ourcolumn From table where other = foo; If vk > 0 Then vk_txt := ''Vorkuehlung notwendig''; ez := heute + interval ''vk days''; Else vk_txt := ''Keine Vorkuehlung vorgeschrieben''; End if; We get the following: ERROR: Bad interval external representation 'vk days' The variable 'heute' is declared as timestamp, 'vk' as integer! What have we done wrong?? :( Thanks in advance, Willi, Albin -- ============================= Wilhelm Graiss Altirdning 12 8952 Irdning 03682/22451/267