Re: Changing a column's type

From: Hadley Willan <hadley(dot)willan(at)deeper(dot)co(dot)nz>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Postgresql General <pgsql-general(at)postgresql(dot)org>
Subject: Re: Changing a column's type
Date: 2002-12-17 00:04:06
Message-ID: 1040083446.2931.28.camel@orac
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Sorry perhaps I wasn't clear.

FUNCTION fn_create_new_item()
_seq RECORD;
begin
SELECT INTO _seq NEXTVAL(''source_sequence'');
..do stuff, insert ....
PERFORM fn_b( _seq.next_value );
end;

FUNCTION fn_do_stuff_with_new_item_id( INT )
.....

Call to fn_b breaks because _seq.next_value is of type BIGINT.

On Tue, 2002-12-17 at 12:59, Tom Lane wrote:
> Hadley Willan <hadley(dot)willan(at)deeper(dot)co(dot)nz> writes:
> > Reason being is that the column type for the sequence values is now
> > bigInt and of course I foolishly have a number of functions defined as
> > taking an INT.
>
> I don't follow. You're executing functions on the columns of a sequence
> object? Why?
>
> regards, tom lane
--
Hadley Willan > Systems Development > Deeper Design Limited. +64(7)377-3328
hadley(dot)willan(at)deeper(dot)co(dot)nz > www.deeperdesign.com > +64(21)-28-41-463
Level 1, 4 Tamamutu St, PO Box 90, TAUPO 2730, New Zealand.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Jakub Ouhrabka 2002-12-17 00:12:22 Re: working around setQuerySnapshot limitations in functions
Previous Message Tom Lane 2002-12-16 23:59:50 Re: Changing a column's type