Re: [GENERAL] INSERT a real number in a column based on other columns OLD INSERTs

2015-06-24 Thread David G. Johnston
On Wed, Jun 24, 2015 at 5:52 PM, Adrian Klaver wrote: > On 06/23/2015 11:20 PM, litu16 wrote: > >> >> So, this is what I have made so far... >> >> *CREATE OR REPLACE FUNCTION timelog() >>RETURNS trigger AS >> $BODY$ >> DECLARE >> t_ix real; >> n int; >> >> BEG

Re: [GENERAL] INSERT a real number in a column based on other columns OLD INSERTs

2015-06-24 Thread Adrian Klaver
On 06/23/2015 11:20 PM, litu16 wrote: In PostgreSQL I have this table... (there is a primary key serial column in the most left side "stmtserial" which is not shown in this image) in the table above, all columns are entered via querrys

[GENERAL] INSERT a real number in a column based on other columns OLD INSERTs

2015-06-24 Thread litu16
In PostgreSQL I have this table... (there is a primary key serial column in the most left side "stmtserial" which is not shown in this image) in the table above, all columns are entered via querrys, except the "time_index" which I is au

Re: [GENERAL] Postgresql 9.2 has standby server lost data?

2015-06-24 Thread Paula Price
​The script I used to check the lag time between the primary and the standby would show that the standby server was not even close, right? Paula​ On Sat, Jun 20, 2015 at 9:51 AM, Jerry Sievers wrote: > Adrian Klaver writes: > > > On 06/19/2015 01:05 PM, Paula Price wrote: > > > >> > >> > >> On

[GENERAL] Pgbouncer compile in VS2013

2015-06-24 Thread Yelai, Ramkumar IN BLR STS
Hi All, I wanted to compile pgbouncer in Visual studio 2013-64bit. I have not found any help in forums. Also, pgbouncer source file mentioned that, it is not tested in Visual studio. Please let me know, is it possible to compile in VS2013 and works fine? With best regards, Ramkumar Yelai Si

[GENERAL] Re: pg_dump 8.4.9 failing after upgrade to openssl-1.0.1e-30.el6_6.11.x86_64 on redhat linux

2015-06-24 Thread Piotr Gackiewicz
Tom Lane wrote: > I wrote: >> Piotr Gackiewicz writes: >>> $ psql -h localhost -c "SET ssl_renegotiation_limit='3kB'; SELECT >>> repeat('0123456789', 1800);" >>> SSL error: unexpected message >>> connection to server was lost > >> BTW, are you using any nondefault SSL settings? Because I can't

Re: [GENERAL] Counting the occurences of a substring within a very large text

2015-06-24 Thread Albe Laurenz
Marc Mamin wrote: >>> I'd like to count the number linebreaks within a string, but I get a >>> memory allocation error when using regexp_matches or regexp_split_to_table. >> Does any of these two work: [...] > no, they both yeld the same error. > > a new string functions for this would be nice,

[GENERAL] pgbouncer issue

2015-06-24 Thread Sheena, Prabhjot
Guys can anyone please explain or point me to a link where i can understand this output for pgbouncer. What does each column of this table mean? pgbouncer=# show mem; name | size | used | free | memtotal --+--+--+--+-- user_cache | 184 | 12 | 77

Re: [GENERAL] checking for NULLS in aggregate

2015-06-24 Thread David G. Johnston
On Wed, Jun 24, 2015 at 12:54 PM, Seb wrote: > Hello, > > I've defined a function to calculate standard deviation of angular > values: > > CREATE AGGREGATE public.stddev(angle_vectors) ( > SFUNC=array_append, > STYPE=angle_vectors[], > FINALFUNC=angle_vectors_stddev_yamartino > ); > > The t

Re: [GENERAL] Include.d and warnings

2015-06-24 Thread Adrian Klaver
On 06/24/2015 07:43 AM, Tom Lane wrote: Andomar writes: We've set up an include directory in postgresql.conf: include_dir = 'conf.d' The include directory has a file that changes the value of "max_connections". Now when we reload Postgres, an error appears in the logs: - para

Re: [GENERAL] DB access speeds, App(linux)<->PG(linux) vs App(linux) <->MSSql(Windows)

2015-06-24 Thread Gauthier, Dave
OK, so there is a DBD for sybase that you are leveraging to interface with the MSSql DB. And that would be roughly equivilent to the DBD for PG in terms of performance. I mentioned odbc because I thought that was the common thread to use to bridge perl to the MSSql DB. ANd I saw that has intr

[GENERAL] checking for NULLS in aggregate

2015-06-24 Thread Seb
Hello, I've defined a function to calculate standard deviation of angular values: CREATE AGGREGATE public.stddev(angle_vectors) ( SFUNC=array_append, STYPE=angle_vectors[], FINALFUNC=angle_vectors_stddev_yamartino ); The type angle_vectors is simply an array: CREATE TYPE public.angle_vect

Re: [GENERAL] native api or odbc?

