Re: [GENERAL] text_pattern_ops index not being used for prefix query

2016-10-21 Thread Alexander Staubo
On 20 Oct 2016, at 23:37, Maxim Boguk wrote: > ​Underscore in like pattern have a special meaning of "any symbol". > From documentation on the > https://www.postgresql.org/docs/9.4/static/functions-matching.html : > "An underscore (_) in pattern stands for (matches) any single character;" > This

[GENERAL] Replication rolling back to normal.

2016-10-21 Thread Dasitha Karunajeewa
Dear Team, I have installed PostgreSQL 9.6 on two servers. One is master and other is for slave server. Current setup as follows. - Master Server - pgmaster - Salve Server - pgslave To implement this I have followed this article https://www.digitalocean.com/community/tutorials/how-to-set-

Re: [GENERAL] Showing matrix with single query

2016-10-21 Thread Арсений Нестюк
On Fri, Oct 21, 2016 at 2:45 AM, David G. Johnston < david.g.johns...@gmail.com> wrote: > On Thu, Oct 20, 2016 at 3:35 PM, Арсений Нестюк > wrote: > >> >> I haven't thought about casting null before, it's interesting. It'll make >> the implementation a little easier, but won't answer my question

Re: [GENERAL] checkpoint write errors

2016-10-21 Thread Tom Lane
CS DBA writes: > we're seeing the below errors over and over in the logs of one of our > postgres databases. Version 8.4.22 [ you really oughta get off 8.4, but you knew that right? ] > Anyone have any thoughts on correcting/debugging it? > ERROR: xlog flush request 2571/9C141530 is not satis

Re: [GENERAL] Large empty table, balanced INSERTs and DELETEs, not being vacuumed

2016-10-21 Thread Vick Khera
On Fri, Oct 21, 2016 at 4:53 PM, Jason Dusek wrote: > This is really only a temporary fix, though. We can have a cron job running > in the background running TRUNCATE ONLY ... but this seems like the kind of > thing that auto-vacuuming should have handled for us, before the problem got > “too larg

[GENERAL] Large empty table, balanced INSERTs and DELETEs, not being vacuumed

2016-10-21 Thread Jason Dusek
Hi All, I recently came across an interesting problem relating vacuuming, triggers and table partitioning. We have a “virtual table” with a BEFORE trigger that redirects writes to its child tables. This was all fine well and good until we wanted to use RETURNING to get the id back — the trigger r

Re: [GENERAL] Doubts about replication from many servers

2016-10-21 Thread Adrian Klaver
On 10/21/2016 08:09 AM, Edilmar LISTAS wrote: Hi, I have 4 PG servers where each one runs many databases. Now, I would like to create just one PG backup server to replicate all the databases from 4 PG servers, is it possible? Or Do I need to create 4 PG backup servers? More information is nee

[GENERAL] checkpoint write errors

2016-10-21 Thread CS DBA
Hi all; we're seeing the below errors over and over in the logs of one of our postgres databases. Version 8.4.22 Anyone have any thoughts on correcting/debugging it? Maybe I need to run a REINDEX on whatever table equates to "base/1029860192/1029863651"? If so how do I determine the db and

Re: [GENERAL] Doubts about replication from many servers

2016-10-21 Thread Cachique
Hi. You mean one and only one big cluster with all databases from your 4 PG servers ? What about running 4 clusters (different ports) in your backup server and each taking replication from your master servers. Regards, Walter On Fri, Oct 21, 2016 at 12:09 PM, Edilmar LISTAS wrote: > Hi, > > I h

[GENERAL] Best way to find last data sample before a given time

2016-10-21 Thread George Woodring
We have a plpsql function that checks a threshold for a given data point that seems to work well. The goal of the function is to find the last sample before or equal to a given time. The function runs the following sql command SELECT outval >= 187500 FROM rrd.d_current WHERE timeslot <= TO

[GENERAL] Doubts about replication from many servers

2016-10-21 Thread Edilmar LISTAS
Hi, I have 4 PG servers where each one runs many databases. Now, I would like to create just one PG backup server to replicate all the databases from 4 PG servers, is it possible? Or Do I need to create 4 PG backup servers? And if some PG server goes down, how to recovery the system from PG

Re: [GENERAL] Cannot delete role because it depends on "default privileges"

