Skip site navigation (1) Skip section navigation (2)

Re: Bytea binary compatible

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: PostgreSQL-patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: Bytea binary compatible
Date: 2001-06-24 03:12:41
Message-ID: 200106240312.f5O3Cf225622@candle.pha.pa.us (view raw or flat)
Thread:
Lists: pgsql-patches
> Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
> > OK, code backed out.  If the storage formats are the same, doesn't that
> > make them binary compatibile.
> 
> No, because one allows nulls and the other doesn't.  If you disregard
> what are legal values and what aren't, then every pair of varlena
> datatypes we have could be called "binary compatible".
> 
> More to the point, though, why *should* they be marked binary
> compatible?  I saw no compelling reason advanced for it, and I can see a
> couple of compelling reasons not to.  Every binary-compatible pairing is
> another hole in our type system, another opportunity for unexpected
> behavior.  We shouldn't add them on whims.  Especially we shouldn't add
> them for datatypes that aren't even of the same family.  bytea isn't for
> storage of textual data, and so it makes little sense to allow
> application of textual operations to it.

I have no idea why the user wanted it.  I suppose it was so he could
pass text/varchar to bytea and back again.  Seems he has to convert it,
which makes sense about the NULLs.

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman(at)candle(dot)pha(dot)pa(dot)us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026

In response to

pgsql-patches by date

Next:From: Bruce MomjianDate: 2001-06-24 21:00:04
Subject: Re: Bytea binary compatible
Previous:From: Tom LaneDate: 2001-06-24 03:10:48
Subject: Re: Bytea binary compatible

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group