Re: text and bytea - Mailing list pgsql-general

From Gregory Stark
Subject Re: text and bytea
Date
Msg-id 87mypp3wet.fsf@oxford.xeocode.com
Whole thread Raw
In response to Re: text and bytea  ("hernan gonzalez" <hgonzalez@gmail.com>)
Responses Re: text and bytea
List pgsql-general
"hernan gonzalez" <hgonzalez@gmail.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!

pgsql-general by date:

Previous
From: "Obe, Regina"
Date:
Subject: HOW does 8.3 CREATE REPLACe .. FUNCTION ..COST work
Next
From: Tom Lane
Date:
Subject: Re: Planner: rows=1 after "similar to" where condition.