From: Tom Lane <tgl@sss.pgh.pa.us>
To: Gary Doades <gpd@cwcom.net>
Cc: pgsql-odbc@postgresql.org
Subject: Re: ODBC int2 parameters to pg function
Date: Sat, 13 Mar 2004 19:40:14 -0500
Message-ID: <8315.1079224814@sss.pgh.pa.us> (raw)
In-Reply-To: <08eu40du2j0hjmc1k36a3k5m73moqm34n9@4ax.com>
References: <08eu40du2j0hjmc1k36a3k5m73moqm34n9@4ax.com>
Gary Doades <gpd@cwcom.net> 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
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-odbc@postgresql.org
Cc: tgl@sss.pgh.pa.us, gpd@cwcom.net
Subject: Re: ODBC int2 parameters to pg function
In-Reply-To: <8315.1079224814@sss.pgh.pa.us>
References: <08eu40du2j0hjmc1k36a3k5m73moqm34n9@4ax.com> <8315.1079224814@sss.pgh.pa.us>
* 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