Skip site navigation (1) Skip section navigation (2)

c type of int8 / serial8?

From: "Joost Kraaijeveld" <J(dot)Kraaijeveld(at)Askesis(dot)nl>
To: <pgsql-odbc(at)postgresql(dot)org>
Subject: c type of int8 / serial8?
Date: 2008-08-10 17:11:14
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-odbc

I wonder what the C type of int8 / serial8 is.

If I use SQLGetTypeInfo() to get all the supported type is says that
int8 is of SQL type SQL_BIGINT. It does not show any values for serial8
but I suppose that that is a user defined type and the driver is not
required to show those (is that correct?). 

If I use SQLColumns() and get the data type from that function, is says
for both int8 and serial8 that the SQL type is SQL_BIGINT. There is
however not mapping for SQL_BIGINT to a C type. There is a mapping to a
signed or unsigned 8 byte integer (SQL_C_SBIGINT or SQL_C_UBIGINT).

>From the docs
( , table
8.1)  I see that int8 is a "signed eight-byte integer". For serial8 it
only says "autoincrementing eight-byte integer". So I assume that int8
is actually SQL_C_SBIGINT, but I am unsure about serial8: is it signed
or unsigned?

Shouldn't both SQLGetTypeInfo and SQLColumns return SQL_C_SBIGINT for
int8, and/or return SQL_C_SBIGINT/SQL_C_UBIGINT for serial8,. depending
on the signed-ness?



Joost Kraaijeveld
Askesis B.V.
Molukkenstraat 14
6524NB Nijmegen
tel: 024-3888063 / 06-51855277
fax: 024-3608416


pgsql-odbc by date

Next:From: Joost KraaijeveldDate: 2008-08-11 06:18:50
Subject: time with time zone sql type?
Previous:From: Hiroshi InoueDate: 2008-08-09 00:41:31
Subject: Re: Should/does SQLForeignKeys work (8.03.02)?

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group