Re: [HACKERS] Add SPI results constants available for PL/*

2012-01-10 Thread Andrew Dunstan
On 01/03/2012 09:11 PM, Andrew Dunstan wrote: On 01/03/2012 08:40 PM, Robert Haas wrote: On Tue, Jan 3, 2012 at 9:33 AM, Pavel Stehulepavel.steh...@gmail.com wrote: I'd suppose it interesting to add a table to pg_catalog containing this data. - it is useless overhead I tend to agree.

Re: [HACKERS] Add SPI results constants available for PL/*

2012-01-10 Thread Pavel Stehule
2012/1/10 Andrew Dunstan and...@dunslane.net: On 01/03/2012 09:11 PM, Andrew Dunstan wrote: On 01/03/2012 08:40 PM, Robert Haas wrote: On Tue, Jan 3, 2012 at 9:33 AM, Pavel Stehulepavel.steh...@gmail.com  wrote: I'd suppose it interesting to add a table to pg_catalog containing this

Re: [HACKERS] Add SPI results constants available for PL/*

2012-01-10 Thread Andrew Dunstan
On 01/10/2012 12:34 PM, Pavel Stehule wrote: Actually, now I look closer I see that PLPerl passes back a stringified status from SPI_execute(), so there is no great need for setting up these constants. It's probably water under the bridge now, but maybe PLPython should have done this too.

Re: [HACKERS] Add SPI results constants available for PL/*

2012-01-10 Thread Pavel Stehule
2012/1/10 Andrew Dunstan and...@dunslane.net: On 01/10/2012 12:34 PM, Pavel Stehule wrote: Actually, now I look closer I see that PLPerl passes back a stringified status from SPI_execute(), so there is no great need for setting up these constants. It's probably water under the bridge now,

Re: [HACKERS] Add SPI results constants available for PL/*

2012-01-06 Thread Martijn van Oosterhout
On Tue, Jan 03, 2012 at 09:11:17PM -0500, Andrew Dunstan wrote: Yeah, I'm with you and Pavel. Here's my quick perl one-liner to produce a set of SPI_* constants for pl/perl. I'm looking at the best way to include this in the bootstrap code. perl -ne 'BEGIN { print use constant\n{\n; } END

Re: [HACKERS] Add SPI results constants available for PL/*

2012-01-04 Thread Samuel PHAN
I agree with Pavel also. Putting these constants in the pg_catalog isn't the cleanest solution. Though one can make its own little lib in python, perl, whatever, to store these constants, it would be better if through the compilation, these C constants were copied in a way for PL/*. I can't

Re: [HACKERS] Add SPI results constants available for PL/*

2012-01-03 Thread Christopher Browne
On Tue, Jan 3, 2012 at 5:55 AM, Samuel PHAN sam...@nomao.com wrote: I'm using PL/Python, and when getting the result object from a plpy.execute(), I can access to the result.status(). E.g.: the result.status() is 4. But to know what 4 corresponds to, I must open the spi.h file from the

Re: [HACKERS] Add SPI results constants available for PL/*

2012-01-03 Thread Pavel Stehule
2012/1/3 Christopher Browne cbbro...@gmail.com: On Tue, Jan 3, 2012 at 5:55 AM, Samuel PHAN sam...@nomao.com wrote: I'm using PL/Python, and when getting the result object from a plpy.execute(), I can access to the result.status(). E.g.: the result.status() is 4. But to know what 4

Re: [HACKERS] Add SPI results constants available for PL/*

2012-01-03 Thread Robert Haas
On Tue, Jan 3, 2012 at 9:33 AM, Pavel Stehule pavel.steh...@gmail.com wrote: I'd suppose it interesting to add a table to pg_catalog containing this data. - it is useless overhead I tend to agree. I am expecting so definition some constants in Perl, Python is simple Presumably one could

Re: [HACKERS] Add SPI results constants available for PL/*

2012-01-03 Thread Andrew Dunstan
On 01/03/2012 08:40 PM, Robert Haas wrote: On Tue, Jan 3, 2012 at 9:33 AM, Pavel Stehulepavel.steh...@gmail.com wrote: I'd suppose it interesting to add a table to pg_catalog containing this data. - it is useless overhead I tend to agree. I am expecting so definition some constants in