Re: Bytea as C string in pg_convert? - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Bytea as C string in pg_convert?
Date
Msg-id 14238.1190647031@sss.pgh.pa.us
Whole thread Raw
In response to Re: Bytea as C string in pg_convert?  (Andrew Dunstan <andrew@dunslane.net>)
Responses Re: Bytea as C string in pg_convert?
List pgsql-hackers
Andrew Dunstan <andrew@dunslane.net> writes:
> I have changed it. The thing is, though, that this function not only 
> performs the convert() function but acts as the engine for convert_to() 
> and convert_from(). Those functions do some silent transformations, in 
> one case passing a text Datum as the first argument and in the other 
> case the returning the result as text. If there's a better way to do 
> this I'll be happy to learn, but it seems to me it would involve some 
> duplication - I tried to avoid that where possible.

Hmm.  One suggestion would be to have an internal function declared
as taking and returning "struct varlena *", with a comment saying that
we depend on text and bytea both being compatible with this.  All three
SQL-visible functions are then thin wrappers around that.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Andrew Dunstan
Date:
Subject: Re: Bytea as C string in pg_convert?
Next
From: Alvaro Herrera
Date:
Subject: Re: [COMMITTERS] pgsql: Reduce the size of memoryallocations by lazy vacuum when