nextval result type difference between 7.1.3 and 7.2.1

Started by Jong-won Choiover 23 years ago2 messagesgeneral
Jump to latest
#1Jong-won Choi
jong-won.choi@memetrics.com

[Somehow my emails bounced back, I'm doing this using telnet with SMTP port!]
Hello,

I use PostgreSQL, UnixODBC, and Lisp configuration.

I call 'nextval' to get an ID on Lisp like:

(query "select nextval('UNIQUE_ID_SEQUENCE')")

With PostgreSQL 7.1.3 and UnixODBC 2.0.7 or 2.2.3 it returns an
integer(ex, 123), but with PostgreSQL 7.2.1, it returns a string(ex,
"123").

Any idea how to fix the problem?

Cheers,

- Jong-won Choi

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Jong-won Choi (#1)
Re: nextval result type difference between 7.1.3 and 7.2.1

Jong-won Choi <jong-won.choi@memetrics.com> writes:

I use PostgreSQL, UnixODBC, and Lisp configuration.
I call 'nextval' to get an ID on Lisp like:
(query "select nextval('UNIQUE_ID_SEQUENCE')")
With PostgreSQL 7.1.3 and UnixODBC 2.0.7 or 2.2.3 it returns an
integer(ex, 123), but with PostgreSQL 7.2.1, it returns a string(ex,
"123").

nextval returns bigint (int8) in 7.2 and later.

You can cast the result down to integer in your query, or you can
figure out why ODBC isn't coping ... I have a vague recollection
that this may be an ODBC configuration issue ...

regards, tom lane