Re: [HACKERS] transformations between types and languages

2012-05-21 Thread Tom Lane
I wrote: > Can we use something else for the magic type here? Or find a way to > positively forbid such functions from being called from the SQL level? When I wrote that I was wondering if we'd need a new pg_proc column, "prodontcallfromsql" or some such. But on further reflection it seems like

Re: [HACKERS] transformations between types and languages

2012-05-21 Thread Tom Lane
Peter Eisentraut writes: > Here is a draft design for the transforms feature, which I'd like to > work on. ... > fromsql takes one argument of the respective type and returns internal. > tosql is the other way around. It's the responsibility of the language > handler to look up this information

Re: [HACKERS] transformations between types and languages

2012-05-16 Thread Robert Haas
On Tue, May 15, 2012 at 4:15 PM, Peter Eisentraut wrote: > [ draft design for the transforms feature ] Seems pretty reasonable, although I'm not sure about your chosen syntax for CREATE TRANSFORM... -- Robert Haas EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company --

Re: [HACKERS] transformations between types and languages

2012-05-15 Thread Darren Duncan
Peter Eisentraut wrote: Here is a draft design for the transforms feature, which I'd like to work on. The purpose of this is to allow adapting types to languages. The most popular case is to enable converting hstore to something useful like a dict or a hash in PL/Python or PL/Perl, respectively.

[HACKERS] transformations between types and languages

2012-05-15 Thread Peter Eisentraut
Here is a draft design for the transforms feature, which I'd like to work on. The purpose of this is to allow adapting types to languages. The most popular case is to enable converting hstore to something useful like a dict or a hash in PL/Python or PL/Perl, respectively. In general, the type and