Re: [GENERAL] to_char(timestamp, format) is changing the year!

2014-11-30 Thread Stephen Woodbridge
Hi Adrain, Thank you for the explanation. I was trying to send some data to a Javascript library worked with ISO dates. But you are correct I wanted not IYYY, that totally sliped by me. Thanks, -Steve On 11/30/2014 4:19 PM, Adrian Klaver wrote: On 11/30/2014 01:05 PM, Stephen

[GENERAL] to_char(timestamp, format) is changing the year!

2014-11-30 Thread Stephen Woodbridge
Hi, I am have a problem when I format a timestamp in that it is changing the year. This can't be right, so either I don't understand or I have found a nasty corner case bug. This does not happen on all dates select '2014-12-31 00:00:00'::timestamp without time zone, to_char('2014-12-3

Re: [GENERAL] Integrating C++ singletons into postgresql extensions???

2014-10-18 Thread Stephen Woodbridge
On 10/18/2014 5:38 AM, Andres Freund wrote: On 2014-10-17 19:59:54 -0400, Stephen Woodbridge wrote: Hi, I've been writing C++ code that needs to get wrapped into a postgresql extension and it has a few singleton classes like: 1. Config object that holds some general configuration inform

[GENERAL] Integrating C++ singletons into postgresql extensions???

2014-10-17 Thread Stephen Woodbridge
Hi, I've been writing C++ code that needs to get wrapped into a postgresql extension and it has a few singleton classes like: 1. Config object that holds some general configuration information. 2. Stats object for global stats collection. 3. Logger object for enabling/disabling debug logging t

Re: [GENERAL] How to check for pending CancelRequest from C/C++ function

2014-01-06 Thread Stephen Woodbridge
On 1/6/2014 10:32 AM, Tom Lane wrote: Stephen Woodbridge writes: I writing some functions for postgresql extension in C/C++ and I would like to be able to check for a pending CancelRequest from the frontend so I can take appropriate action to honor this request. Put "CHECK_FOR_INTER

[GENERAL] How to check for pending CancelRequest from C/C++ function

2014-01-06 Thread Stephen Woodbridge
Hi all, I writing some functions for postgresql extension in C/C++ and I would like to be able to check for a pending CancelRequest from the frontend so I can take appropriate action to honor this request. 1. How to I check if a request is pending? 2. What is the appropriate action? I assu

Re: [GENERAL] Do I have to free storage in a UDF if I raise an error?

2014-01-06 Thread Stephen Woodbridge
On 1/6/2014 10:00 AM, Pfuntner, John wrote: If I've done a palloc() to get storage inside a user-defined function and raise an error using ereport(), should I be using pfree() to release the storage before the ereport()? Consider this example in C: PG_FUNCTION_INFO_V1(Example); Datum

[GENERAL] C function fails afeter create extension but ok after reconnect

2013-05-19 Thread Stephen Woodbridge
Hi all, I have a C function that works fine in all cases except if I try to run it after create extension without reconnecting to the database. So this fails: createdb -U postgres -h localhost ttt psql -U postgres -h localhost ttt create extension postgis; create extension pgrouting; -- creat

Re: [GENERAL] Problem with heap_form_tuple error

2012-11-05 Thread Stephen Woodbridge
On 11/5/2012 10:34 AM, Tom Lane wrote: Stephen Woodbridge writes: I'm have a problem with heap_form_tuple error ERROR: invalid memory alloc request size 1149502660 I've read through a ton of examples and read through the code and the docs and I'm sure I'm doing some

[GENERAL] Problem with heap_form_tuple error

2012-11-05 Thread Stephen Woodbridge
Hi all, I'm have a problem with heap_form_tuple error ERROR: invalid memory alloc request size 1149502660 I've read through a ton of examples and read through the code and the docs and I'm sure I'm doing something stupid but I'm not seeing it. I have included a very reduced sample of the c

[GENERAL] C SRF question

2012-11-04 Thread Stephen Woodbridge
Hi all, I am writing a C set returning function to standardize address strings like: select * from standard_address( sql_for_lexicon, sql_for_gazeteer, sql_for_rules, sql_for_addresses); On the first call, the first 3 sql statements are executed with SPI to coll

Re: [GENERAL] [postgis-users] how many min. floating-points?

2008-03-20 Thread Stephen Woodbridge
John Smith wrote: guys, how many min. floating-points must a server hardware support for postgresql+postgis? does postgresql+postgis do much floating-point math to make a difference? can someone give postgresql+postgis application examples that will require high floating-points? thks, jzs I do

[GENERAL] unaccent as stored procedure?

2006-12-04 Thread Stephen Woodbridge
Hi all, I was wondering if anyone has unac.c which is the lib used in Text::Unaccent built and wrap as a plpgsql stored procedure not using plperl. Or maybe there is another general solution that I am no aware of. Thanks, -Steve ---(end of broadcast)