Re: [GENERAL] Using cp to back up a database?

2017-10-09 Thread Jeff Janes
On Mon, Oct 9, 2017 at 6:40 AM, Ron Johnson wrote: > Hi, > > v8.4.20 > > This is what the current backup script uses: > > /usr/bin/psql -U postgres -c "SELECT pg_start_backup(' > Incrementalbackup',true);" > cp -r /var/lib/pgsql/data/* $dumpdir/data/ > /usr/bin/psql -U

Re: [GENERAL] Using cp to back up a database?

2017-10-09 Thread Achilleas Mantzios
ntzios IT DEV Lead IT DEPT Dynacom Tankers Mgmt -- 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] Using cp to back up a database?

2017-10-09 Thread Ron Johnson
rom: *<pgsql-general-ow...@postgresql.org> on behalf of Ron Johnson <ron.l.john...@cox.net> *Date: *Monday, October 9, 2017 at 8:41 AM *To: *"pgsql-general@postgresql.org" <pgsql-general@postgresql.org> *Subject: *[GENERAL] Using cp to back up a database? Hi, v8.4.20

Re: [GENERAL] Using cp to back up a database?

2017-10-09 Thread Michael Paquier
eam : do not use pg_dump for > backups :) It depends on what you are trying to achieve, pg_dump can be fine for small-ish databases. By relying on both logical (pg_dump) and physical backups (base backups) brings more insurance in face of a disaster. -- Michael -- Sent via pgsql-general

Re: [GENERAL] Using cp to back up a database?

2017-10-09 Thread Achilleas Mantzios
ler> Phone: +1 214-642-9640 E-Mail: l...@lerctr.org <mailto:l...@lerctr.org> US Mail: 5708 Sabbia Drive, Round Rock, TX 78665-2106 *From: *<pgsql-general-ow...@postgresql.org> on behalf of Ron Johnson <ron.l.john...@cox.net> *Date: *Monday, October 9, 2017

Re: [GENERAL] Using cp to back up a database?

2017-10-09 Thread Melvin Davidson
e: +1 214-642-9640 <(214)%20642-9640> E-Mail: > l...@lerctr.org > > US Mail: 5708 Sabbia Drive, Round Rock, TX 78665 > <https://maps.google.com/?q=5708+Sabbia+Drive,+Round+Rock,+TX+78665=gmail=g> > -2106 > > > > > > *From: *<pgsql-general-ow...@

Re: [GENERAL] Using cp to back up a database?

2017-10-09 Thread Larry Rosenman
sql-general-ow...@postgresql.org> on behalf of Ron Johnson <ron.l.john...@cox.net> Date: Monday, October 9, 2017 at 8:41 AM To: "pgsql-general@postgresql.org" <pgsql-general@postgresql.org> Subject: [GENERAL] Using cp to back up a database? Hi, v8.4.20 This is what th

Re: [GENERAL] Equivalence Classes when using IN

2017-10-09 Thread Tom Lane
f you'd like joins to the view to be optimized, you don't want an ORDER BY in there. regards, tom lane -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general

[GENERAL] Using cp to back up a database?

2017-10-09 Thread Ron Johnson
Hi, v8.4.20 This is what the current backup script uses: /usr/bin/psql -U postgres -c "SELECT pg_start_backup('Incrementalbackup',true);" cp -r /var/lib/pgsql/data/* $dumpdir/data/ /usr/bin/psql -U postgres template1 -c "SELECT pg_stop_backup();" Should it use rsync or pg_dump instead?

[GENERAL] Error: "cached plan must not change result type"

2017-10-09 Thread Durumdara
Dear Members! At Friday one of our clients got this error: "cached plan must not change result type" He restarted the application and the problem vanished. We used PGDAC to access the database. Firstly we didn't know nothing about this kind of error. But later we realized that

Re: [GENERAL] Equivalence Classes when using IN

2017-10-09 Thread David Rowley
mer_id) to parameterise the nested loop, at least, it likely would, if you have one. It's pretty bad practice to have ORDER BY in views. I kinda wish we didn't even allow it, but that ship sailed many years ago... -- David Rowley http://www.2ndQuadrant.com/ PostgreSQL Deve

Re: [GENERAL] Equivalence Classes when using IN

2017-10-09 Thread Kim Rose Carlsen
from the view using IN clause, now I'm not so sure anymore. I can see there is a trade off between planner time and how exotic the case is. If you want to be able to hide abstraction through views I guess the nature becomes more OLAP oriented than OLTP. Best Regards Kim Carlsen --

Re: [GENERAL] OR-clause support for indexes

2017-10-09 Thread David Rowley
velopment, 24x7 Support, Training & Services -- 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] Automatically check for anti-patterns in SQL queries

2017-10-09 Thread Thomas Kellerer
sqlcheck -h simply does nothing. The program briefly starts (I can see the title of my cmd.exe changed) but then exists immediately without even showing the help. Something like "sqlcheck -f test.sql" also shows no result at all (no error message, no output, nothing) Regards T

[GENERAL] https://www.postgresql.org/ftp/source/v10.0/ distribution IS different than git tag REL_10_0

2017-10-08 Thread Andre Mikulec
>From git, tag REL_10_0, using MINGW64, when I /configure make install I get back the successfully messages. All of PostgreSQL successfully made. Ready to install. PostgreSQL installation complete. The git "src\interfaces\libpq" directory has 28 entries. dir

Re: [GENERAL] Equivalence Classes when using IN

2017-10-08 Thread Tom Lane
l.gmail.com which suggests being able to simplify "a IN somelist AND a IN someotherlist". If we wanted to do that, making the "lists" be treatable as eclass members would be a good place to start, because that would naturally result in intersect-able lists ending up in the same eclass.

Re: [GENERAL] Equivalence Classes when using IN

2017-10-08 Thread David Rowley
ning & Services -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general

[GENERAL] Equivalence Classes when using IN

2017-10-08 Thread Kim Rose Carlsen
Hi I have this query where I think it's strange that the join doesn't pull the where condition in since RHS is equal to LHS. It might be easier to expain with an example Setup CREATE TABLE customer ( customer_id INTEGER PRIMARY KEY ); CREATE

Re: [GENERAL] delete a file everytime pg server starts/crashes

2017-10-08 Thread Melvin Davidson
. > > @Melvin Does this capture all failure scenarios?? Or you have any other > better ways to do it. Your comments are much appreciated !! > > > > -- > Sent from: http://www.postgresql-archive.org/PostgreSQL-general- > f1843780.html > > > -- > Sent via pgsql-gene

Re: [GENERAL] delete a file everytime pg server starts/crashes

2017-10-08 Thread athinivas
comments are much appreciated !! -- Sent from: http://www.postgresql-archive.org/PostgreSQL-general-f1843780.html -- 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] delete a file everytime pg server starts/crashes

2017-10-08 Thread Melvin Davidson
Athi > > > > -- > Sent from: http://www.postgresql-archive.org/PostgreSQL-general- > f1843780.html > > > -- > 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] delete a file everytime pg server starts/crashes

2017-10-08 Thread athinivas
Hi, Thank you...will try it :) ...As of now, I'm creating the filename as pg_start_time so that, every time the server is up, a new file will be created. Regards, Athi -- Sent from: http://www.postgresql-archive.org/PostgreSQL-general-f1843780.html -- Sent via pgsql-general mailing list

[GENERAL] Automatically check for anti-patterns in SQL queries

2017-10-08 Thread Joy Arulraj
Hi folks -- We developed a static analysis tool, called SQLCheck, for automatically identifying anti-patterns in SQL queries. https://github.com/jarulraj/sqlcheck Our goal is to provide hints to the developers about potential performance and security issues present in SQL queries. I believe that

[GENERAL] OR-clause support for indexes

2017-10-08 Thread Andreas Joseph Krogh
Hi.   There was a while ago a proposed patch for adding $subject; https://commitfest.postgresql.org/8/454/   Is this being worked on? Any progress in btree-support? -- Andreas Joseph Krogh

Re: [GENERAL] a JOIN to a VIEW seems slow

2017-10-08 Thread Frank Millman
On 7 October 2017 at 2:49 PM, David Rowley wrote: > > Yeah, PostgreSQL does not make any effort to convert subqueries in the > target list into joins. SQL server does. [...] > You'll probably find it'll run faster if you convert the subquery in > the target list into a join with a GROUP BY,

[GENERAL] table partition problem

2017-10-07 Thread Hung Phan
Hi, I intend to create 2 partitions called New and Old of a table. An automatic job will check if a record is older than 90 days from current time (based on a field), it will move the record from New to Old. The problem is that I cannot control which partition a select statement with range

Re: [GENERAL] a JOIN to a VIEW seems slow

2017-10-07 Thread David Rowley
ow_id GROUP BY c.due_row_id ) c ON c.due_row_id = a.row_id; SQL Server will probably be doing this rewrite. -- David Rowley http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training & Services -- Sent via pgsql-general mailing list (pgsql-general@pos

Re: [GENERAL] a JOIN to a VIEW seems slow

2017-10-07 Thread Frank Millman
On 5 Oct 2017, at 9:51 AM, Frank Millman wrote: > > I should have re-stated the reason for my original post. > > Exactly the same query, on exactly the same data, takes 1.8 seconds on Sql > Server, 1.0 seconds on SQLite3, and 1607 seconds, or 26 minutes, on > PostgreSQL 9.4.4. > I will

[GENERAL] phpPgAdmin 6 on a MAC (High Sierra)

2017-10-06 Thread Jerry Levan
anyone been to get phpPgAdmin working on a Mac running High Sierra? Thanks for any info... Trapped in Steve Jobs Reality Distortion Field -- 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] Functions and Parentheses

2017-10-06 Thread Igal @ Lucee.org
On 10/6/2017 3:10 PM, Joshua D. Drake wrote: On 10/06/2017 02:33 PM, Tom Lane wrote: "Igal @ Lucee.org" writes: How come `current_date` has no parenthesis but `clock_timestamp()` does? Because the SQL standard says that CURRENT_DATE doesn't have parentheses. It is a

Re: [GENERAL] Functions and Parentheses

2017-10-06 Thread Joshua D. Drake
* -- 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] Functions and Parentheses

2017-10-06 Thread Tom Lane
acquainted with any principles of programming language syntax design that emerged later than the COBOL era. Their capacity to invent new and non-orthogonal syntax for every new feature seems boundless.) regards, tom lane -- Sent via pgsql-general mailing list (pgsql-gen

Re: [GENERAL] Functions and Parentheses

2017-10-06 Thread David G. Johnston
On Fri, Oct 6, 2017 at 2:18 PM, Igal @ Lucee.org wrote: > Hi, > > Is current_date a function? It's a bit puzzling to me since there are no > parentheses after it, i.e. > > SELECT current_date; > > And not > > SELECT current_date(); -- syntax error > ​ It, and the others

[GENERAL] Functions and Parentheses

2017-10-06 Thread Igal @ Lucee.org
Hi, Is current_date a function?  It's a bit puzzling to me since there are no parentheses after it, i.e.   SELECT current_date; And not   SELECT current_date();  -- syntax error How come `current_date` has no parenthesis but `clock_timestamp()` does? Thanks, Igal Sapir Lucee Core

Re: [GENERAL] Strange checkpoint behavior - checkpoints take a long time

2017-10-06 Thread Vladimir Nicolici
Further updates: Yesterday checkpoints were finishing more or less on time with the configuration for 25 minutes out of 30 minutes, taking 26 minutes at most. So for today I reduced the time reserved for checkpoint writes to 20 minutes out of 30 minutes, by setting checkpoint_completion_target

Re: [GENERAL] delete a file everytime pg server starts/crashes

2017-10-06 Thread pinker
from: http://www.postgresql-archive.org/PostgreSQL-general-f1843780.html -- 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] Postgresql CDC tool recommendations ?

2017-10-06 Thread Nico Williams
I expect this to improve with PG 10 logical replication. You can easily add the bit that pushes those JSON texts to Kafka. Nico -- -- 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] delete a file everytime pg server starts/crashes

2017-10-06 Thread pinker
Look at inotify: https://github.com/rvoicilas/inotify-tools You can check for instance if postmaster.pid exists. -- Sent from: http://www.postgresql-archive.org/PostgreSQL-general-f1843780.html -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your

Re: [GENERAL] compiling postgres_fdw fails for 9.6.5

2017-10-06 Thread Tom Lane
.h: > No such file or directory Try building the core code first. regards, tom lane -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general

[GENERAL] Connection utilisation for pglogical

2017-10-06 Thread Rory Campbell-Lange
max_worker_processes, 200 max_replication_slots and 200 max_wal_senders? Does this translate into 200 actual database connections? Thanks for any advice Rory -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org

[GENERAL] compiling postgres_fdw fails for 9.6.5

2017-10-06 Thread Sandeep Gupta
way which would not require this modification. Thanks. -- 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] Regarding scram authentication libpq version 10 or more

2017-10-06 Thread Durgamahesh Manne
On Fri, Oct 6, 2017 at 5:56 PM, Michael Paquier wrote: > On Fri, Oct 6, 2017 at 8:56 PM, Durgamahesh Manne > wrote: > > i have already read complete info about New Postgres 10 in postgres.org > and > > i have tried to access server by

Re: [GENERAL] Regarding scram authentication libpq version 10 or more

2017-10-06 Thread Michael Paquier
No idea. You may be using multiple versions of PostgreSQL in parallel, and the client you are using may not be the client you think it is. I suggest that you check the infrastructure of your host as well as the package repository you are using. Good luck. -- Michael -- Sent via pgsql

Re: [GENERAL] Regarding scram authentication libpq version 10 or more

2017-10-06 Thread Durgamahesh Manne
On Fri, Oct 6, 2017 at 3:40 PM, Michael Paquier wrote: > On Fri, Oct 6, 2017 at 5:44 PM, Durgamahesh Manne > wrote: > > This is regarding scram authentication libpq version 10. From which > site i > > can download to configure libpq in

Re: [GENERAL] Regarding scram authentication libpq version 10 or more

2017-10-06 Thread Michael Paquier
#auth-password Basically you need to consider using password_encryption = 'scram-sha-256', and configure pg_hba.conf with a correct entry. If you are upgrading from an existing instance, you need to make sure that users with passwords are updated with proper SCRAM-hashed entries. -- Michael -- Sent via

[GENERAL] Regarding scram authentication libpq version 10 or more

2017-10-06 Thread Durgamahesh Manne
Hi sir This is regarding scram authentication libpq version 10. From which site i can download to configure libpq in order to use scram authentication in postgres 10 i got below error while i check to access pg server psql.bin: SCRAM authentication requires libpq version 10 or more please

Re: [GENERAL] delete a file everytime pg server starts/crashes

2017-10-06 Thread vinny
/PostgreSQL-general-f1843780.html -- 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] Strange checkpoint behavior - checkpoints take a longtime

2017-10-05 Thread Andres Freund
ay, and I plan to test > something else tomorrow. > > Thanks for the suggestions, and sorry for the reply style, but my mail > client is not best suited for replying inline to individual points. You should consider getting a new mail client then... - Andres -- Sent via pgsql-genera

Re: [GENERAL] Strange checkpoint behavior - checkpoints take a longtime

2017-10-05 Thread Vladimir Nicolici
: Friday, October 6, 2017 04:51 To: Vladimir Nicolici Cc: pgsql-general@postgresql.org Subject: Re: [GENERAL] Strange checkpoint behavior - checkpoints take a longtime Hi, On 2017-10-05 22:58:31 +0300, Vladimir Nicolici wrote: > I changed some configuration parameters during the night to the value

Re: [GENERAL] Strange checkpoint behavior - checkpoints take a long time

2017-10-05 Thread Andres Freund
o help. You might want to try also enabling wal_compression, sometimes the WAL volume is a considerable problem. I'd suggest reporting some "pidstat -dl 1" output, so we can see which processes are doing how much IO. Regards, Andres -- Sent via pgsql-general mailing list (pgsql

Re: [GENERAL] Strange checkpoint behavior - checkpoints take a longtime

2017-10-05 Thread Vladimir Nicolici
mbination, I will probably set it to something like 0.90 target, so that it distributes the writes over 27 minutes. Thanks, Vlad From: Igor Polishchuk Sent: Friday, October 6, 2017 02:56 To: Vladimir Nicolici Cc: pgsql-general@postgresql.org Subject: Re: [GENERAL] Strange checkpoint behavior - chec

Re: [GENERAL] Strange checkpoint behavior - checkpoints take a long time

2017-10-05 Thread Igor Polishchuk
Vladimir, Just curious, if your goal is to reduce checkpoint overhead, shouldn’t you decrease shared_buffers instead of increasing it? With bigger shared_buffers, you can accumulate more dirty buffers for checkpoint to take care. I remember in early versions ( around 8.4), when

Re: [GENERAL] Strange checkpoint behavior - checkpoints take a long time

2017-10-05 Thread Vladimir Nicolici
Some further updates about the issue. I did a bit of benchmarking on the disk system with iozone, and the during the test the SSDs seemed to be able to easily sustain 200 MB/second of writes each, they fluctuated between 200 MB/s and 400 MB/s when doing 96 GB of random writes in a file. That

Re: [GENERAL] Postgresql CDC tool recommendations ?

2017-10-05 Thread Steve Atkins
ezium.io and (maybe) the no longer supported https://github.com/confluentinc/bottledwater-pg Cheers, Steve -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general

[GENERAL] Postgresql CDC tool recommendations ?

2017-10-05 Thread avi Singh
Guys Any recommendation on a good CDC tool that can be used to push postgresql changes to Kafka in json format ? Thanks Avi

Re: [GENERAL] delete a file everytime pg server starts/crashes

2017-10-05 Thread Ray Cote
> > On Thu, Oct 5, 2017 at 10:04 AM, athinivas wrote: > >> Hi, >> >> I'm having a requirement to delete a file in system whenever pg server is >> started/crashed. Any idea? >> >> Thanks, >> Athi >> >> If you’re running on Linux you can modify the init.d (or service) file and

Re: [GENERAL] delete a file everytime pg server starts/crashes

2017-10-05 Thread Melvin Davidson
On Thu, Oct 5, 2017 at 10:04 AM, athinivas <athini...@gmail.com> wrote: > Hi, > > I'm having a requirement to delete a file in system whenever pg server is > started/crashed. Any idea? > > Thanks, > Athi > > > > -- > Sent from: http://www.postgresql-archi

[GENERAL] delete a file everytime pg server starts/crashes

2017-10-05 Thread athinivas
Hi, I'm having a requirement to delete a file in system whenever pg server is started/crashed. Any idea? Thanks, Athi -- Sent from: http://www.postgresql-archive.org/PostgreSQL-general-f1843780.html -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes

Re: [GENERAL] a JOIN to a VIEW seems slow

2017-10-05 Thread Frank Millman
On 5 Oct 2017, at 8:20 AM, Frank Millman wrote: > If anyone wants to take this further, maybe this is a good place to start. I should have re-stated the reason for my original post. Exactly the same query, on exactly the same data, takes 1.8 seconds on Sql Server, 1.0 seconds on SQLite3, and

Re: [GENERAL] a JOIN to a VIEW seems slow

2017-10-05 Thread Frank Millman
On 4 Oct 2017, at 9:19 PM, Alban Hertroys wrote: > On 2 Oct 2017, at 8:32, Frank Millman wrote: > > > On Fri, Sep 22, 2017 at 7:34 AM, Frank Millman wrote: > > > > On Thu, Sep 21, 2017 at 3:54 PM, Merlin Moncure wrote: > > > Something is not adding up here. Can you

Re: [GENERAL] a JOIN to a VIEW seems slow

2017-10-04 Thread Frank Millman
On Wednesday, October 4, 2017 06:07 PM Jan de Visser wrote: > On Monday, October 2, 2017 2:32:34 AM EDT Frank Millman wrote: > > > > Just checking – is this under investigation, or is this thread considered > > closed? > > That's not how it works. This is a community list; if somebody finds

Re: [GENERAL] a JOIN to a VIEW seems slow

2017-10-04 Thread Alban Hertroys
> On 2 Oct 2017, at 8:32, Frank Millman <fr...@chagford.com> wrote: > > > From: Frank Millman > Sent: Friday, September 22, 2017 7:34 AM > To: pgsql-general@postgresql.org > Subject: Re: a JOIN to a VIEW seems slow > > > On Fri, Sep 22,

[GENERAL] Strange checkpoint behavior - checkpoints take a long time

2017-10-04 Thread Vladimir Nicolici
I have a large database, 1.3 TB, with quite a bit of write activity. The machine has, 2 cpus x 6 cores x 2 threads (2 x E5-2630 v2 @ 2.60GHz), 4 x EVO Pro 2TB SSDs in a RAID 1+0 software raid configuration, on a SATA 3 controller. The machine has a lot of memory, 384 GB, so it doesn’t do a lot

Re: [GENERAL] a JOIN to a VIEW seems slow

2017-10-04 Thread Jan de Visser
On Monday, October 2, 2017 2:32:34 AM EDT Frank Millman wrote: > From: Frank Millman > Sent: Friday, September 22, 2017 7:34 AM > To: pgsql-general@postgresql.org > Subject: Re: a JOIN to a VIEW seems slow > > On Fri, Sep 22, 2017 at 7:34 AM, Frank Millman wrote: > > On T

[GENERAL] error: initdb: could not look up effective user ID 21073: user does not exist

2017-10-04 Thread Sandeep Gupta
with but that was for pg 9.2.4 Thanks sandeep -- 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] time series data

2017-10-03 Thread Schneider
menting-state-machines-in-postgresql.html Hope this is helpful. Great to see that you're working on PostgreSQL - it's a powerful engine to build with! -Jeremy -- http://about.me/jeremy_schneider -- 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] BDR, wal sender, high system cpu, mutex_lock_common

2017-10-03 Thread milist ujang
Hi Craig, Anyway, this OS is guess OS in vmware (vsphere). Thank for your response and help. On Tue, Oct 3, 2017 at 8:49 PM, Craig Ringer wrote: > > > Can you get stacks please? > > Use -g > # Events: 2K cpu-clock # # Overhead Command Shared Object

Re: [GENERAL] BDR, wal sender, high system cpu, mutex_lock_common

2017-10-03 Thread Craig Ringer
On 3 October 2017 at 19:45, milist ujang wrote: > Hi all, > > I've an environment 9.4 + bdr: > PostgreSQL 9.4.4 > You're on a pretty old postgres-bdr. Update. You're missing a lot of fixes from mainline. > This is consolidation databases, in this machine there are

[GENERAL] BDR, wal sender, high system cpu, mutex_lock_common

2017-10-03 Thread milist ujang
Hi all, I've an environment 9.4 + bdr: PostgreSQL 9.4.4 on x86_64-unknown-linux-gnu, compiled by gcc (Debian 4.7.2-5) 4.7.2, 64-bit kernel version: 3.2.0-4-amd64 #1 SMP Debian 3.2.65-1 x86_64 GNU/Linux This is consolidation databases, in this machine there are around 250+ wal sender processes.

Re: [GENERAL] Checkpoint write time - anything unusual?

2017-10-03 Thread Laurenz Albe
on_target is 0.9, spending 0.9 * 3600 = 3240 seconds per hour doing checkpoints would be normal. The whole point of this parameter is to spread checkpoints across a longer time to avoid I/O spikes. Yours, Laurenz Albe -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To mak

Re: [GENERAL] pg_stat_tmp and pg_upgrade

2017-10-02 Thread Bruce Momjian
http://enterprisedb.com + As you are, so once was I. As I am, so you will be. + + Ancient Roman grave inscription + -- 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] time series data

2017-10-02 Thread Nico Williams
table that gives you rows that summarize each call - both: store the events and the summaries of the calls You might have an events table with AFTER INSERT triggers to insert or update the corresponding rows in the calls table. Nico -- -- Sent via pgsql-general mailing list (pgsql

Re: [GENERAL] time series data

2017-10-02 Thread Khalil Khamlichi
varchar(10) NOT NULL, > call_ready timestamp NOT NULL, > call_talking timestamp, > call_after_call timestamp, > call_duration interval, > CONSTRAINT user_sessions_pk PRIMARY KEY (username, session_id), > CONSTRAINT user_sessions_fk_status FOREIGN KEY (call_status) > REFERENCES status(call_status) > ); > > So in essence, when the call starts, just do: > > INSERT INTO user_sessions > (username, call_ready) > VALUES > ('actual_user_name', now() ); > > Then > SELECT max(session_id) AS current_session > FROM user_sessions > WHERE username = 'actual_user_name'; > > When talking starts: > UPDATE user_sessions >SET call_status = 'talking', >call_talking = now() > WHERE username = 'actual_user_name' >AND session_id = current_session; > > When call ends: > UPDATE user_sessions >SET call_status = 'after_call', >call_after_call = now() > WHERE username = 'actual_user_name' >AND session_id = current_session; > > Now all you have to do to get call length is: > > SELECT username, >age ( call_after_call, call_talking ) as duration > FROM user_sessions > WHERE username = 'actual_user_name' >AND session_id = current_session; > -- 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] time series data

2017-10-02 Thread Khalil Khamlichi
interesting proposition, I am reading the docs. On Mon, Oct 2, 2017 at 6:08 PM, Scott Marlowe wrote: > On Sun, Oct 1, 2017 at 2:17 AM, Khalil Khamlichi > wrote: > > Hi everyone, > > > > I have a data stream of a call center application

Re: [GENERAL] time series data

2017-10-02 Thread Scott Marlowe
cs like total duration, > frequency, avg ...etc , does any body have an experience with this sort of > data streams ? Have you looked at temporal_tables extension? It seems custom made for what you're trying to do. http://clarkdave.net/2015/02/historical-records-with-postgresql-and-temporal-tabl

[GENERAL] Checkpoint write time - anything unusual?

2017-10-02 Thread pinker
://www.postgresql-archive.org/PostgreSQL-general-f1843780.html -- 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] Setting search_path ignored

2017-10-02 Thread Charles Clavadetscher
Hello From: pgsql-general-ow...@postgresql.org [mailto:pgsql-general-ow...@postgresql.org] On Behalf Of Guyren Howe Sent: Montag, 2. Oktober 2017 16:10 To: David G. Johnston <david.g.johns...@gmail.com> Cc: PostgreSQL General <pgsql-general@postgresql.org> Subject: Re: [GENE

Re: [GENERAL] Setting search_path ignored

2017-10-02 Thread David G. Johnston
On Mon, Oct 2, 2017 at 7:09 AM, Guyren Howe wrote: > I logged out and back and did SET ROLE and got the same resullt. > ​ Are you logging in as "thing_accessor" or some role that is a member of "thing_accessor"? David J. ​

Re: [GENERAL] Setting search_path ignored

2017-10-02 Thread Guyren Howe
I logged out and back and did SET ROLE and got the same resullt. On Oct 2, 2017, 10:06 -0400, David G. Johnston , wrote: > On Mon, Oct 2, 2017 at 7:00 AM, Guyren Howe wrote: > > > CREATE ROLE thing_accessor; > > > CREATE ROLE > > > CREATE SCHEMA

Re: [GENERAL] time series data

2017-10-02 Thread Melvin Davidson
On Sun, Oct 1, 2017 at 6:20 PM, Clifford Snow wrote: > I have a stream that updates every minute with a trigger that updates > another table with information from the stream. That way I'm constantly > updated with no need to run a script to update before I want a report.

Re: [GENERAL] Setting search_path ignored

2017-10-02 Thread David G. Johnston
On Mon, Oct 2, 2017 at 7:00 AM, Guyren Howe wrote: > CREATE ROLE thing_accessor; > > CREATE ROLE > > CREATE SCHEMA thing_accessor; > > CREATE SCHEMA > > covermything=> ALTER ROLE thing_accessor SET search_path=thing_accessor; > > ALTER ROLE > > covermything=# SET ROLE

[GENERAL] Setting search_path ignored

2017-10-02 Thread Guyren Howe
CREATE ROLE thing_accessor; CREATE ROLE CREATE SCHEMA thing_accessor; CREATE SCHEMA covermything=> ALTER ROLE thing_accessor SET search_path=thing_accessor; ALTER ROLE covermything=# SET ROLE thing_accessor; SET covermything=> SHOW search_path; search_path - "$user",

Re: [GENERAL] a JOIN to a VIEW seems slow

2017-10-02 Thread Frank Millman
From: Frank Millman Sent: Friday, September 22, 2017 7:34 AM To: pgsql-general@postgresql.org Subject: Re: a JOIN to a VIEW seems slow On Fri, Sep 22, 2017 at 7:34 AM, Frank Millman wrote: > > On Thu, Sep 21, 2017 at 3:54 PM, Merlin Moncure wrote: > > Something is not ad

Re: [GENERAL] time series data

2017-10-01 Thread Clifford Snow
I have a stream that updates every minute with a trigger that updates another table with information from the stream. That way I'm constantly updated with no need to run a script to update before I want a report. Clifford On Sun, Oct 1, 2017 at 10:08 AM, Melvin Davidson

Re: [GENERAL] time series data

2017-10-01 Thread Melvin Davidson
On Sun, Oct 1, 2017 at 4:17 AM, Khalil Khamlichi wrote: > Hi everyone, > > I have a data stream of a call center application coming in to postgres > in this format : > > user_name, user_status, event_time > > 'user1', 'ready', '2017-01-01 10:00:00' > 'user1',

[GENERAL] Revolut - postgres ?

2017-10-01 Thread rakeshkumar464
large increase in volume." -- Sent from: http://www.postgresql-archive.org/PostgreSQL-general-f1843780.html -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general

[GENERAL] time series data

2017-10-01 Thread Khalil Khamlichi
Hi everyone, I have a data stream of a call center application coming in to postgres in this format : user_name, user_status, event_time 'user1', 'ready', '2017-01-01 10:00:00' 'user1', 'talking', '2017-01-01 10:02:00' 'user1', 'after_call', '2017-01-01 10:07:00' 'user1', 'ready', '2017-01-01

Re: [GENERAL] Plan changes from index scan to seq scan after 5 executions

2017-09-30 Thread Tom Lane
nobody's tried it yet. You can find more discussion of this problem in the -hackers archives. As for workarounds, the only short-term fix I can suggest is to use EXECUTE for this query in your function, thus preventing caching of a plan for it. regards, tom lane -- Sent via

Re: [GENERAL] Plan changes from index scan to seq scan after 5 executions

2017-09-30 Thread Alexander Kukushkin
Hi David, sorry, absolutely forgot about important stuff like version. Original problem has been found on 9.4.9, but I was able to reproduce it on 10rc1. localhost/postgres=# select version(); version

Re: [GENERAL] Plan changes from index scan to seq scan after 5 executions

2017-09-30 Thread David G. Johnston
On Sat, Sep 30, 2017 at 10:57 AM, Alexander Kukushkin wrote: > Hi, > > Recently I've been investigating a strange behavior of one stored > procedure. > Please provide the output of: SELECT version(); David J. ​

[GENERAL] Plan changes from index scan to seq scan after 5 executions

2017-09-30 Thread Alexander Kukushkin
Hi, Recently I've been investigating a strange behavior of one stored procedure. According to the statistics its execution time was very high (15 seconds), but if I run the same statement from console it was very fast, just a few milliseconds. At the end I was able to prepare a short script,

Re: [GENERAL] Best way to allow column to initially be null?

2017-09-30 Thread Glen Huang
. But it doesn’t > > seem as elegant. > > > > Is there a better way? > > > > Sounds to me like a BEFORE UPDATE trigger is exactly the way to handle this. > Rejecting invalid data input values is an ideal use case for such a facility. -- 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] Best way to allow column to initially be null?

2017-09-30 Thread Berend Tober
te > trigger to manually raise exception when the column is null. But it doesn’t seem as elegant. > > Is there a better way? > Sounds to me like a BEFORE UPDATE trigger is exactly the way to handle this. Rejecting invalid data input values is an ideal use case for such a facility. --

[GENERAL] Best way to allow column to initially be null?

2017-09-30 Thread Glen Huang
. But it doesn’t seem as elegant. Is there a better way? Regards, Glen -- 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] PG 10 and perl

2017-09-29 Thread Andy Colson
-multi/CORE/libperl.so (0x7f33b9f87000) I had 10beta1 installed to /usr/local/pg10. The SlackBuild script I'm using installs to /usr/local/pg95 still. So I was compiling and installing 10rc1 into pg95. Sorry for the noise (and thanks Tom). -Andy -- Sent via pgsql-general maili

Re: [GENERAL] Converting inherited partitions into declarative ones

2017-09-29 Thread Victor Yegorov
2017-09-29 20:32 GMT+03:00 Victor Yegorov : > > Is it possible to avoid Full Scan here? I have TBs worth of data in > partitions, > so it'll takes ages to switch to the declarative partitioning the way > things stand now. > OK, looking at the source code helped — I need to

Re: [GENERAL] Converting inherited partitions into declarative ones

2017-09-29 Thread Melvin Davidson
On Fri, Sep 29, 2017 at 1:32 PM, Victor Yegorov wrote: > Greetings. > > I am looking into new partitioning of 10rc1 on a copy of a production > system. > And I'm having tough times with the full scan. > > Per documentation: > > It is possible to avoid this scan by adding a

[GENERAL] Converting inherited partitions into declarative ones

2017-09-29 Thread Victor Yegorov
Greetings. I am looking into new partitioning of 10rc1 on a copy of a production system. And I'm having tough times with the full scan. Per documentation: > It is possible to avoid this scan by adding a valid CHECK constraint to the table > that would allow only the rows satisfying the desired

Re: [GENERAL] COPY vs \COPY FROM PROGRAM $$ quoting difference?

2017-09-29 Thread Alexander Stoddard
even the appropriate email >> list to ask this kind of question or report such a difference? >> > > ​This is the correct place for seeking such clarification.​ The docs > cannot cover every possible thing people might do and these lists (-general > in particular) are here to fill

Re: [GENERAL] COPY vs \COPY FROM PROGRAM $$ quoting difference?

2017-09-29 Thread David G. Johnston
docs cannot cover every possible thing people might do and these lists (-general in particular) are here to fill in the gaps. ​The negative condition that "psql" itself doesn't understand dollar-quoting​ is not documented. Dollar-quoting is documented as a server-interpreted SQL Sy

<    4   5   6   7   8   9   10   11   12   13   >