2015-06-24 Thread Merlin Moncure
On Tue, Jun 23, 2015 at 5:56 PM, Ted Toth wrote: > What are peoples experiences with either/both, pluses/minuses? If you're coding at the C level, I would definitely choose libpq unless you were worried about cross database portability. libpq is a bit clunky but easy to code against. libpq is

Re: [GENERAL] DB access speeds, App(linux)<->PG(linux) vs App(linux) <->MSSql(Windows)

2015-06-24 Thread Francisco Olarte
Hi Dave: On Wed, Jun 24, 2015 at 3:44 PM, Gauthier, Dave wrote: > Hi: I'm trying to get a 10,000 ft understanding of the difference in DB > access speeds for two different scenarios... > Scenario 1: Apps are on linux. PG DB is on linux (different server than > apps) > > Scenario 2: Apps

Re: [GENERAL] DB access speeds, App(linux)<->PG(linux) vs App(linux) <->MSSql(Windows)

2015-06-24 Thread Andy Colson
-Original Message- From: Andy Colson [mailto:a...@squeakycode.net] Sent: Wednesday, June 24, 2015 10:10 AM To: Gauthier, Dave; Postgres General Subject: Re: [GENERAL] DB access speeds, App(linux)<->PG(linux) vs App(linux) <->MSSql(Windows) On 6/24/2015 8:44 AM, Gauthier, Dave wrote: Hi:

Re: [GENERAL] Counting the occurences of a substring within a very large text

2015-06-24 Thread Tom Lane
Marc Mamin writes: > I'd like to count the number linebreaks within a string, > but I get a memory allocation error when using regexp_matches or > regexp_split_to_table. Anything involving a regexp is going to have a maximum input string length of about 256MB, as a result of conversion to pg_w

Re: [GENERAL] DB access speeds, App(linux)<->PG(linux) vs App(linux) <->MSSql(Windows)

2015-06-24 Thread Gauthier, Dave
>>1) The same schema, data on both DB servers? Yes, identical >>2) Are they the same apps? Yes, the same. The only diff is the db connect. >>3) What are the apps doing? The vast, vast majority are small queries, often run inside large programming loops. >>If you fire off lots and lots of small

Re: [GENERAL] Counting the occurences of a substring within a very large text

2015-06-24 Thread Marc Mamin
>>On 24 June 2015 at 14:51, Marc Mamin wrote: >>note that the 345MB text only contains 635 lines. This might be the issue... >There's similar issue discussed here: >http://www.postgresql.org/message-id/6046.1353874...@sss.pgh.pa.us >Tom did seem to accept that the attempted alloc is larger t

Re: [GENERAL] mirroring a server and/or hot standby

2015-06-24 Thread Holger.Friedrich-Fa-Trivadis
John Bleichert wrote on Wednesday, June 24, 2015 4:21 PM: Ø Would I then configure that new server instance as a standby server as per doc section 18.6? Ø Or should I just setup the standby server first? Having re-read 18.6 I think this is what I want. I may be wrong but I’m not sure a maste

Re: [GENERAL] Include.d and warnings

2015-06-24 Thread Tom Lane
Andomar writes: > We've set up an include directory in postgresql.conf: > include_dir = 'conf.d' > The include directory has a file that changes the value of > "max_connections". > Now when we reload Postgres, an error appears in the logs: > - > parameter ""max_connections"" cannot be

Re: [GENERAL] mirroring a server and/or hot standby

2015-06-24 Thread John Bleichert
I use pg_dumpall for regular backups and can definitely use one of those backups to kickstart the new server. Would I then configure that new server instance as a standby server as per doc section 18.6? Or should I just setup the standby server first? Having re-read 18.6 I think this is what I wan

Re: [GENERAL] DB access speeds, App(linux)<->PG(linux) vs App(linux) <->MSSql(Windows)

2015-06-24 Thread Andy Colson
On 6/24/2015 8:44 AM, Gauthier, Dave wrote: Hi: I'm trying to get a 10,000 ft understanding of the difference in DB access speeds for two different scenarios... Scenario 1: Apps are on linux. PG DB is on linux (different server than apps) Scenario 2: Apps are on linux. MSSql DB is on

Re: [GENERAL] DB access speeds, App(linux)<->PG(linux) vs App(linux) <->MSSql(Windows)

2015-06-24 Thread Adrian Klaver
On 06/24/2015 06:44 AM, Gauthier, Dave wrote: Hi: I'm trying to get a 10,000 ft understanding of the difference in DB access speeds for two different scenarios... Scenario 1: Apps are on linux. PG DB is on linux (different server than apps) Scenario 2: Apps are on linux. MSSql DB is

Re: [GENERAL] mirroring a server and/or hot standby

2015-06-24 Thread Holger.Friedrich-Fa-Trivadis
Hello John, Since you mentioned a different OS and want to copy the entire instance it would seem that pg_dumpall is the way to go. You would then import the dump into the new instance using psql. See: http://www.postgresql.org/docs/9.4/static/app-pg-dumpall.html http://www.postgresql.org/docs/

