X-Original-To: pgsql-odbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id D1547D1B989 for ; Sun, 14 Mar 2004 00:40:30 +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 02368-09 for ; Sat, 13 Mar 2004 20:40:32 -0400 (AST) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by svr1.postgresql.org (Postfix) with ESMTP id A8460D1E155 for ; Sat, 13 Mar 2004 20:40:28 -0400 (AST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.12.11/8.12.11) with ESMTP id i2E0eFQg008316; Sat, 13 Mar 2004 19:40:15 -0500 (EST) To: Gary Doades Cc: pgsql-odbc@postgresql.org Subject: Re: ODBC int2 parameters to pg function In-reply-to: <08eu40du2j0hjmc1k36a3k5m73moqm34n9@4ax.com> References: <08eu40du2j0hjmc1k36a3k5m73moqm34n9@4ax.com> Comments: In-reply-to Gary Doades message dated "Wed, 10 Mar 2004 16:00:18 +0000" Date: Sat, 13 Mar 2004 19:40:14 -0500 Message-ID: <8315.1079224814@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200403/49 X-Sequence-Number: 3851 Gary Doades writes: > I have delcared a pg function as: > function GENERATE_TIMESHEETS(timestamp,timestamp,smallint,smallint) > .... You're probably best off to declare the inputs as integer not smallint. Integer literals are assumed to be int4 by default, and since there's no implicit downcast to int2 (anymore), writing a function this way will require you to cast to smallint explicitly a lot. It's seldom worth that notational hassle. You can cast inside the function if you really need the values to be int2 inside it. regards, tom lane