SPI_stringtodatum SPI_datumtostring ? - Mailing list pgsql-hackers

From Clark Evans
Subject SPI_stringtodatum SPI_datumtostring ?
Date
Msg-id 36E9CB51.BDB79ADB@manhattanproject.com
Whole thread Raw
In response to RE: [HACKERS] tutorial won't compile in current tree.  ("Stupor Genius" <stuporg@erols.com>)
List pgsql-hackers
I was looking at the tutorial code (funcs.c) a bit more
and it seems that a bulk of the work going on for the
"copytext" and "concat16" (soon to be defunct *smile* )
is converting from string to datum and then back again.

Perhaps if two functions were added to the SPI that 
did this operation...

Datum       SPI_stringtodatum(const char *type, const char *data);
const char *SPI_datumtostring(Datum data);

These two functions would lookup the type in the 
type table, find the input/output functions for
the datatype and make the call.

Thoughts?

Clark


pgsql-hackers by date:

Previous
From: Clark Evans
Date:
Subject: GetAttributeByName
Next
From: Bruce Momjian
Date:
Subject: Re: [HACKERS] tutorial won't compile in current tree.