Re: bytea internal encoding - Mailing list pgsql-general

From Michael Fuhr
Subject Re: bytea internal encoding
Date
Msg-id 20041216052207.GA43275@winnie.fuhr.org
Whole thread Raw
In response to bytea internal encoding  (Ron Peterson <rpeterso@mtholyoke.edu>)
Responses Re: bytea internal encoding  (Ron Peterson <rpeterso@mtholyoke.edu>)
List pgsql-general
On Wed, Dec 15, 2004 at 11:08:29PM -0500, Ron Peterson wrote:

> How are bytea values encoded internally?
>
> Or maybe a better question would be what is the proper way to access
> bytea data from within a C function?  Are there utility functions for
> reading the bytea data as a stream of scalar values, for example?

Do you mean a C function on the server side or on the client side?

For examples of server-side code, take a look at functions in the
PostgreSQL source that handle BYTEA, e.g., byteacat() in
src/backend/utils/adt/varlena.c.  See also the comments concerning
variable-length data and the relevant examples in the "C-Language
Functions" section of the "Extending SQL" chapter in the documentation.

--
Michael Fuhr
http://www.fuhr.org/~mfuhr/

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: Aggregates not allowed in WHERE clause?
Next
From: Michael Fuhr
Date:
Subject: Re: Aggregates not allowed in WHERE clause?