Received: from mail.postgresql.org (webmail.postgresql.org [216.126.85.28]) by mail.postgresql.org (8.11.1/8.11.1) with SMTP id f15IF4x46085 for ; Mon, 5 Feb 2001 13:15:04 -0500 (EST) (envelope-from pgsql-sql-owner@postgresql.org) Received: from mailin1.bigpond.com ([139.134.6.21]) by mail.postgresql.org (8.11.1/8.11.1) with ESMTP id f112pTq97045 for ; Wed, 31 Jan 2001 21:51:29 -0500 (EST) (envelope-from aa2@bigpond.net.au) Received: from bigpond.net.au ([139.134.4.55]) by mailin1.bigpond.com (Netscape Messaging Server 4.15) with SMTP id G825HA00.1QE; Thu, 1 Feb 2001 12:55:58 +1000 Received: from CPE-144-132-75-163.vic.bigpond.net.au ([144.132.75.163]) by mail4.bigpond.com (Claudes-Bigrnbetta-MailRouter V2.9c 7/4248234); 01 Feb 2001 12:51:14 Message-ID: <3A78CF0F.AD0F7A6F@bigpond.net.au> Date: Thu, 01 Feb 2001 13:50:55 +1100 From: Justin Clift X-Mailer: Mozilla 4.76 [en] (X11; U; Linux 2.2.17-21mdk i686) X-Accept-Language: en MIME-Version: 1.0 To: "pgsql-sql@postgresql.org" CC: Jan Wieck Subject: HELP: Scarey pl/pgsql problem References: <200101131404.JAA01424@jupiter.jw.home> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Archive-Number: 200102/56 X-Sequence-Number: 1226 Hi all, I'm having trouble with what MAY BE a bug in PL/PGSQL for PG 7.0.3 on Linux (Mandrake Linux 7.2). It appears pl/pgsql is munging values. When I pass it a 'time' value, the value is altered without my code touching it. This is evidenced by the stripped down function below : CREATE FUNCTION which_block(time) RETURNS time AS 'DECLARE /* Given a time, this function works out the name of the correct field in the reservations table for it * Written by : Justin Clift * Date : 1st February 2001 * Version : 1.00 */ hours char(3); minutes char(2); result char(5); tempres char(5); curnow datetime; BEGIN RETURN $1; END;' LANGUAGE 'plpgsql'; foobar=# select which_block(time '12:40:00'); which_block ------------- 12:39:00 (1 row) foobar=# Having passed it the time value of '12:40:00', I am immediately returning that value and it is no longer '12:40:00'. Being over 1 month into using PostgreSQL 7.0.3 for a particular project, this is scaring me as I'm now doubting the reliability of things. Regards and best wishes, Justin Clift Database Administrator