Re: PG_RETURN_?

From: Richard Huxton <dev(at)archonet(dot)com>
To: Don Y <pgsql(at)DakotaCom(dot)Net>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: PG_RETURN_?
Date: 2006-05-02 08:16:04
Message-ID: 44571544.1070205@archonet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Don Y wrote:
> Hi,
>
> I have a set of functions for a data type that return
> small integers (i.e. [0..12]). I can, of course, represent
> it as a char, short or long (CHAR, INT16 or INT32).
> re there any advantages/drawbacks to chosing one particular
> PG_RETURN_ type over another (realizing that they are
> effectively just casts)?

If they are integers then an int would be the obvious choice. If you are
going to treat them as int2 outside the function then int2, otherwise
just integer. Oh, it's int2/int4 not int16/int32.
--
Richard Huxton
Archonet Ltd

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Richard Huxton 2006-05-02 08:18:30 Re: How to join to delete
Previous Message Tom Lane 2006-05-02 07:23:51 Re: Return value (instead of reference) for user defined type