tinyint and type problems - Mailing list pgsql-hackers

From Shachar Shemesh
Subject tinyint and type problems
Date
Msg-id 4056271E.3010109@shemesh.biz
Whole thread Raw
Responses Re: tinyint and type problems  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Hi all,

I have sent a patch to implement tinyint, an unsigned one byte integer, 
for MS SQL compatibility. The replies I got were under two categories. 
One was "our type system is complicated enough", and the other was "it 
should be signed and we should have a general "unsigned" keyword.

Now, I'm not against neither simplifying the type system nor having a 
"unsigned" keyword. The thing is that between these two remarks, my 
patch was not applied and I don't know why.

I need this new type because the OLE DB provider I'm writing (for a 
client) works in binary mode by-definition, which means that the 
client's software, currently designed to work with MS SQL, relies on 
certain table entries to be one byte wide. Tricks such as using "char" 
don't work, as it uses "insert ... from select... ", which fails because 
the numbers are not translateable to "char". It also does explicit 
"insert", which also will not work with "char".

I would really love to know what needs to be done in order to get a one 
byte type, either signed or not (not really important at this stage) 
into postgres.

If this is impossible, would it be at least possible to reserve an OID 
for this type, and decide what it actually is later? If that would be 
possible, I can go on, in the mean time, with my development. The 
problem is that pglib really has no way of identifying the types except 
by OID.
            Shachar

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



pgsql-hackers by date:

Previous
From: Marty Scholes
Date:
Subject: Re: WAL write of full pages
Next
From: Tom Lane
Date:
Subject: Re: listening addresses