tinyint and type problems

From: Shachar Shemesh <psql(at)shemesh(dot)biz>
To: Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: tinyint and type problems
Date: 2004-03-15 21:58:54
Message-ID: 4056271E.3010109@shemesh.biz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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/

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2004-03-15 22:13:34 Re: listening addresses
Previous Message Marty Scholes 2004-03-15 21:55:02 Re: WAL write of full pages