[GENERAL] Terminating a rogue connection

2012-07-27 Thread Mark Morgan Lloyd
Assuming a *nix server: if a monitoring program determines that an established connection appears to be trying to so something inappropriate, what's the best way of terminating that session rapidly? -- Mark Morgan Lloyd markMLl .AT. telemetry.co .DOT. uk [Opinions above are the author's, not t

Re: [GENERAL] Terminating a rogue connection

2012-07-27 Thread Chris Angelico
On Fri, Jul 27, 2012 at 6:27 PM, Mark Morgan Lloyd wrote: > Assuming a *nix server: if a monitoring program determines that an > established connection appears to be trying to so something inappropriate, > what's the best way of terminating that session rapidly? select pg_terminate_backend(procpi

Re: [GENERAL] Terminating a rogue connection

2012-07-27 Thread Bèrto ëd Sèra
Hi all, in elderly versions, where pg_terminate_backend is missing, you'd issue a kill -15 from the command line. Bèrto On 27 July 2012 09:33, Chris Angelico wrote: > On Fri, Jul 27, 2012 at 6:27 PM, Mark Morgan Lloyd > wrote: >> Assuming a *nix server: if a monitoring program determines that

Re: [GENERAL] Terminating a rogue connection

2012-07-27 Thread Mark Morgan Lloyd
Chris Angelico wrote: On Fri, Jul 27, 2012 at 6:27 PM, Mark Morgan Lloyd wrote: Assuming a *nix server: if a monitoring program determines that an established connection appears to be trying to so something inappropriate, what's the best way of terminating that session rapidly? select pg_term

Re: [GENERAL] postgres maintenance db

2012-07-27 Thread Guillaume Lelarge
On Thu, 2012-07-26 at 15:07 -0700, hartrc wrote: > I'm using postgres 9.1.4 on Suse Linux Enterprise Server 11. > After successful installation I by default have one database installed > called postgres. > > I'm starting the process of migrating some database schemas off Oracle and > mysql onto po

Re: [GENERAL] BI tools and postgresql

2012-07-27 Thread Jacqui Caren
On 26/07/2012 15:04, Vincent Veyron wrote: The money spent in licences alone would pay for scores of developpers to produce any kind of reporting you will need many times over (the data and its structure is what counts, reporting is easy if you have that) I disagree that licences will cover rep

[GENERAL] information_schema.referential_constraints broken?

2012-07-27 Thread Igor Neyman
This query: select * from information_schema.referential_constraints; under PG 8.4.5 (Windows platform) produces this error message: ERROR: operator is not unique: smallint[] <@ smallint[] LINE 1: select $1 <@ $2 and $2 <@ $1 ^ HINT: Could not choose a best candidate operator

[GENERAL] Switching from OSX to Linux, multi-line queries in \copy don't work anymore

2012-07-27 Thread Ryan Kelly
I recently switched from OSX to Linux and \copy in psql no longer accepts multi-line queries. For instance: \copy ( select * from pg_settings ) to '/tmp/settings.csv' with csv header This works fine on OSX. On Linux I get: \copy: parse error at end of line Am I missing so

Re: [GENERAL] Switching from OSX to Linux, multi-line queries in \copy don't work anymore

2012-07-27 Thread Craig Ringer
On 07/27/2012 09:28 PM, Ryan Kelly wrote: I recently switched from OSX to Linux and \copy in psql no longer accepts multi-line queries. For instance: \copy ( select * from pg_settings ) to '/tmp/settings.csv' with csv header This works fine on OSX. On Linux I get: \c

Re: [GENERAL] Switching from OSX to Linux, multi-line queries in \copy don't work anymore

2012-07-27 Thread Mark Morgan Lloyd
Craig Ringer wrote: On 07/27/2012 09:28 PM, Ryan Kelly wrote: I recently switched from OSX to Linux and \copy in psql no longer accepts multi-line queries. For instance: \copy ( select * from pg_settings ) to '/tmp/settings.csv' with csv header This works fine on OS