Re: [GENERAL] Counting the occurences of a substring within a very large text

2015-06-24 Thread Geoff Winkless
On 24 June 2015 at 14:51, Marc Mamin wrote: > note that the 345MB text only contains 635 lines. This might be the > issue... > > There's similar issue discussed here: http://www.postgresql.org/message-id/6046.1353874...@sss.pgh.pa.us Tom did seem to accept that the attempted alloc is larger tha

[GENERAL] mirroring a server and/or hot standby

2015-06-24 Thread John Bleichert
Hello All, I am looking for documentation pointers on how to move the contents of an existing/working single-instance server to a new instance. As in: I have a Postgres server running in a VM and I want to move it to a different OS in a different VM guest. Is there a way to gracefully do this? Is

Re: [GENERAL] Counting the occurences of a substring within a very large text

2015-06-24 Thread Marc Mamin
> > > I'd like to count the number linebreaks within a string, but I get > > > a memory allocation error when using regexp_matches or > > regexp_split_to_table. > > > > > > Any idea for an alternative to this problem ? > > > > > > select count(*)-1 from > > > ( select regexp_split_to_table(full_

[GENERAL] DB access speeds, App(linux)<->PG(linux) vs App(linux) <->MSSql(Windows)

2015-06-24 Thread Gauthier, Dave
Hi: I'm trying to get a 10,000 ft understanding of the difference in DB access speeds for two different scenarios... Scenario 1: Apps are on linux. PG DB is on linux (different server than apps) Scenario 2: Apps are on linux. MSSql DB is on Windows (obviously a different server) The

Re: [GENERAL] Include.d and warnings

2015-06-24 Thread Adrian Klaver
On 06/24/2015 02:01 AM, Andomar wrote: We've set up an include directory in postgresql.conf: include_dir = 'conf.d' The include directory has a file that changes the value of "max_connections". Now when we reload Postgres, an error appears in the logs: - parameter ""max_connections""

Re: [GENERAL] Counting the occurences of a substring within a very large text

2015-06-24 Thread Marc Mamin
> -Original Message- > From: Chris Mair [mailto:ch...@1006.org] > Sent: Mittwoch, 24. Juni 2015 13:26 > To: Marc Mamin; Postgres General > Subject: Re: [GENERAL] Counting the occurences of a substring within a > very large text > > > Hello, > > > > I'd like to count the number linebreak

Re: [GENERAL] Counting the occurences of a substring within a very large text

2015-06-24 Thread Marc Mamin
> -Original Message- > From: Albe Laurenz [mailto:laurenz.a...@wien.gv.at] > Sent: Mittwoch, 24. Juni 2015 13:44 > To: Marc Mamin; Postgres General > Subject: RE: Counting the occurences of a substring within a very large > text > > Marc Mamin wrote: > > I'd like to count the number lin

Re: [GENERAL] Counting the occurences of a substring within a very large text

2015-06-24 Thread Andy Colson
On 6/24/2015 5:55 AM, Marc Mamin wrote: Hello, I'd like to count the number linebreaks within a string, but I get a memory allocation error when using regexp_matches or regexp_split_to_table. Any idea for an alternative to this problem ? select count(*)-1 from ( select regexp_split_to_tabl

Re: [GENERAL] Counting the occurences of a substring within a very large text

2015-06-24 Thread Albe Laurenz
Marc Mamin wrote: > I'd like to count the number linebreaks within a string, > but I get a memory allocation error when using regexp_matches or > regexp_split_to_table. > > Any idea for an alternative to this problem ? > > select count(*)-1 from > ( select regexp_split_to_table(full_message,'

Re: [GENERAL] Counting the occurences of a substring within a very large text

2015-06-24 Thread Chris Mair
> Hello, > > I'd like to count the number linebreaks within a string, > but I get a memory allocation error when using regexp_matches or > regexp_split_to_table. > > Any idea for an alternative to this problem ? > > select count(*)-1 from > ( select regexp_split_to_table(full_message,'(\n)'

[GENERAL] Counting the occurences of a substring within a very large text

2015-06-24 Thread Marc Mamin
Hello, I'd like to count the number linebreaks within a string, but I get a memory allocation error when using regexp_matches or regexp_split_to_table. Any idea for an alternative to this problem ? select count(*)-1 from ( select regexp_split_to_table(full_message,'(\n)', 'g') from myta

[GENERAL] Include.d and warnings

2015-06-24 Thread Andomar
We've set up an include directory in postgresql.conf: include_dir = 'conf.d' The include directory has a file that changes the value of "max_connections". Now when we reload Postgres, an error appears in the logs: - parameter ""max_connections"" cannot be changed without restarting t

Re: [GENERAL]

2015-06-24 Thread Albe Laurenz
Bruno Hass de Andrade wrote: > Hi. My company have servers that run postgres for storing some logs and > serving django web interfaces > for management of the server itself. In the last days some servers stopped > serving the web interface, > and syslog show this error: > > Jun 23 04:40:19