one byte data type

Started by Shachar Shemeshalmost 22 years ago3 messages
#1Shachar Shemesh
psql@shemesh.biz

Hi gang,

Is there a datatype that means "one byte"? I'm importing a database from
SQL Server, and some of the rows there are of this type. When I convert
them to int2, I have discrepancies with the program that uses the
database (OLE DB uses binary mode transfers, so the size of the variable
is important beyond it's legal range).

Shachar

--
Shachar Shemesh
Lingnu Open Systems Consulting
http://www.lingnu.com/

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Shachar Shemesh (#1)
Re: one byte data type

Shachar Shemesh <psql@shemesh.biz> writes:

Is there a datatype that means "one byte"?

You might be able to use the "char" type (note the quotes). I am not
sure how well it will cope with storing zeroes (nulls) though.

regards, tom lane

#3Shachar Shemesh
psql@shemesh.biz
In reply to: Tom Lane (#2)
Re: one byte data type

Tom Lane wrote:

Shachar Shemesh <psql@shemesh.biz> writes:

Is there a datatype that means "one byte"?

You might be able to use the "char" type (note the quotes). I am not
sure how well it will cope with storing zeroes (nulls) though.

regards, tom lane

Hmm, this will also screw up textual queries. Not important for this
particular case, but not a good general solution. What are the chances
of adding such a type for 7.4.2?

Shachar
P.S.
Notice how this message arrives directly as well, despite spam filters.

--
Shachar Shemesh
Lingnu Open Systems Consulting
http://www.lingnu.com/