Re: C function accepting/returning cstring vs. text - Mailing list pgsql-hackers

From Greg Smith
Subject Re: C function accepting/returning cstring vs. text
Date
Msg-id 4B606CD3.8060007@2ndquadrant.com
Whole thread Raw
In response to Re: C function accepting/returning cstring vs. text  (Ivan Sergio Borgonovo <mail@webthatworks.it>)
List pgsql-hackers
Ivan Sergio Borgonovo wrote:
> Is there a book?
>   

You'll find a basic intro to this area in "PostgreSQL Developer's 
Handbook" by Geschwinde and Schonig.  You're already past the level of 
questions they answer in there though.  This whole cstring/text issue 
you're asking about, I figured out by reading the source code, 
deciphering the examples in the talk at 
http://www.joeconway.com/presentations/tut_oscon_2004.pdf , and then 
using interesting keywords there ("DatumGetCString" is a good one to 
find interesting places in the code) to find code examples and messages 
on that topic in the list archives.  Finally, finding some 
commits/patches that do things similar to what you want, and dissecting 
how they work, is quite informative too.

I agree the learning curve could be a shortened a lot, and have actually 
submitted a conference talk proposal in this area to try and improve 
that.  You're a few months ahead of me having something written down to 
share though.

-- 
Greg Smith    2ndQuadrant   Baltimore, MD
PostgreSQL Training, Services and Support
greg@2ndQuadrant.com  www.2ndQuadrant.com



pgsql-hackers by date:

Previous
From: Tim Bunce
Date:
Subject: Re: Add on_perl_init and proper destruction to plperl [PATCH]
Next
From: Andrew Dunstan
Date:
Subject: Re: Add on_perl_init and proper destruction to plperl [PATCH]