Re: C function accepting/returning cstring vs. text

From: Greg Smith <greg(at)2ndquadrant(dot)com>
To: Ivan Sergio Borgonovo <mail(at)webthatworks(dot)it>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: C function accepting/returning cstring vs. text
Date: 2010-01-27 16:41:55
Message-ID: 4B606CD3.8060007@2ndquadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)2ndQuadrant(dot)com www.2ndQuadrant.com

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Frank Ch. Eigler 2010-01-27 16:44:15 Re: Add on_perl_init and proper destruction to plperl [PATCH]
Previous Message Tim Bunce 2010-01-27 16:40:19 Re: Add on_perl_init and proper destruction to plperl [PATCH]