Re: text and bytea

From: Gregory Stark <stark(at)enterprisedb(dot)com>
To: "hernan gonzalez" <hgonzalez(at)gmail(dot)com>
Cc: <pgsql-general(at)postgresql(dot)org>
Subject: Re: text and bytea
Date: 2008-02-25 15:09:30
Message-ID: 87mypp3wet.fsf@oxford.xeocode.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

"hernan gonzalez" <hgonzalez(at)gmail(dot)com> writes:

> IMHO, the semantics of encode() and decode() are correct (the bridge
> between bytea and text ... in the backend encoding; they should be the
> only bridge), convert() is also ok (deals with bytes), but
> convert_to() and convert_from() are dubious if not broken: they imply
> texts in arbitrary encodings (for output or input) , lead to
> anomalities and shouldnt be necessary at all.

postgres=# \df convert_from
List of functions
Schema | Name | Result data type | Argument data types
------------+--------------+------------------+---------------------
pg_catalog | convert_from | text | bytea, name
(1 row)

postgres=# \df convert_to
List of functions
Schema | Name | Result data type | Argument data types
------------+------------+------------------+---------------------
pg_catalog | convert_to | bytea | text, name
(1 row)

Looks like they produce and consume byteas to me.

--
Gregory Stark
EnterpriseDB http://www.enterprisedb.com
Ask me about EnterpriseDB's RemoteDBA services!

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2008-02-25 15:33:57 Re: Planner: rows=1 after "similar to" where condition.
Previous Message Obe, Regina 2008-02-25 14:43:19 HOW does 8.3 CREATE REPLACe .. FUNCTION ..COST work