Re: [PATCHES] Text <-> C string - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [PATCHES] Text <-> C string
Date
Msg-id 1139.1206485284@sss.pgh.pa.us
Whole thread Raw
In response to Re: Text <-> C string  ("Brendan Jurd" <direvus@gmail.com>)
Responses Re: [PATCHES] Text <-> C string  ("Brendan Jurd" <direvus@gmail.com>)
List pgsql-hackers
"Brendan Jurd" <direvus@gmail.com> writes:
> As discussed on -hackers, I'm trying to get rid of some redundant code
> by creating a widely useful set of functions to convert between text
> and C string in the backend.

Applied with revisions --- the functions were modified as per recent
discussion, and I fixed a lot more potential call sites.

There are no textout/textin calls left, but I may have missed some
places that were doing it the hard way with direct palloc/memcpy
manipulations.  It might be worth trolling all the VARDATA() references
to see if any more are easily replaceable.

I notice in particular that xfunc.sgml contains sample C functions to
copy and concatenate text.  While these aren't directly replaceable
with the new functions, I wonder whether we ought to change the examples
to make them less certain to break if we ever change text's
representation.

            regards, tom lane

pgsql-hackers by date:

Previous
From: Neil Conway
Date:
Subject: Re: advancing snapshot's xmin
Next
From: "Heikki Linnakangas"
Date:
Subject: Re: advancing snapshot's xmin