Re: ODBC int2 parameters to pg function - Mailing list pgsql-odbc

From Tom Lane
Subject Re: ODBC int2 parameters to pg function
Date
Msg-id 8315.1079224814@sss.pgh.pa.us
Whole thread Raw
In response to ODBC int2 parameters to pg function  (Gary Doades <gpd@cwcom.net>)
Responses Re: ODBC int2 parameters to pg function
List pgsql-odbc
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

pgsql-odbc by date:

Previous
From: "David P. Lurie"
Date:
Subject: Access 2002 and psqlodbc 7.03.02
Next
From: Shachar Shemesh
Date:
Subject: Re: ERROR: column "ctid" does not exist