Re: [GENERAL] Switching from OSX to Linux, multi-line queries in \copy don't work anymore

2012-07-27 Thread Ryan Kelly
On Fri, Jul 27, 2012 at 09:49:06PM +0800, Craig Ringer wrote: > On 07/27/2012 09:28 PM, Ryan Kelly wrote: > >I recently switched from OSX to Linux and \copy in psql no longer > >accepts multi-line queries. For instance: > > > >\copy ( > > select > > * > > from > > pg_setting

Re: [GENERAL] Terminating a rogue connection

2012-07-27 Thread Chris Angelico
On Fri, Jul 27, 2012 at 7:09 PM, Mark Morgan Lloyd wrote: > Chris Angelico wrote: >> >> On Fri, Jul 27, 2012 at 6:27 PM, Mark Morgan Lloyd >> wrote: >>> >>> Assuming a *nix server: if a monitoring program determines that an >>> established connection appears to be trying to so something >>> inapp

Re: [GENERAL] Switching from OSX to Linux, multi-line queries in \copy don't work anymore

2012-07-27 Thread Ryan Kelly
On Fri, Jul 27, 2012 at 02:06:01PM +, Mark Morgan Lloyd wrote: > Craig Ringer wrote: > >On 07/27/2012 09:28 PM, Ryan Kelly wrote: > >>I recently switched from OSX to Linux and \copy in psql no longer > >>accepts multi-line queries. For instance: > >> > >>\copy ( > >> select > >> * >

Re: [GENERAL] information_schema.referential_constraints broken?

2012-07-27 Thread Igor Neyman
Answering my own question. Replacing original definition of _pg_keysequal (in information_schema): CREATE FUNCTION _pg_keysequal(smallint[], smallint[]) RETURNS boolean LANGUAGE sql IMMUTABLE -- intentionally not STRICT, to allow inlining AS 'select $1 <@ $2 and $2 <@ $1'; with this one:

Re: [GENERAL] Terminating a rogue connection

2012-07-27 Thread Mark Morgan Lloyd
Chris Angelico wrote: On Fri, Jul 27, 2012 at 7:09 PM, Mark Morgan Lloyd wrote: Chris Angelico wrote: On Fri, Jul 27, 2012 at 6:27 PM, Mark Morgan Lloyd wrote: Assuming a *nix server: if a monitoring program determines that an established connection appears to be trying to so something inapp

[GENERAL] Adding users connection via SSL

2012-07-27 Thread Mark Morgan Lloyd
I'm hoping to be able to avoid "on the fly" editing of configuration files, there's too much could go wrong. Is it possible to create or modify a user connecting via an authenticated/encrypted protocol as an SQL activity, in the same way that CREATE ROLE ... PASSWORD creates one authenticated

[GENERAL] fgets failure in Solaris after patching

2012-07-27 Thread Stephan, Richard
Rebuilt the PostgreSQL server software because we were patching up from 9.0.4 to 9.0.8. Deployed software and received the following error when trying to restart server. fgets failure: Error 0 The program postgres is needed by pg_ctl but was not found in the same directory as pg_ctl 9.0.4 wor

Re: [GENERAL] postgres maintenance db

2012-07-27 Thread Steve Crawford
On 07/26/2012 03:07 PM, hartrc wrote: I'm using postgres 9.1.4 on Suse Linux Enterprise Server 11. After successful installation I by default have one database installed called postgres. I'm starting the process of migrating some database schemas off Oracle and mysql onto postgres but I want to

Re: [GENERAL] Schema-only dump dumps no constraints, no triggers

2012-07-27 Thread Marek Kielar
Hi, again, I'm sorry about the lack of version information - I concentrated so much on describing the problem correctly, that I forgot to provide basic information. The version at locations is 9.1.4 (though this is irrelevant now), the server is 9.0.4. We found what the problem was. Another pr

Re: [GENERAL] information_schema.referential_constraints broken?

2012-07-27 Thread Tom Lane
Igor Neyman writes: > Answering my own question. > Replacing original definition of _pg_keysequal (in information_schema): > CREATE FUNCTION _pg_keysequal(smallint[], smallint[]) RETURNS boolean > LANGUAGE sql IMMUTABLE -- intentionally not STRICT, to allow inlining > AS 'select $1 <@ $2

[GENERAL] REINDEX and COPY is wainting since Jun 21!

2012-07-27 Thread Ing.Edmundo.Robles.Lopez
Hi, i have postgres 8.3 running in SCO Openserver 5.0.7 today, i had problems to start psql, the error mesage was: 'FATAL Memory out, Detail: Failed on resqueted size ...' , and after i checked the process i noticed the following: the elder REINDEX had been running since Jun-21 by 3

[GENERAL] can we avoid pg_basebackup on planned switches?

2012-07-27 Thread Ben Chobot
We make heavy use of streaming replication on PG 9.1 and it's been great for us. We do have one issue with it, though, and that's when we switch master nodes - currently, the documentation says that you must run pg_basebackup on your old master to turn it into a slave. That makes sense when the

Re: [GENERAL] Switching from OSX to Linux, multi-line queries in \copy don't work anymore

2012-07-27 Thread Tom Lane
Ryan Kelly writes: > I recently switched from OSX to Linux and \copy in psql no longer > accepts multi-line queries. For instance: > \copy ( > select > * > from > pg_settings > ) to '/tmp/settings.csv' with csv header > This works fine on OSX. On Linux I get: > \copy: par

Re: [GENERAL] fgets failure in Solaris after patching

2012-07-27 Thread Tom Lane
"Stephan, Richard" writes: > Rebuilt the PostgreSQL server software because we were patching up from 9.0.4 > to 9.0.8. Deployed software and received the following error when trying to > restart server. > fgets failure: Error 0 > The program postgres is needed by pg_ctl but was not found in the

Re: [GENERAL] REINDEX and COPY is wainting since Jun 21!

2012-07-27 Thread Alan Hodgson
On Friday, July 27, 2012 11:59:49 AM Ing.Edmundo.Robles.Lopez wrote: > Hi, i have postgres 8.3 running in SCO Openserver 5.0.7 > > today, i had problems to start psql, the error mesage was: 'FATAL > Memory out, Detail: Failed on resqueted size ...' , and after i checked > the process i notic

Re: [GENERAL] BI tools and postgresql

2012-07-27 Thread Daoud Abdelmonem Faleh
SpagoBI provides extensive and integrated tools for BI/Reporting/Data mining/Realtime BI/ Mobile BI/BAM all under Mozilla Public Licence. The downside is that it's too big for simple reporting/dashboard needs and a quite long learning curve. http://www.spagoworld.org/xwiki/bin/view/SpagoBI/ HTH, -

Re: [GENERAL] Switching from OSX to Linux, multi-line queries in \copy don't work anymore

2012-07-27 Thread Merlin Moncure
On Fri, Jul 27, 2012 at 12:06 PM, Tom Lane wrote: > Ryan Kelly writes: >> I recently switched from OSX to Linux and \copy in psql no longer >> accepts multi-line queries. For instance: > >> \copy ( >> select >> * >> from >> pg_settings >> ) to '/tmp/settings.csv' with csv

Re: [GENERAL] fgets failure in Solaris after patching

2012-07-27 Thread Stephan, Richard
Sorry, that was not the verbatim message, (a cut & paste mistake). More information (9.0.8): $ pg_ctl start Killed fgets failure: Error 0 The program "postgres" is needed by pg_ctl but was not found in the same directory as "/opt/postgres/9.0/bin/pg_ctl". Check your installation. $ postgres -V l

Re: [GENERAL] REINDEX and COPY is wainting since Jun 21!

2012-07-27 Thread Ing.Edmundo.Robles.Lopez
thanks a lot for answer. El 27/07/2012 12:26 p.m., Alan Hodgson escribió: On Friday, July 27, 2012 11:59:49 AM Ing.Edmundo.Robles.Lopez wrote: Hi, i have postgres 8.3 running in SCO Openserver 5.0.7 today, i had problems to start psql, the error mesage was: 'FATAL Memory out, Detail: Failed

Re: [GENERAL] REINDEX and COPY is wainting since Jun 21!

2012-07-27 Thread Ing.Edmundo.Robles.Lopez
El 27/07/2012 12:26 p.m., Alan Hodgson escribió: On Friday, July 27, 2012 11:59:49 AM Ing.Edmundo.Robles.Lopez wrote: Hi, i have postgres 8.3 running in SCO Openserver 5.0.7 today, i had problems to start psql, the error mesage was: 'FATAL Memory out, Detail: Failed on resqueted size ...' ,

Re: [GENERAL] fgets failure in Solaris after patching

2012-07-27 Thread Tom Lane
"Stephan, Richard" writes: > More information (9.0.8): > $ pg_ctl start > Killed > fgets failure: Error 0 > The program "postgres" is needed by pg_ctl but was not found in the > same directory as "/opt/postgres/9.0/bin/pg_ctl". > Check your installation. > $ postgres -V > ld.so.1: postgres: fata

[GENERAL] Postgresql Developer Privileges

2012-07-27 Thread hartrc
Postgresql v9.1.4 SUSE Linux Enterprise Server SP2 In my agency we have application developers who do most of the database design/development themselves (not my choice) in the development environment but do not administer the database. Therefore I want developers to be able to create & drop tables

Re: [GENERAL] Postgresql Developer Privileges

2012-07-27 Thread John R Pierce
On 07/27/12 12:30 PM, hartrc wrote: In my agency we have application developers who do most of the database design/development themselves (not my choice) in the development environment but do not administer the database. Therefore I want developers to be able to create & drop tables, create & dro

Re: [GENERAL] Schema-only dump dumps no constraints, no triggers

2012-07-27 Thread Adrian Klaver
On 07/27/2012 09:32 AM, Marek Kielar wrote: Hi, again, I'm sorry about the lack of version information - I concentrated so much on describing the problem correctly, that I forgot to provide basic information. The version at locations is 9.1.4 (though this is irrelevant now), the server is 9.0

[GENERAL] Trim not working (PostgreSQL 9.1.2 on Win64)

2012-07-27 Thread Edson Richter
I've a select with the following expression: select trim(both ' ' from substring(rslinha2 from 5 for position('(-)' in rslinha2)-6)) from ... problem is that the spaces are not being removed from either side. What would be wrong? Thanks for your help, Edson Richter -- Sent via

[GENERAL] Elegant method of accessing N-dimension array in C function

2012-07-27 Thread Bborie Park
Hi, I'm wondering if there is a more elegant (best practice?) approach to accessing and processing a N-dimension array from the SQL side in a C function. I've looked at deconstruct_array() but would like a second opinion before I use that function. Basically, I have a function that receives a do

Re: [GENERAL] Trim not working (PostgreSQL 9.1.2 on Win64)

2012-07-27 Thread Edson Richter
Em 27/07/2012 21:04, Edson Richter escreveu: I've a select with the following expression: select trim(both ' ' from substring(rslinha2 from 5 for position('(-)' in rslinha2)-6)) from ... problem is that the spaces are not being removed from either side. What would be wrong? Than

[GENERAL] Trim not working (PostgreSQL 9.1.2 on Win64)

2012-07-27 Thread Edson Richter
I've a select with the following _expression_: select trim(both ' ' from substring(rslinha2 from 5 for position('(-)' in rslinha2)-6))            from ... problem is that the spaces are not being removed from either side. What would be wrong? Thanks