2016-10-21 Thread Durumdara
Wow... I found it. The postgres database contained more default privs. But PGAdmin III nothing say about dependents in it's reports. Thanks! 2016-10-21 16:19 GMT+02:00 Durumdara : > Dear Tom! > > Is there any tool what can show me the dependents or dependencies? > > In PGAdmi

Re: [GENERAL] Cannot delete role because it depends on "default privileges"

2016-10-21 Thread Durumdara
Dear Tom! Is there any tool what can show me the dependents or dependencies? In PGAdmin I don't see any dependencies or dependents... :-( Thanks dd 2016-10-21 16:08 GMT+02:00 Tom Lane : > Durumdara writes: > > The DB_X dropped, so I can't choose it as "actual database". > > I tried this in

Re: [GENERAL] Cannot delete role because it depends on "default privileges"

2016-10-21 Thread Tom Lane
Durumdara writes: > The DB_X dropped, so I can't choose it as "actual database". > I tried this in a neutral database: > drop owned by role_x; > But nothing happened, the error is same. The error you are reporting is describing default privileges that exist in the *current* database. You nee

Re: [GENERAL] Cannot delete role because it depends on "default privileges"

2016-10-21 Thread Durumdara
Dear Tom! The DB_X dropped, so I can't choose it as "actual database". I tried this in a neutral database: drop owned by role_x; But nothing happened, the error is same. As I read it have "CASCADE" mode, but I'm afraid to start it, because I don't know what will happen. It is a really use

Re: [GENERAL] Cannot delete role because it depends on "default privileges"

2016-10-21 Thread Tom Lane
Durumdara writes: > We have a ROLE_MAIN. > This gave default privileges to all next objects in DB_X to ROLE_X. > Somebody dropped DB_X, and later he tried to drop ROLE_X. > But he got errors in PGAdmin. > ERROR: role "role_x" cannot be dropped because some objects depend on it > DETAIL: privileg

Re: [GENERAL] Selecting records with highest timestamp - for a join

2016-10-21 Thread Alexander Farber
Please let me rephrase my question so that it is better understandable - In PostgreSQL 9.5.3 I keep player infos from various social networks: # TABLE words_social; sid | social | female | given | family | photo | place | stamp| uid ---+++-++---+

[GENERAL] Cannot delete role because it depends on "default privileges"

2016-10-21 Thread Durumdara
Hello! We created a DB named DB_X, and a role ROLE_X. We have a ROLE_MAIN. This gave default privileges to all next objects in DB_X to ROLE_X. Somebody dropped DB_X, and later he tried to drop ROLE_X. But he got errors in PGAdmin. --- pgAdmin III

Re: [GENERAL] out-of-order XID insertion in KnownAssignedXids

2016-10-21 Thread Kevin Grittner
On Thu, Oct 20, 2016 at 8:21 AM, wrote: > Version : 9.2.13 You are missing over a year's worth of bug fixes. https://www.postgresql.org/support/versioning/ > - remove a file called backup_label http://tbeitr.blogspot.com/2015/07/deleting-backuplabel-on-restore-will.html -- Kevin Grittne

[GENERAL] sending records from one function to other with dblink

2016-10-21 Thread Jaisingkar, Piyush
Hello, I currently have two functions, one on local side and one on remote. The local function creates the dblink with all the required parameters, then using dblink() function I call the remote function. For the parameters of remote function I want to pass an array of records, I create this ar

Re: [GENERAL] Sequences / Replication

2016-10-21 Thread Albe Laurenz
Jonathan Eastgate wrote: > We're seeing some odd behaviour from a PostgreSQL group - one running as > primary and the other as a > hot slave using streaming replication. > > When a failover event occurs and we switch to the hot slave as primary > sequences in tables jump by 33 > - so where the l

Re: [GENERAL] Postgres upgrade from 9.4.9 to 9.6 using pg_upgrade error

2016-10-21 Thread wd
On Wed, Oct 19, 2016 at 6:15 AM, Ashish Chauhan wrote: > *2016-10-18 22:11:30 UTC [13107-1] FATAL: database files are incompatible > with server* > > *2016-10-18 22:11:30 UTC [13107-2] DETAIL: The data directory was > initialized by PostgreSQL version 9.6, which is not compatible with this > ve