Re: [GENERAL] Transaction ID Wraparound Monitoring

2015-07-30 Thread Adrian Klaver
On 07/30/2015 02:55 AM, Jan Keirse wrote: Hello, we have some very write heavy databases and I have our monitoring system watch the transaction age of my databases to be alerted before we get into problems in case autovacuum can't keep up to avoid transaction ID wraparound. The query I am

Re: [GENERAL] Logical decoding off of a replica?

2015-07-30 Thread Curt Micol
Great, thank you for the response! On Thu, Jul 30, 2015 at 7:33 AM, Andres Freund and...@anarazel.de wrote: On 2015-07-28 17:54:57 +, Curt Micol wrote: Hello, I've been working to get a replica setup to perform logical decoding and haven't been able to get the right configuration. I've

Re: [GENERAL] user connection not recorded?

2015-07-30 Thread Melvin Davidson
Thanks for the quick reply Adrian. On Thu, Jul 30, 2015 at 10:09 AM, Adrian Klaver adrian.kla...@aklaver.com wrote: On 07/30/2015 06:42 AM, Melvin Davidson wrote: I have a puzzling question. All through the error log, there are connections for [unknown] user. EG: 2015-07-30 00:00:00

[GENERAL] Exclusively locking parent tables while disinheriting children.

2015-07-30 Thread Rowan Collins
Hi, When working with partition sets, we're seeing occasional errors of could not find inherited attribute... in Select queries. This is apparently caused when an ALTER TABLE ... NO INHERIT runs concurrently with another transaction selecting from the relevant child table. I found an old

Re: [GENERAL] [ADMIN] How Many PG_Locks are considered too many

2015-07-30 Thread Peter Eisentraut
On 7/30/15 6:13 AM, Renato Oliveira wrote: We have a Nagios plugin, which monitors pg_locks and almost daily we see 3000 to 4 pg_locks. Can we just ignore them, can we let them grow without worrying? How many pg_locks are considered unsafe for any given postgres server? That depends

Re: [GENERAL] [ADMIN] How Many PG_Locks are considered too many

2015-07-30 Thread Renato Oliveira
Peter thank you much appreciated Sent from my iPhone On 30 Jul 2015, at 14:54, Peter Eisentraut pete...@gmx.net wrote: On 7/30/15 6:13 AM, Renato Oliveira wrote: We have a Nagios plugin, which monitors pg_locks and almost daily we see 3000 to 4 pg_locks. Can we just ignore them, can

[GENERAL] user connection not recorded?

2015-07-30 Thread Melvin Davidson
I have a puzzling question. All through the error log, there are connections for [unknown] user. EG: 2015-07-30 00:00:00 CDT [6577]: [1-1]: : [unknown]: LOG: connection received: host=173.239.101.98 port=50687 The log_line_prefix is %t [%p]: [%l-1]: %h: %u: I can understand that the host is

Re: [GENERAL] user connection not recorded?

2015-07-30 Thread Adrian Klaver
On 07/30/2015 07:21 AM, Tom Lane wrote: Adrian Klaver adrian.kla...@aklaver.com writes: On 07/30/2015 06:42 AM, Melvin Davidson wrote: I can understand that the host is not available in nslookup, but why is the user not being recorded? A quick look at the source shows that Postgres system

Re: [GENERAL] Transaction ID Wraparound Monitoring

2015-07-30 Thread Jan Keirse
On Thu, Jul 30, 2015 at 2:56 PM, Adrian Klaver adrian.kla...@aklaver.com wrote: On 07/30/2015 02:55 AM, Jan Keirse wrote: Hello, we have some very write heavy databases and I have our monitoring system watch the transaction age of my databases to be alerted before we get into problems in

Re: [GENERAL] [ADMIN] How Many PG_Locks are considered too many

2015-07-30 Thread John Scalia
Seconding Peter on this one; it's a lot more important should one of those locks be hanging around, say for hours or days, not how many have come and gone. -- Jay On Thu, Jul 30, 2015 at 8:57 AM, Renato Oliveira renato.olive...@cantabcapital.com wrote: Peter thank you much appreciated Sent

Re: [GENERAL] user connection not recorded?

