all the text types are simply a 32bit length and an array of
characters. you need to be aware of the encoding, and null is just
another character.
[dmb>] Yes, I can see that. What I need is a function that will convert to and
from whatever the actual encoding happens to be into Unicode,
FWIW here are examples from PL/R for incoming (argument) and outgoing
(result) conversions of scalar values:
https://github.com/jconway/plr/blob/master/pg_conversion.c#L632
https://github.com/jconway/plr/blob/master/pg_conversion.c#L1002
That same file also has routines for conversions of
all the text types are simply a 32bit length and an array of
characters. you need to be aware of the encoding, and null is just
another character.
[dmb>] Yes, I can see that. What I need is a function that will convert to and
from whatever the actual encoding happens to be into Unicode,
On 3/2/2016 9:36 PM, da...@andl.org wrote:
[dmb>] This is fairly easy for ints and reals, but is particularly a problem
for all the variable length types (eg text, time and decimal).
all the text types are simply a 32bit length and an array of
characters. you need to be aware of the
> [dmb>] So how would I go about finding a set of useful conversion functions
> for basic types (real, decimal, time, etc)?
the basic SQL to C mappings are defined by the H files listed here,
http://www.postgresql.org/docs/current/static/xfunc-c.html#XFUNC-C-TYPE-TABLE
[dmb>]
[dmb>] Yes,
On 03/02/2016 04:20 PM, da...@andl.org wrote:
> (please do not post HTML to these lists; see:
> https://wiki.postgresql.org/wiki/Mailing_Lists)
> [dmb>] I checked the list first: it looks like about 25-50% HTML.
> Happy to oblige, but I think you've got your work cut out.
Understood, but you
On 3/2/2016 4:20 PM, da...@andl.org wrote:
[dmb>] So how would I go about finding a set of useful conversion functions for
basic types (real, decimal, time, etc)?
the basic SQL to C mappings are defined by the H files listed here,
(please do not post HTML to these lists; see:
https://wiki.postgresql.org/wiki/Mailing_Lists)
[dmb>] I checked the list first: it looks like about 25-50% HTML. Happy to
oblige, but I think you've got your work cut out.
> and looks like it might work. Questions:
>
> 1. Is this the right
(please do not post HTML to these lists; see:
https://wiki.postgresql.org/wiki/Mailing_Lists)
On 03/02/2016 03:06 PM, da...@andl.org wrote:
> 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.
>
>
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
10 matches
Mail list logo