Received: from roentgen.microcelli5.com (roentgen.microcelli5.com [207.96.224.28]) by postgresql.org (8.11.3/8.11.1) with ESMTP id f4FFmbA65511 for ; Tue, 15 May 2001 11:48:37 -0400 (EDT) (envelope-from lduperval@microcelli5.com) Received: from lenard.microcelli5.com (lenard.microcelli5.com [10.0.1.25]) by roentgen.microcelli5.com (SMTP_Gateway) with ESMTP id 94F54302C03 for ; Tue, 15 May 2001 11:48:32 -0400 (EDT) Received: from fendi.ad.microcelli5.com (fendi.ad.microcelli5.com [10.0.10.5]) by lenard.microcelli5.com (SMTP_Gateway) with SMTP id 67F7846891 for ; Tue, 15 May 2001 11:48:32 -0400 (EDT) Received: FROM dci5exch.ad.microcelli5.com BY fendi.ad.microcelli5.com ; Tue May 15 11:50:14 2001 -0400 Received: from microcelli5.com (10.0.11.92 [10.0.11.92]) by dci5exch.ad.microcelli5.com with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2653.13) id KK0LTVT2; Tue, 15 May 2001 11:48:30 -0400 Date: Tue, 15 May 2001 11:47:59 -0400 (EDT) From: Laurent Duperval Subject: Re: varbit question To: peter_e@gmx.net Cc: pgsql-sql@postgresql.org In-Reply-To: MIME-Version: 1.0 Content-Type: TEXT/plain; charset=iso-8859-1 Message-Id: <20010515154832.67F7846891@lenard.microcelli5.com> Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from QUOTED-PRINTABLE to 8bit by postgresql.org id f4FFmbA65512 X-Archive-Number: 200105/150 X-Sequence-Number: 2967 On 15 May, Peter Eisentraut wrote: > Laurent Duperval writes: > >> I have an Oracle script that I want to convert to pgsql. I've got a sed >> script that does most of the mappings but it doesn't look like raw is >> supported. In the docs, there is mention of varbit(n) but if I use the >> (n) argument, the script fails. I can only use varbit alone. How do I get >> around that? > > If you're not using version 7.1 or later you might want to upgrade. The > bit string types do not work correctly in earlier releases. If you are > using that version, please post more detail. > Turns out it's a bug in the docs, I think. The table of all data types mentions the following: Type Name Aliases Description bit fixed-length bit string bit varying(n) varbit(n) variable-length bit string but if you read a bit further in the Bit string types section, it says: There are two SQL bit types: BIT(x) and BIT VARYING(x); the x specifies the maximum length. BIT type data is automatically padded with 0's on the right to the maximum length, BIT VARYING is of variable length. BIT without length is equivalent to BIT(1), BIT VARYING means unlimited length No mention of varbit(n) and the table doesn't say that bit(n) is acceptable. So I fixed my script according to this and it works ok now. L -- Laurent Duperval Au lieu de tenir des propos teintés de paresse mélangée de fainéantise de couleur assortie, introduisez une plaque de métal dans l'appareil. -Léonard le génie