[GENERAL] Memory for BYTEA returned by C function is not released until connection is dropped

2015-09-20 Thread John Leiseboer
I have written a number of functions in C that return BYTEA type. I have compiled and run on both Windows and Linux, 32-bit and 64-bit, PostgreSQL versions 9.3 and 9.4. My functions return BYTEA data to the caller. The problem is that memory usage grows until there is no memory left on the host

Re: [GENERAL] Memory for BYTEA returned by C function is not released until connection is dropped

2015-09-20 Thread John Leiseboer
Tom Lane [mailto:t...@sss.pgh.pa.us] writes: > But at any rate, bottom line is that your problem is client-side not > server-side, and no amount of fooling with the function innards will change > it. I wish it were. While monitoring memory on Linux and Windows machines I see that psql memory us

[GENERAL] Memory for BYTEA returned by C function is not released until connection is dropped

2015-09-21 Thread John Leiseboer
I have written a number of functions in C that return BYTEA type. I have compiled and run on both Windows and Linux, 32-bit and 64-bit, PostgreSQL versions 9.3 and 9.4. My functions return BYTEA data to the caller. The problem is that memory usage grows until there is no memory left on the host

[GENERAL] How to get the session user in a C user defined function

2015-10-14 Thread John Leiseboer
I would like to get the session_user into a C char[] in a C language UDF. I have found what appears to be a function returning a Datum type called session_user, but I'm having trouble working out how to call it from within my C function. Can anyone provide some advice on how to do this? John Em