On Wed, Mar 23, 2011 at 14:08, Merlin Moncure wrote:
> On Wed, Mar 23, 2011 at 9:04 AM, dennis jenkins
> wrote:
>> On Wed, Mar 23, 2011 at 5:08 AM, Adrian Schreyer wrote:
>>>
>>> you are right, it returns a char *.
>>>
>>> The prototype:
>>>
>>> char *function(bytea *b);
>>>
>>> The actual C++ f
On Wed, Mar 23, 2011 at 14:08, Merlin Moncure wrote:
> On Wed, Mar 23, 2011 at 9:04 AM, dennis jenkins
> wrote:
>> On Wed, Mar 23, 2011 at 5:08 AM, Adrian Schreyer wrote:
>>>
>>> you are right, it returns a char *.
>>>
>>> The prototype:
>>>
>>> char *function(bytea *b);
>>>
>>> The actual C++ f
Adrian Schreyer writes:
> The actual C++ function looks roughly like this
> extern "C"
> char *function(bytea *b)
> {
>string ism;
>[...]
>return ism.c_str();
> }
My C++ is pretty rusty, but is the pointer returned by c_str() still
valid after the string variable goes out of scope?
On Wed, Mar 23, 2011 at 9:04 AM, dennis jenkins
wrote:
> On Wed, Mar 23, 2011 at 5:08 AM, Adrian Schreyer wrote:
>>
>> you are right, it returns a char *.
>>
>> The prototype:
>>
>> char *function(bytea *b);
>>
>> The actual C++ function looks roughly like this
>>
>> extern "C"
>> char *function(
On Wed, Mar 23, 2011 at 5:08 AM, Adrian Schreyer wrote:
>
> you are right, it returns a char *.
>
> The prototype:
>
> char *function(bytea *b);
>
> The actual C++ function looks roughly like this
>
> extern "C"
> char *function(bytea *b)
> {
> string ism;
> [...]
> return ism.c_str();
> }
>
On Tue, Mar 22, 2011 at 22:21, David W Noon wrote:
> On Tue, 22 Mar 2011 16:14:47 -0500, Merlin Moncure wrote about Re:
> [GENERAL] Weird problems with C extension and bytea as input type:
>
> [snip]
>>>> On Tue, Mar 22, 2011 at 8:22 AM, Adrian Schreyer
>>>
On Tue, Mar 22, 2011 at 22:21, David W Noon wrote:
> On Tue, 22 Mar 2011 16:14:47 -0500, Merlin Moncure wrote about Re:
> [GENERAL] Weird problems with C extension and bytea as input type:
>
> [snip]
>>>> On Tue, Mar 22, 2011 at 8:22 AM, Adrian Schreyer
>>>
On Tue, 22 Mar 2011 16:14:47 -0500, Merlin Moncure wrote about Re:
[GENERAL] Weird problems with C extension and bytea as input type:
[snip]
>>> On Tue, Mar 22, 2011 at 8:22 AM, Adrian Schreyer
>>> wrote:
[snip]
>>>> bytea *b = PG_GETARG_BYTEA_P(0);
>>>
On Tue, Mar 22, 2011 at 11:57 AM, Adrian Schreyer wrote:
> On Tue, Mar 22, 2011 at 16:07, Merlin Moncure wrote:
>> On Tue, Mar 22, 2011 at 8:22 AM, Adrian Schreyer wrote:
>>> Hi,
>>>
>>> I have a weird problem with my custom functions (written in C,C++)
>>> that use bytea as input type (cstring
On Tue, Mar 22, 2011 at 16:07, Merlin Moncure wrote:
> On Tue, Mar 22, 2011 at 8:22 AM, Adrian Schreyer wrote:
>> Hi,
>>
>> I have a weird problem with my custom functions (written in C,C++)
>> that use bytea as input type (cstring works fine). The functions will
>> work as expected if they are t
On Tue, Mar 22, 2011 at 16:07, Merlin Moncure wrote:
> On Tue, Mar 22, 2011 at 8:22 AM, Adrian Schreyer wrote:
>> Hi,
>>
>> I have a weird problem with my custom functions (written in C,C++)
>> that use bytea as input type (cstring works fine). The functions will
>> work as expected if they are t
On Tue, Mar 22, 2011 at 8:22 AM, Adrian Schreyer wrote:
> Hi,
>
> I have a weird problem with my custom functions (written in C,C++)
> that use bytea as input type (cstring works fine). The functions will
> work as expected if they are the only function that uses the bytea
> column in a query; as
12 matches
Mail list logo