(7.1) BIT datatype

From: "Oliver Elphick" <olly(at)lfix(dot)co(dot)uk>
To: pgsql-hackers(at)postgresql(dot)org
Subject: (7.1) BIT datatype
Date: 2000-12-21 21:33:51
Message-ID: 200012212133.eBLLXqP16512@linda.lfix.co.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Some SQL92 functionality is missing from the BIT and VARBIT types.

It should be possible to enter hexadecimal values as:

B'[<bit>...]'[{<separator>...'[<bit...]'}...]
X'[<hexdigit>...]'[{<separator>...'[<hexdigit...]'}...]

(Cannan and Otten: SQL - The Standard Handbook, p.38)

but the hexadeximal form is not accepted.

For example:

bray=# \d junk
Table "junk"
Attribute | Type | Modifier
-----------+--------------+----------
id | character(4) | not null
flag1 | bit(1) |
flags | bit(8) |
Index: junk_pkey

bray=# insert into junk values ('BBBB',B'0',X'FF');
ERROR: Attribute 'flags' is of type 'bit' but expression is of type 'int4'
You will need to rewrite or cast the expression

--
Oliver Elphick Oliver(dot)Elphick(at)lfix(dot)co(dot)uk
Isle of Wight http://www.lfix.co.uk/oliver
PGP: 1024R/32B8FAA1: 97 EA 1D 47 72 3F 28 47 6B 7E 39 CC 56 E4 C1 47
GPG: 1024D/3E1D0C1C: CA12 09E0 E8D5 8870 5839 932A 614D 4C34 3E1D 0C1C
========================================
"For a child will be born to us, a son will be given to
us; And the government will rest on His shoulders; And
His name will be called Wonderful Counsellor, Mighty
God, Eternal Father, Prince of Peace."
Isaiah 9:6

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2000-12-21 22:11:25 Re: (7.1) BIT datatype
Previous Message Hannu Krosing 2000-12-21 20:05:40 Re: Who is a maintainer of GiST code ?