Re: bytea internal encoding

From: Michael Fuhr <mike(at)fuhr(dot)org>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: bytea internal encoding
Date: 2004-12-16 05:22:07
Message-ID: 20041216052207.GA43275@winnie.fuhr.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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/

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Michael Fuhr 2004-12-16 05:37:19 Re: Aggregates not allowed in WHERE clause?
Previous Message Tom Lane 2004-12-16 05:17:49 Re: Aggregates not allowed in WHERE clause?