Re: ODBC int2 parameters to pg function

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Gary Doades <gpd(at)cwcom(dot)net>
Cc: pgsql-odbc(at)postgresql(dot)org
Subject: Re: ODBC int2 parameters to pg function
Date: 2004-03-14 00:40:14
Message-ID: 8315.1079224814@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-odbc

Gary Doades <gpd(at)cwcom(dot)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

In response to

Responses

Browse pgsql-odbc by date

  From Date Subject
Next Message Shachar Shemesh 2004-03-14 06:26:47 Re: ERROR: column "ctid" does not exist
Previous Message Jeff Eckermann 2004-03-13 16:09:46 Re: ERROR: column "ctid" does not exist