pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
varbit question
3+ messages / 2 participants
[nested] [flat]

* varbit question
@ 2001-05-15 14:31 Laurent Duperval <lduperval@microcelli5.com>
  2001-05-15 15:41 ` Re: varbit question Peter Eisentraut <peter_e@gmx.net>
  0 siblings, 1 reply; 3+ messages in thread

From: Laurent Duperval @ 2001-05-15 14:31 UTC (permalink / raw)
  To: pgsql-sql

Hi,

I thought I posted this but I don't see it on the server so let's try
again:

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?

Also, will ResultSet.getBytes() (I'm talking Java here) return an array
of bytes with a field defined as varbit? How large will the field be?

Thanks,

L


-- 
Laurent Duperval <mailto:lduperval@microcelli5.com>

Voisin, vous seriez une vraie lumière... si on avait ouvert l'interrupteur.
                                                 -Lefuneste



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: varbit question
  2001-05-15 14:31 varbit question Laurent Duperval <lduperval@microcelli5.com>
@ 2001-05-15 15:41 ` Peter Eisentraut <peter_e@gmx.net>
  2001-05-15 15:47   ` Re: varbit question Laurent Duperval <lduperval@microcelli5.com>
  0 siblings, 1 reply; 3+ messages in thread

From: Peter Eisentraut @ 2001-05-15 15:41 UTC (permalink / raw)
  To: Laurent Duperval <lduperval@microcelli5.com>; +Cc: pgsql-sql

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.

-- 
Peter Eisentraut   peter_e@gmx.net   http://funkturm.homeip.net/~peter




^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: varbit question
  2001-05-15 14:31 varbit question Laurent Duperval <lduperval@microcelli5.com>
  2001-05-15 15:41 ` Re: varbit question Peter Eisentraut <peter_e@gmx.net>
@ 2001-05-15 15:47   ` Laurent Duperval <lduperval@microcelli5.com>
  0 siblings, 0 replies; 3+ messages in thread

From: Laurent Duperval @ 2001-05-15 15:47 UTC (permalink / raw)
  To: peter_e@gmx.net; +Cc: pgsql-sql

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 <mailto:lduperval@microcelli5.com>

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





^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2001-05-15 15:47 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2001-05-15 14:31 varbit question Laurent Duperval <lduperval@microcelli5.com>
2001-05-15 15:41 ` Peter Eisentraut <peter_e@gmx.net>
2001-05-15 15:47   ` Laurent Duperval <lduperval@microcelli5.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox