[GENERAL] Experiences with pl/Java

2012-11-19 Thread Thomas Hill
Hi, was wondering if there is anyone wanted to share some experiences gained and some knowledge on pl/Java. Have looked into it for a couple of days now and am getting the impression it is not something ready to use in production environment. Also have trouble sending to the developer

Re: [GENERAL] EDB installer should check for valid %COMSPEC%

2012-11-19 Thread Dave Page
Hi On Mon, Nov 19, 2012 at 4:29 AM, Craig Ringer cr...@2ndquadrant.com wrote: Hi folks Some recent discussion on Stack Overflow has revealed another exciting way for Windows computers to be subtly broken. For as yet unknown reasons - probably related to security/virus scanner software,

Re: [GENERAL] Fuzzystrmatch contrib module on RHEL63

2012-11-19 Thread Devrim GÜNDÜZ
Hi, On Sun, 2012-11-18 at 21:13 -0500, Ike Nnabugwu wrote: I am building an rpm package fuzzystrmatch to be installed on RHEL63 but I do not know where to get the modules for it.I will appreciate any pointers that will assist with this task. All contrib modules are already available in

[GENERAL] How to upgrade postgres 8.4 - 9.1 contrib?

2012-11-19 Thread Benedikt Grundmann
Hello, We a little while ago upgraded our databases from 8.4 to 9.1. We upgraded using pg_upgrade but didn't do anything special for extensions (other than that the server had the contrib rpm installed). Everything works just fine but recently we noticed that a lot of the functions from hstore

[GENERAL] remote connection refused

2012-11-19 Thread Yvon Thoraval
I'd like to have a checklist upon what to do, what to investigate, when an external connection is refused. if i connect by : psql -h localhost -p 5432 -U yt mydb it works as usual however even locally but using the LAN address : psql -h 192.168.0.20 -p 5432 -U yt mydb i got a : psql: could

Re: [GENERAL] remote connection refused

2012-11-19 Thread Martin French
Usually, after what you've already confirmed, it's likely to be one of the following: - check listen_address is set correctly in postgresql.conf. (try listen_address = * and restart postgres) - check port 5432 is open on iptables. (service iptables status, netstat -a | grep 5432) Cheers

Re: [GENERAL] remote connection refused

2012-11-19 Thread Devrim GÜNDÜZ
Hi, On Mon, 2012-11-19 at 13:08 +0100, Yvon Thoraval wrote: in such a situation what is your checklist in order to find what I've missed ? What is listen_addresses in postgresql.conf ? It should be * or so. Also, I would make sure that there is not a firewall on the machine itself.

[GENERAL] Maintaining state across function calls

2012-11-19 Thread matt
I want to process all the records in a table through a C-language (well, C++) function (i.e. one function call per row of the table) in such a way that the function hangs onto its internal state across calls. Something like SELECT my_function(a, b, c) FROM my_table ORDER BY d; The value

Re: [GENERAL] remote connection refused

2012-11-19 Thread Yvon Thoraval
YES fine, thanks a lot ! it was left to default 'locahost'... 2012/11/19 Devrim GÜNDÜZ dev...@gunduz.org Hi, On Mon, 2012-11-19 at 13:08 +0100, Yvon Thoraval wrote: in such a situation what is your checklist in order to find what I've missed ? What is listen_addresses in

Re: [GENERAL] Maintaining state across function calls

2012-11-19 Thread Craig Ringer
On 11/19/2012 08:41 PM, m...@byrney.com wrote: I want to process all the records in a table through a C-language (well, C++) function (i.e. one function call per row of the table) in such a way that the function hangs onto its internal state across calls. Something like SELECT

Re: [GENERAL] Maintaining state across function calls

2012-11-19 Thread matt
On 11/19/2012 08:41 PM, m...@byrney.com wrote: I want to process all the records in a table through a C-language (well, C++) function (i.e. one function call per row of the table) in such a way that the function hangs onto its internal state across calls. Something like SELECT

Re: [GENERAL] Experiences with pl/Java

2012-11-19 Thread Welty, Richard
i used it for a project about 6 months ago. it took a little bit of effort to get things going, and the documentation could use some work, but it was reliable once i got oriented. the developer does read the mailing list, and responds to requests for help. i think you could use it in

Re: [GENERAL] How to upgrade postgres 8.4 - 9.1 contrib?

2012-11-19 Thread Tom Lane
Benedikt Grundmann bgrundm...@janestreet.com writes: What is the official guide line? You could try (1) run the 9.0 version of the hstore install script and then (2) do the CREATE EXTENSION FROM UNPACKAGED bit. I'd strongly recommend testing this procedure in a scratch copy of your installation

Re: [GENERAL] How to upgrade postgres 8.4 - 9.1 contrib?

2012-11-19 Thread Benedikt Grundmann
On Mon, Nov 19, 2012 at 3:22 PM, Tom Lane t...@sss.pgh.pa.us wrote: Benedikt Grundmann bgrundm...@janestreet.com writes: What is the official guide line? You could try (1) run the 9.0 version of the hstore install script and then (2) do the CREATE EXTENSION FROM UNPACKAGED bit. I'd strongly

Re: [GENERAL] Experiences with pl/Java

2012-11-19 Thread Peter Geoghegan
On 19 November 2012 08:02, Thomas Hill thomas.k.h...@t-online.de wrote: was wondering if there is anyone wanted to share some experiences gained and some knowledge on pl/Java. Have looked into it for a couple of days now and am getting the impression it is not something ready to use in

Re: [GENERAL] Maintaining state across function calls

2012-11-19 Thread Tom Lane
m...@byrney.com writes: The question is: what's the best practice way of letting a C/C++-language function hang onto internal state across calls? A static variable for that is a really horrid idea. Instead use fcinfo-flinfo-fn_extra to point to some workspace palloc'd in the appropriate

Re: [GENERAL] Experiences with pl/Java

2012-11-19 Thread Achilleas Mantzios
Hello Peter, glad to meet you again after http://2012.pgconf.eu ! On Δευ 19 Νοε 2012 16:26:56 you wrote: On 19 November 2012 08:02, Thomas Hill thomas.k.h...@t-online.de wrote: was wondering if there is anyone wanted to share some experiences gained and some knowledge on pl/Java. Have

Re: [GENERAL] Experiences with pl/Java

2012-11-19 Thread Edson Richter
I don't know much about PostgreSQL with plJava, but I can give a few tips about memory stability when using Java (see inline): Em 19/11/2012 14:55, Achilleas Mantzios escreveu: Hello Peter, glad to meet you again after http://2012.pgconf.eu ! On Δευ 19 �οε 2012 16:26:56 you wrote: On

Re: [GENERAL] Experiences with pl/Java

2012-11-19 Thread Welty, Richard
Edson Richter [edsonrich...@hotmail.com] writes: I don't know much about PostgreSQL with plJava, but I can give a few tips about memory stability when using Java (see inline): ... In the past, one choice was using static classes whenever possible. This is not true (neither recommended) anymore,

Re: [GENERAL] Experiences with pl/Java

2012-11-19 Thread Edson Richter
Em 19/11/2012 15:26, Welty, Richard escreveu: Edson Richter [edsonrich...@hotmail.com] writes: I don't know much about PostgreSQL with plJava, but I can give a few tips about memory stability when using Java (see inline): ... In the past, one choice was using static classes whenever

[GENERAL] PITR manual doesn't reference pg_receivexlog?

2012-11-19 Thread Joe Van Dyk
http://www.postgresql.org/docs/current/static/continuous-archiving.htmldoesn't mention pg_receivexlog. But http://www.postgresql.org/docs/current/static/app-pgreceivexlog.htmlsays pg_receivexlog can be used for PITR backups. Should the PITR page reference pg_receivexlog?

Re: [GENERAL] Maintaining state across function calls

2012-11-19 Thread matt
m...@byrney.com writes: The question is: what's the best practice way of letting a C/C++-language function hang onto internal state across calls? A static variable for that is a really horrid idea. Instead use fcinfo-flinfo-fn_extra to point to some workspace palloc'd in the appropriate

Re: [GENERAL] Experiences with pl/Java

2012-11-19 Thread Welty, Richard
Edson Richter [edsonrich...@hotmail.com] writes: Em 19/11/2012 15:26, Welty, Richard escreveu: PL/Java requires that the methods being directly called from PostgreSQL are static. while i don't disagree with the advice, PL/Java is limited in this respect. :-) as I said, I know little about

Re: [GENERAL] Maintaining state across function calls

2012-11-19 Thread Tom Lane
m...@byrney.com writes: Thanks for this. Out of curiosity, why is a static a bad way to do this? Well, it wouldn't allow more than one instance of the function per query, and it wouldn't reset correctly after an error, and surely you agree that your proposal of making the user do a separate

[GENERAL] Split_part on a CR

2012-11-19 Thread Jeff Ross
Hi, I'm having a hard time figuring out how to use split_part with a carriage return (hex 0a) as the delimiter. Would someone please offer me a clue? Thanks! Jeff Ross -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription:

Re: [GENERAL] Experiences with pl/Java

2012-11-19 Thread Thomas Hill
Thanks to all for providing feedback and sharing opinions. Looks like you have gone much further on it than I thought someone would have. So I think I might spend some more time with it, but not plan to use it for my application in a production environment. My initial attempts were to try to

Re: [GENERAL] Split_part on a CR

2012-11-19 Thread Tom Lane
Jeff Ross jr...@wykids.org writes: Hi, I'm having a hard time figuring out how to use split_part with a carriage return (hex 0a) as the delimiter. Um, 0x0a is line feed last I checked. But you should be able to write the literal as E'\r' (if you wanted CR) or E'\n' (if you wanted LF).

Re: [GENERAL] Split_part on a CR

2012-11-19 Thread Gary Chambers
Jeff, I'm having a hard time figuring out how to use split_part with a carriage return (hex 0a) as the delimiter. Would someone please offer me a clue? 0x0a is actually a new line. This works for me: select split_part(text_column, E'\n', 1) from table; -- GC -- Sent via pgsql-general

Re: [GENERAL] Split_part on a CR

2012-11-19 Thread David Johnston
-Original Message- From: pgsql-general-ow...@postgresql.org [mailto:pgsql-general- ow...@postgresql.org] On Behalf Of Jeff Ross Sent: Monday, November 19, 2012 2:49 PM To: pgsql-general@postgresql.org Subject: [GENERAL] Split_part on a CR Hi, I'm having a hard time figuring out

Re: [GENERAL] Split_part on a CR

2012-11-19 Thread Jeff Ross
On 11/19/12 12:58, Tom Lane wrote: Jeff Ross jr...@wykids.org writes: Hi, I'm having a hard time figuring out how to use split_part with a carriage return (hex 0a) as the delimiter. Um, 0x0a is line feed last I checked. But you should be able to write the literal as E'\r' (if you wanted CR)

Re: [GENERAL] Experiences with pl/Java

2012-11-19 Thread Thomas Hill
thanks - not sure how plJava works here and if the implementation is identical to Apache Derby - what I can tell however is that defining the types the way I did (integer on one side vs an array of integers on the other side) is exactely how Apache Derby needs this as there out parms always

Re: [GENERAL] Experiences with pl/Java

2012-11-19 Thread John R Pierce
On 11/19/12 2:56 PM, Thomas Hill wrote: thanks - not sure how plJava works here and if the implementation is identical to Apache Derby - what I can tell however is that defining the types the way I did (integer on one side vs an array of integers on the other side) is exactely how Apache Derby

Re: [GENERAL] High SYS CPU - need advise

2012-11-19 Thread Vlad Marchenko
OK, so far I settled on excluding connection caching on app side (Apache::DBI and prepare_cached) from equation and adding pgbouncer as a counter-measure. This seems to stabilize the situation - at least I'm not able to push server into high-sys-cpu stall the way how I used to do. I'm still

Re: [GENERAL] Maintaining state across function calls

2012-11-19 Thread Craig Ringer
On 11/19/2012 10:09 PM, m...@byrney.com wrote: Thanks for your reply. A follow-up question: to use the palloc/pfree functions with a C++ STL container, do I simply give the container an allocator which uses palloc and pfree instead of the default allocator, which uses new and delete? If at

Re: [GENERAL] Maintaining state across function calls

2012-11-19 Thread Peter Geoghegan
On 20 November 2012 01:30, Craig Ringer cr...@2ndquadrant.com wrote: Otherwise you'll have to translate error handling mechanisms at every boundary between C++ and Pg code, something I'm not even certain is possible to do reliably. I think it's probably the case that PLV8 is the most mature

Re: [GENERAL] Experiences with pl/Java

2012-11-19 Thread Welty, Richard
i think pl/java may expect the method signatures to match up precisely. not entirely sure, as there are no examples published as to how pl/java expects out parameters to work. richard From: Thomas Hill [thomas.k.h...@t-online.de] Sent: Monday, November

Re: [GENERAL] High SYS CPU - need advise

2012-11-19 Thread Merlin Moncure
On Fri, Nov 16, 2012 at 11:19 AM, Vlad marche...@gmail.com wrote: We're looking for spikes in 'blk' which represents when lwlocks bump. If you're not seeing any then this is suggesting a buffer pin related issue -- this is also supported by the fact that raising shared buffers didn't help.

Re: [GENERAL] High SYS CPU - need advise

2012-11-19 Thread Merlin Moncure
On Fri, Nov 16, 2012 at 12:26 PM, Jeff Janes jeff.ja...@gmail.com wrote: On Fri, Nov 16, 2012 at 8:21 AM, Merlin Moncure mmonc...@gmail.com wrote: On Fri, Nov 16, 2012 at 9:52 AM, Vlad marche...@gmail.com wrote: *) failing that, LWLOCK_STATS macro can be compiled in to give us some

Re: [GENERAL] [SOLVED] WINDOWS : PostgreSQL 8.4 Server Start Error

2012-11-19 Thread JulAkmad, Julpikar
How did you perform the winsock solution?

[GENERAL] get source of udf

2012-11-19 Thread Peter Kroon
Hi list, I would like to get the source of a udf. In mssql I run this query: SELECT OBJECT_DEFINITION(OBJECT_ID) FROM sys.objects WHERE name='function_name'; And I get the entire source of the function. How must I do this in PostgreSQL? Thanks, Peter

Re: [GENERAL] High SYS CPU - need advise

2012-11-19 Thread Vlad
I just did a little experiment: extracted top four queries that were executed the longest during stall times and launched pgbench test with 240 clients. Yet I wasn't able to put the server into a stall with that. Also load average was hitting 120+, it was all user cpu, single digit % system. The

Re: [GENERAL] High SYS CPU - need advise

2012-11-19 Thread Merlin Moncure
On Sun, Nov 18, 2012 at 4:24 PM, Jeff Janes jeff.ja...@gmail.com wrote: On Fri, Nov 16, 2012 at 12:13 PM, Vlad marche...@gmail.com wrote: ok, I've applied that patch and ran. The stall started around 13:50:45...50 and lasted until the end

Re: [GENERAL] PG_TERMINATE_BACKEND not working.

2012-11-19 Thread Harry
Chris Yes, i am logging in as Super User also, other side same user's connection(Superuser) i am trying to kill. -- View this message in context: http://postgresql.1045698.n5.nabble.com/PG-TERMINATE-BACKEND-not-working-tp5732379p5732694.html Sent from the PostgreSQL - general mailing list

Re: [GENERAL] High SYS CPU - need advise

2012-11-19 Thread Merlin Moncure
On Mon, Nov 19, 2012 at 10:50 AM, Vlad marche...@gmail.com wrote: I just did a little experiment: extracted top four queries that were executed the longest during stall times and launched pgbench test with 240 clients. Yet I wasn't able to put the server into a stall with that. Also load

[GENERAL] Trigger based replication with ENABLE REPLICA triggers and session_replication_role best practice(s)

2012-11-19 Thread Achilleas Mantzios
Hello, we have based all our replication infrastructure on a heavily hacked version of DBMirror, which now runs in a single master (office DB) - multiple slaves (vessels DBs) mode for 80+ slaves and about 300 tables and in multiple masters (the same vessels DBs as above) (having partitions of