BIT/BIT VARYING names (was Re: [HACKERS] Beta for 4:30AST) - Mailing list pgsql-hackers

From Tom Lane
Subject BIT/BIT VARYING names (was Re: [HACKERS] Beta for 4:30AST)
Date
Msg-id 1213.951925927@sss.pgh.pa.us
Whole thread Raw
In response to Re: [HACKERS] Beta for 4:30AST ... ?  (Peter Eisentraut <e99re41@DoCS.UU.SE>)
Responses Re: BIT/BIT VARYING names (was Re: [HACKERS] Beta for 4:30AST)
List pgsql-hackers
Peter Eisentraut <e99re41@DoCS.UU.SE> writes:
> All I'm saying is that we add

>       | BIT VARYING { $$ = "bit varying"; }

> No problem so far, right? Especially, if this is dumped out, then it
> becomes bit varying without any extra effort.

Well, no, it becomes "bit varying", *with* quotes, if the dumper is
not broken.  (Unless we special-case the dumper to know that this
particular typename doesn't need to be quoted despite its embedded
space --- but that's what you hoped to avoid.)  So there's no automatic
way of producing a completely SQL-compliant dump for this type name,
and that removes what would otherwise be (IMHO) the strongest argument
for making the internal name be "bit varying" and not "varbit" or
whatever.

A much more significant problem for this particular datatype is that it
requires special syntax regardless, namely a length spec like the ones
for char and varchar:
        <bit string type> ::=               BIT [ <left paren> <length> <right paren> ]             | BIT VARYING <left
paren><length> <right paren>
 

Currently, char and numeric (the existing types that need length
specifications) have to be special-cased everywhere in order to
parse or append the length info.  I foresee the same will be needed
for bit and bit varying.  If you can find a way to avoid
that special-case logic, I'll get a lot more excited about not
having to treat "bit varying" as a special-case name.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Karel Zak - Zakkr
Date:
Subject: Re: [HACKERS] Re: [PATCHES] NO-CREATE-TABLE and NO-LOCK-TABLE
Next
From: Horák Daniel
Date:
Subject: PostgreSQL on Solaris/SPARC with gcc