2015-07-30 Thread Tom Lane
Adrian Klaver adrian.kla...@aklaver.com writes: Eventually got around to figuring that. So just for my reference, the code snippet I showed from postinit.c seems to show a path where a username is not used but is substituted with BOOTSTRAP_SUPERUSERID. That's single-user mode. Am I

Re: [GENERAL] user connection not recorded?

2015-07-30 Thread Adrian Klaver
On 07/30/2015 07:46 AM, Tom Lane wrote: Adrian Klaver adrian.kla...@aklaver.com writes: Eventually got around to figuring that. So just for my reference, the code snippet I showed from postinit.c seems to show a path where a username is not used but is substituted with BOOTSTRAP_SUPERUSERID.

Re: [GENERAL] user connection not recorded?

2015-07-30 Thread Adrian Klaver
On 07/30/2015 07:12 AM, Melvin Davidson wrote: Thanks for the quick reply Adrian. Further testing shows this can happen in other situations. So: aklaver@panda:~ psql -d test psql (9.4.2) Type help for help. test= where trust is set up for local connections yields: [unknown]-2015-07-30

Re: [GENERAL] user connection not recorded?

2015-07-30 Thread Tom Lane
Adrian Klaver adrian.kla...@aklaver.com writes: Alright, but the part that has me confused is this comment in the code: * In standalone mode and in autovacuum worker processes, we use a fixed * ID, otherwise we figure it out from the authenticated user name. and this else if

Re: [GENERAL] instr detail

2015-07-30 Thread Ramesh T
select position('.' in '.T.homas') result 1 it returns first postion.but I need last occurence of ' . ' . actual result -- 3 any help..?appreciated. On Thu, Jul 30, 2015 at 5:00 AM, Tom Lane t...@sss.pgh.pa.us wrote: Melvin Davidson melvin6...@gmail.com writes: Based om the

Re: [GENERAL] instr detail

2015-07-30 Thread Ramesh T
here is the example tks help.. http://stackoverflow.com/questions/2965655/how-to-find-the-first-and-last-occurrences-of-a-specific-character-inside-a-stri On Thu, Jul 30, 2015 at 7:38 PM, Ramesh T rameshparnandit...@gmail.com wrote: select position('.' in '.T.homas') result 1 it

Re: [GENERAL] Question about copy from with timestamp format

2015-07-30 Thread Alban Hertroys
On 30 Jul 2015, at 17:59, Sherrylyn Branchaw sbranc...@gmail.com wrote: From here: http://www.postgresql.org/docs/9.4/interactive/sql-copy.html COPY can only be used with plain tables, not with views. However, you can write COPY (SELECT * FROM viewname) TO Right, so you can

[GENERAL] PSA: linux kernel bug in TRIM support corrupts data with md raid levels 0 and 10

2015-07-30 Thread Merlin Moncure
http://www.spinics.net/lists/raid/msg49452.html (via slashdot) merlin -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general

Re: [GENERAL] Lots of stuck queries after upgrade to 9.4

2015-07-30 Thread Tatsuo Ishii
Heikki, A-ha, I succeeded to reproduce this now on my laptop, with pgbench! It seems to be important to have a very large number of connections: pgbench -n -c400 -j4 -T600 -P5 That got stuck after a few minutes. I'm using commit_delay=100. Because the original reporter seems to have

Re: [GENERAL] Lots of stuck queries after upgrade to 9.4

2015-07-30 Thread Scott Marlowe
You might want to try pg replay: http://laurenz.github.io/pgreplay/ On Thu, Jul 30, 2015 at 7:23 AM, Spiros Ioannou siv...@inaccess.com wrote: I'm very sorry but we don't have a synthetic load generator for our testing setup, only production and that is on SLA. I would be happy to test the

Re: [GENERAL] Question about copy from with timestamp format

2015-07-30 Thread Sherrylyn Branchaw
From here: http://www.postgresql.org/docs/9.4/interactive/sql-copy.html COPY can only be used with plain tables, not with views. However, you can write COPY (SELECT * FROM viewname) TO Right, so you can COPY FROM a view, but not, as far as I can tell, TO a view, unless Alban found a

Re: [GENERAL] Question about copy from with timestamp format

