| From: | <david(at)andl(dot)org> |
|---|---|
| To: | <pgsql-general-owner+M220375=david=andl(dot)org(at)postgresql(dot)org> |
| Cc: | <pgsql-general(at)postgresql(dot)org> |
| Subject: | CStringGetTextDatum and other conversions in server-side code |
| Date: | 2016-03-02 23:06:57 |
| Message-ID: | 000401d174d8$3ab1bde0$b01539a0$@andl.org |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-general |
Writing a language handler: pl_language_handler. Need to do a variety of data conversions. One of them is char* C-string to and from Text/Varchar.
The include file postgres.h has the macro CStringGetDatum but this is of no use: it’s just a cast.
There is a builtin macro CStringGetTextDatum which calls a function and looks like it might work. Questions:
1. Is this the right function?
2. Is it OK to use, or are there restrictions?
3. Does it have friends: are there other conversion functions like this for other data types (decimal, time in particular)?
4. Is there any particular documentation I can read?
Regards
David M Bennett FACS
_____
Andl - A New Database Language - andl.org
| From | Date | Subject | |
|---|---|---|---|
| Next Message | David G. Johnston | 2016-03-02 23:09:26 | Re: Postgresql upgrade 9.5 |
| Previous Message | David G. Johnston | 2016-03-02 23:06:10 | Re: Issue enabling track_counts to launch autovacuum in 9.4.5 |