2015-07-30 Thread Adrian Klaver
On 07/30/2015 08:44 AM, Sherrylyn Branchaw wrote: I was thinking that perhaps an updatable view might do the trick? Interesting idea! Are you able to get it to work? I keep getting 'ERROR: cannot copy to view view_ts_test' even before my trigger fires. Inserting, though, works fine. From

Re: [GENERAL] Question about copy from with timestamp format

2015-07-30 Thread Adrian Klaver
On 07/30/2015 08:59 AM, Sherrylyn Branchaw wrote: From here: http://www.postgresql.org/docs/9.4/interactive/sql-copy.html COPY can only be used with plain tables, not with views. However, you can write COPY (SELECT * FROM viewname) TO Right, so you can COPY FROM a view, but not, as far

Re: [GENERAL] Logical decoding off of a replica?

2015-07-30 Thread Andres Freund
On 2015-07-28 17:54:57 +, Curt Micol wrote: Hello, I've been working to get a replica setup to perform logical decoding and haven't been able to get the right configuration. I've tried everything I can think of. While researching I found this post on Stack Overflow:

Re: [GENERAL] Transaction ID Wraparound Monitoring

2015-07-30 Thread Adrian Klaver
On 07/30/2015 08:41 AM, Jan Keirse wrote: On Thu, Jul 30, 2015 at 2:56 PM, Adrian Klaver adrian.kla...@aklaver.com wrote: On 07/30/2015 02:55 AM, Jan Keirse wrote: Hello, we have some very write heavy databases and I have our monitoring system watch the transaction age of my databases to be

Re: [GENERAL] Question about copy from with timestamp format

2015-07-30 Thread Sherrylyn Branchaw
I was thinking that perhaps an updatable view might do the trick? Interesting idea! Are you able to get it to work? I keep getting 'ERROR: cannot copy to view view_ts_test' even before my trigger fires. Inserting, though, works fine. Still curious why the triggers I'm writing won't fire before

Re: [GENERAL] Question about copy from with timestamp format

2015-07-30 Thread Adrian Klaver
On 07/30/2015 08:59 AM, Sherrylyn Branchaw wrote: From here: http://www.postgresql.org/docs/9.4/interactive/sql-copy.html COPY can only be used with plain tables, not with views. However, you can write COPY (SELECT * FROM viewname) TO Right, so you can COPY FROM a view, but not, as far

Re: [GENERAL] Lots of stuck queries after upgrade to 9.4

2015-07-30 Thread Spiros Ioannou
That would need a replica of the data probably which is not possible (tablespace is 4TB). *Spiros Ioannou IT Manager, inAccesswww.inaccess.com http://www.inaccess.comM: +30 6973-903808T: +30 210-6802-358* On 30 July 2015 at 21:47, Scott Marlowe scott.marl...@gmail.com wrote: You might

Re: [GENERAL] [ADMIN] How Many PG_Locks are considered too many

2015-07-30 Thread Merlin Moncure
On Thu, Jul 30, 2015 at 9:19 AM, John Scalia jayknowsu...@gmail.com wrote: Seconding Peter on this one; it's a lot more important should one of those locks be hanging around, say for hours or days, not how many have come and gone. Also, it's good to focus on *ungranted* locks. Typically the

[GENERAL] Transaction ID Wraparound Monitoring

2015-07-30 Thread Jan Keirse
Hello, we have some very write heavy databases and I have our monitoring system watch the transaction age of my databases to be alerted before we get into problems in case autovacuum can't keep up to avoid transaction ID wraparound. The query I am executing is this: SELECT

Re: [GENERAL] Question about copy from with timestamp format

2015-07-30 Thread Alban Hertroys
On 30 Jul 2015, at 2:27, Sherrylyn Branchaw sbranc...@gmail.com wrote: Based on your PS asking about data types and commenting that you don't want to put hour in a separate column, it sounds like this is a brand-new table you're creating. If so, and if this is a one-time COPY operation,

[GENERAL] How Many PG_Locks are considered too many

2015-07-30 Thread Renato Oliveira
Hi I have few questions, if anyone could help me, it will be very much appreciated. We have a Nagios plugin, which monitors pg_locks and almost daily we see 3000 to 4 pg_locks. Can we just ignore them, can we let them grow without worrying? How many pg_locks are considered unsafe for any