[GENERAL] Why can't the database owner create schemas and how can I enable that?

2017-09-22 Thread Tim Uckun
I am setting up a database for an app. So I create a user without superuser but with login priveleges I then create a database and set it's owner to that user like this... dropdb --if-exists api_development dropuser --if-exists api_user createuser api_user -P -d createdb api_development -O api_u

[GENERAL] Immutable functions and cache invalidation.

2017-08-26 Thread Tim Uckun
Say I have a function like this. CREATE OR REPLACE FUNCTION some_constant( ) RETURNS text LANGUAGE 'plpgsql' COST 100 IMMUTABLE ROWS 0 AS $BODY$ begin return 'some_string'; end; $BODY$; Then I have another function that calls it but is also immutable CREATE OR REPLACE FUNCTIO

Re: [GENERAL] Shared Constants in PLPGSQL

2017-08-01 Thread Tim Uckun
of compute cycles. On Wed, Aug 2, 2017 at 1:04 AM, Merlin Moncure wrote: > On Tue, Aug 1, 2017 at 4:56 AM, Tim Uckun wrote: > > What's the best way to deal with global constants in PLPGSQL. Currently > I am > > putting them in a function with out parameters and then cal

[GENERAL] Shared Constants in PLPGSQL

2017-08-01 Thread Tim Uckun
What's the best way to deal with global constants in PLPGSQL. Currently I am putting them in a function with out parameters and then calling that function from every other function that needs them like this. CREATE OR REPLACE FUNCTION hashids.constants( OUT min_alphabet_length integer, OU

Re: [GENERAL] Developer GUI tools for PostgreSQL

2017-07-28 Thread Tim Uckun
I don't run windows so I haven't looked at the EMS product. On Fri, Jul 28, 2017 at 6:53 PM, vinny wrote: > On 2017-07-28 06:31, Tim Uckun wrote: > >> I think it's funny that after all these years pgadmin3 is still the >> most comprehensive GUI for postgres.

Re: [GENERAL] Developer GUI tools for PostgreSQL

2017-07-27 Thread Tim Uckun
I think it's funny that after all these years pgadmin3 is still the most comprehensive GUI for postgres. Even though it's prone to crashing on my machine and I have paid for datagrip I still reach for it first. On Fri, Jul 28, 2017 at 2:46 AM, vinny wrote: > On 2017-07-27 00:41, Tiffany Thang wr

Re: [GENERAL] Developer GUI tools for PostgreSQL

2017-07-26 Thread Tim Uckun
k this page out as well: > https://wiki.postgresql.org/wiki/Community_Guide_to_PostgreSQL_GUI_Tools > > <https://wiki.postgresql.org/wiki/Community_Guide_to_PostgreSQL_GUI_Tools> > Cheers, > > Brent Wood > -- > *From:* Tim Uckun > *To:* Tiffa

Re: [GENERAL] Developer GUI tools for PostgreSQL

2017-07-26 Thread Tim Uckun
I still use pgadmin3. I also have a subscription to the jetbrains tools so I also give datagrip a try once in a while. Datagrip has a lot going for it but it's lagging behind pgadmin3 is a lot of ways so it hasn't replaced it for me. On Thu, Jul 27, 2017 at 10:41 AM, Tiffany Thang wrote: > Hi, >

Re: [GENERAL] monitoring PostgreSQL

2017-07-24 Thread Tim Clarke
On 24/07/17 15:01, PAWAN SHARMA wrote: > > > > On Mon, Jul 24, 2017 at 7:28 PM, Tim Clarke <mailto:tim.cla...@manifest.co.uk>> wrote: > > > > On 24/07/17 14:47, PAWAN SHARMA wrote: > > > > Hi Tim, > > > > Facing below

Re: [GENERAL] monitoring PostgreSQL

2017-07-24 Thread Tim Clarke
On 24/07/17 14:47, PAWAN SHARMA wrote: > > Hi Tim, > > Facing below issue > > [abc@test:/home/psharm89/nrpe-2.15]# > Redirecting to /bin/systemctl restart xinetd.service > Failed to restart xinetd.service: Unit xinetd.service failed to load: > No such file or d

Re: [GENERAL] Dealing with ordered hierarchies

2017-07-24 Thread Tim Uckun
more users are trying to update the hierarchy either by inserts or updates? I can definitely see a situation where we have issues transactions trip over each other. On Mon, Jul 24, 2017 at 10:32 PM, Alban Hertroys wrote: > > > On 24 Jul 2017, at 9:02, Tim Uckun wrote: > > > >

Re: [GENERAL] monitoring PostgreSQL

2017-07-24 Thread Tim Clarke
We use nagios for all alerting, it'll do what you need. Tim Clarke On 24/07/17 12:38, Achilleas Mantzios wrote: > pgbadger is a very nice reporting tool, overall, albeit not exactly at > the system side, but more to the DBA side. > For system level monitoring maybe take a look

[GENERAL] Dealing with ordered hierarchies

2017-07-24 Thread Tim Uckun
I have read many articles about dealing with hierarchies in postgres including nested sets, ltree, materialized paths, using arrays as parentage, CTEs etc but nobody talks about the following scenario. Say I have a hierarchy like this 1 1.1 1.1.1 1.1.2 1.2 1.3 2 2.1 In this hierarchy the order

Re: [GENERAL] Is PL-PGSQL interpreted or complied?

2017-07-06 Thread Tim Uckun
Interesting, thank you. I was curious to know how it worked. Cheers.

[GENERAL] Is PL-PGSQL interpreted or complied?

2017-07-05 Thread Tim Uckun
I am curious about the stored proc languages inside of postgres. When I write a stored proc is it compiled to some internal representation or just interpreted? How does this work with other languages? Also would it be possible to extract PL-PGSQL into a standalone (albeit crippled) language? Is th

Re: [GENERAL] UDP buffer drops / statistics collector

2017-04-20 Thread Tim Kane
* playing with the buffer sizes) and lo and behold!! no more buffer drops! Problem solved. The pgss_query_texts.stat still wants to live in the default *pg_stat_tmp* directory, wether by design or not.. but that's a non-issue for me now. Thanks for listening :) On Wed, Apr 19, 2017 at 7:36 P

Re: [GENERAL] UDP buffer drops / statistics collector

2017-04-19 Thread Tim Kane
13 minutes) but I can't correlate them with any kind of activity (and if I'm honest, it's possibly starting to drive me a little bit mad). On Tue, Apr 18, 2017 at 2:53 PM Tim Kane wrote: > Okay, so I've run an strace on the collector process during a buffer drop > event

Re: [GENERAL] UDP buffer drops / statistics collector

2017-04-18 Thread Tim Kane
e, Apr 18, 2017 at 8:05 AM Tim Kane wrote: > Hi all, > > I'm seeing sporadic (but frequent) UDP buffer drops on a host that so far > I've not been able to resolve. > > The drops are originating from postgres processes, and from what I know - > the only UDP traf

[GENERAL] UDP buffer drops / statistics collector

2017-04-18 Thread Tim Kane
Hi all, I'm seeing sporadic (but frequent) UDP buffer drops on a host that so far I've not been able to resolve. The drops are originating from postgres processes, and from what I know - the only UDP traffic generated by postgres should be consumed by the statistics collector - but for whatever r

[GENERAL] SELECT and RowExclusiveLock

2017-04-07 Thread Tim Nelson
New to Postgres and I have never seen this condition. We are getting test applications hanging on SELECT statements with a RowExclusiveLock. How can a SELECT cause a RowExclusiveLock? relname | pid | mode | granted --+---+--+---

Re: [GENERAL] browser interface to forums please?

2017-04-05 Thread Tim Clarke
cate with us (doesn't matter if they are "wrong") then the better all round for Postgres. Tim smime.p7s Description: S/MIME Cryptographic Signature

Re: [GENERAL] "Reverse" inheritance?

2017-04-04 Thread Tim Uckun
basic queries like listing all > known unix variants; if that is hidden in the table names > then you'll have to issue DDL queries to do the work of SELECT queries, > which just sounds wrong to me. > > I'd go for a tree, possibly using recursive CTE's to dig it. > >

Re: [GENERAL] "Reverse" inheritance?

2017-04-03 Thread Tim Uckun
I have thought of doing something like a single table inheritance and it could be done but I thought this might be a little more elegant. On Tue, Apr 4, 2017 at 2:15 PM, David G. Johnston < david.g.johns...@gmail.com> wrote: > On Mon, Apr 3, 2017 at 7:07 PM, Tim Uckun wrote: > >&

[GENERAL] "Reverse" inheritance?

2017-04-03 Thread Tim Uckun
I am trying to make postgres tables work like an object hierarchy. As an example I have done this. drop table if exists os.linux cascade; create table os.linux ( script_name character varying(255) NOT NULL, script_body text, CONSTRAINT os_linux_pkey PRIMARY KEY (script_name) ); drop table if exis

Re: [GENERAL] browser interface to forums please?

2017-03-25 Thread Tim Clarke
quot;. > > In short, there is always room for usability improvements. You'll get > a better response if you focus on those since and explain why. > > David J. google groups would support both methods of access imho I'm not suggesting its a good thing - perfectly happy w

Re: [GENERAL] Autovacuum stuck for hours, blocking queries

2017-02-21 Thread Tim Bellis
-Original Message- From: Tom Lane [mailto:t...@sss.pgh.pa.us] Sent: 16 February 2017 22:40 To: Tim Bellis Cc: Adrian Klaver ; pgsql-general@postgresql.org; Alvaro Herrera ; Scott Marlowe Subject: Re: [GENERAL] Autovacuum stuck for hours, blocking queries Tim Bellis writes

Re: [GENERAL] Autovacuum stuck for hours, blocking queries

2017-02-17 Thread Tim Bellis
From: Jeff Janes [mailto:jeff.ja...@gmail.com] Sent: 17 February 2017 02:59 To: Tim Bellis Cc: pgsql-general@postgresql.org Subject: Re: [GENERAL] Autovacuum stuck for hours, blocking queries On Wed, Feb 15, 2017 at 9:30 AM, Tim Bellis mailto:tim.bel...@metaswitch.com>> wrote: I

Re: [GENERAL] Autovacuum stuck for hours, blocking queries

2017-02-17 Thread Tim Bellis
The DELETE operations only deletes rows from the previous day. It's possible that there have been rows added that day which ought not to be deleted, so TRUNCATE wouldn't work. But that was a helpful suggestion - thanks! Tim -Original Message- From: Hannes Erven [mailto:han..

Re: [GENERAL] Autovacuum stuck for hours, blocking queries

2017-02-16 Thread Tim Bellis
is a read only query, is it also expected to be blocked behind the vacuum? Is there a way of getting indexes for a table which won't be blocked behind a vacuum? Thank you all again, Tim SELECT NULL AS TABLE_CAT, n.nspname AS TABLE_SCHEM, ct.relname AS TABLE_NAME, NOT i.indisunique AS

[GENERAL] Autovacuum stuck for hours, blocking queries

2017-02-15 Thread Tim Bellis
not good practice) I've put the vacuum settings for my database below. - Should I avoid certain queries which autovacuum is happening? - Are there more diags that I should gather to help diagnose this issue? Thanks! Tim --System details-- Postgres 9.3.4 running on Linux x64 VMWar

Re: [GENERAL] Performance PLV8 vs PLPGSQL

2016-12-31 Thread Tim Uckun
UI available. The devs made it an > absolute joy to use, and I never need to use the command line anymore. > > Hope this helps! > > On Dec 29, 2016, at 10:43 PM, Tim Uckun wrote: > > I have datagrip and it's OK but it doesn't really do everything I want. > > I do

Re: [GENERAL] Performance PLV8 vs PLPGSQL

2016-12-29 Thread Tim Uckun
here is my hat tip to the Postgres team for an awesome job they are > doing! > > On Dec 29, 2016, at 7:19 PM, Tim Uckun wrote: > > I am not saying the postgres core people should work on an IDE, just that > an IDE like thing would be nice. > > On Fri, Dec 30, 2016 at 12:51 PM

Re: [GENERAL] Performance PLV8 vs PLPGSQL

2016-12-29 Thread Tim Uckun
ng and writing faster and > faster ACID all the while. > > On Dec 29, 2016, at 5:32 PM, Tim Uckun wrote: > > Honestly I don't even like JS. Having said that I am not too crazy about > PL-PGSQL either. I am willing to put up with either given that they are > supported widely

Re: [GENERAL] Performance PLV8 vs PLPGSQL

2016-12-29 Thread Tim Uckun
gonovo < m...@webthatworks.it> wrote: > On 12/29/2016 10:35 AM, Pavel Stehule wrote: > > 2016-12-29 10:03 GMT+01:00 Tim Uckun > <mailto:timuc...@gmail.com>>: >> >> I think it's awesome that postgres allows you to code in different >> langua

Re: [GENERAL] Performance PLV8 vs PLPGSQL

2016-12-29 Thread Tim Uckun
Mostly generating SQL statements to execute. Like for example deciding which partition to insert into. On Thu, Dec 29, 2016 at 10:00 PM, Pavel Stehule wrote: > > > 2016-12-29 9:23 GMT+01:00 Tim Uckun : > >> I am not doubting the efficacy of stored procs, just wondering wh

Re: [GENERAL] Performance PLV8 vs PLPGSQL

2016-12-29 Thread Tim Uckun
I think it's awesome that postgres allows you to code in different languages like this. It really is a unique development environment and one that is overlooked as a development platform. It would be nice if more languages were delivered in the default package especially lua, V8 and mruby. On T

Re: [GENERAL] Performance PLV8 vs PLPGSQL

2016-12-29 Thread Tim Uckun
AM, Mike Sofen wrote: > *From:* Tim Uckun > I have seen various links on the internet which indicate that PLV8 is > significantly faster than PL-PGSQL sometimes an order of magnitude faster. > > > > Is there any benefit to choosing PL-PGSQL? > > ---

[GENERAL] Performance PLV8 vs PLPGSQL

2016-12-28 Thread Tim Uckun
I have seen various links on the internet which indicate that PLV8 is significantly faster than PL-PGSQL sometimes an order of magnitude faster. Is this uniformly true or is it just in certain circumstances? Is there any benefit to choosing PL-PGSQL? Is there work going on to make PL-PGSQL more

Re: [GENERAL] FreeBSD 10 => 11: Dump and reload your PostgreSQL database unless you like it broken

2016-12-08 Thread Tim Clarke
ic for a blog post >> >> -- >> Kevin Grittner >> EDB: http://www.enterprisedb.com >> The Enterprise PostgreSQL Company >> >> > +1 - Confuses me every time > > +1 me too -- Tim Clarke smime.p7s Description: S/MIME Cryptographic Signature

Re: [GENERAL] Import data from MS SQL Server 2014 to Postgresql 9.6 using dbi-link and fdw (error: utf-8/uft-16)

2016-11-10 Thread Tim Clarke
I'd recommend Talend, they have an open source edition that we use. Very powerful and reliable. Tim Clarke On 10/11/16 12:49, JingYuan Chen wrote: > > I think that ETL utilities will be the right choice. Try Pentaho's > Data Integration tool. It is Java base. > >

[GENERAL] Limiting to sub-id in a query ?

2016-10-26 Thread Tim Smith
Hi, I've been trying various GROUP BY but these all end up erroring out, so maybe I'm using the wrong tool for the job (or, more likely, the required query is beyond my level of SQL-fu !). CREATE TABLE IF NOT EXISTS names ( main_id bigint, sub_id bigint, name text ); create unique index IF NOT E

[GENERAL] Integer fields and auto-complete clients

2016-10-26 Thread Tim Smith
even thinking about using gin_trgm_ops on integers ? I'm thinking perhaps the 'prefix' extension is better suited ? Or is there something else altogether I should be considering to support such applications ? Thanks ! Tim -- Sent via pgsql-general mailing list (pgsql-general

Re: [GENERAL] [ANNOUNCE] pgAdmin 4 v1.0 Released!

2016-10-03 Thread Tim Clarke
Flask-Security==1.7.5 > Flask-SQLAlchemy==2.1 > Flask-WTF==0.13 > > also: > > django-htmlmin==0.9.1 > > Then run python setup.py. Should those installs be into python 2 or python 3? > > Personally I would go this route: > > https://www.pgadmin.org/download/pip4.php

Re: [GENERAL] [ANNOUNCE] pgAdmin 4 v1.0 Released!

2016-10-03 Thread Tim Clarke
lask and python3-flask, probably both installed as I flailed around trying to install pgAdmin4. Tim Clarke smime.p7s Description: S/MIME Cryptographic Signature

Re: [GENERAL] [ANNOUNCE] pgAdmin 4 v1.0 Released!

2016-09-30 Thread Tim Clarke
QT_MANGLE_NAMESPACE(qInitResources_pgAdmin4)) > ^ > qrc_pgAdmin4.cpp:4142:24: note: in expansion of macro > ‘QT_MANGLE_NAMESPACE’ > Q_CONSTRUCTOR_FUNCTION(QT_MANGLE_NAMESPACE(qInitResources_pgAdmin4)) > ^ for notes (which I don't think are a problem but I could be wr

Re: [GENERAL] [ANNOUNCE] pgAdmin 4 v1.0 Released!

2016-09-30 Thread Tim Clarke
'd like to thank the management at EDB > (http://www.enterprisedb.com) for supporting this project and allowing > me to enlist the efforts of over 15 employees from multiple teams. > Without their support pgAdmin 4 would not exist today. > Marvellous Dave, thanks to the team f

Re: [GENERAL] Is there a way to fix this ugliness

2016-09-09 Thread Tim Uckun
I could not make coalesce in the top level select to work even though people on the internet say it should work. I'll do the sub select that seems like it would work fine. On Sat, Sep 10, 2016 at 3:22 AM, Karl Czajkowski wrote: > On Sep 10, Tim Uckun modulated: > > I am trying to

[GENERAL] Is there a way to fix this ugliness

2016-09-09 Thread Tim Uckun
I am trying to get the child elements of a one to many table to be rolled up into a json field in the parent table. The query I am running is select ob.id ,case when array_position(array_agg(im.image_type), null) = 1 then '[]' else json_agg(row_to_json(im.*)) end as images from

Re: [GENERAL] IDE for function/stored proc development.

2016-09-03 Thread Tim Uckun
postgres. On Sat, Sep 3, 2016 at 11:03 PM, Pavel Stehule wrote: > Hi > > 2016-09-03 11:36 GMT+02:00 Tim Uckun : > >> Does anybody use an IDE for doing heavy duty stored proc development? >> PGadmin is decent but I am looking for something better. >> >> I have

[GENERAL] IDE for function/stored proc development.

2016-09-03 Thread Tim Uckun
Does anybody use an IDE for doing heavy duty stored proc development? PGadmin is decent but I am looking for something better. I have tried jetbrains with the db browser plugin and on the surface it seems like a good choice but it's really buggy when working with procs. I also tried datagrip by j

Re: [GENERAL] Retrieving value of column X days later

2016-08-07 Thread Tim Smith
Thank you Victor Will experiment with this over the next couple of days. On 7 August 2016 at 21:41, Victor Yegorov wrote: > 2016-08-07 22:23 GMT+03:00 Tim Smith : >> >> create table test ( >> when date, >> foo numeric, >> bar numeric, >> alice numeric,

Re: [GENERAL] Retrieving value of column X days later

2016-08-07 Thread Tim Smith
Thank you Sándor. Will experiment with this over the next couple of days. On 7 August 2016 at 21:05, Sándor Daku wrote: > On 7 August 2016 at 21:23, Tim Smith wrote: >> >> Hi, >> >> Let's say I've got a table : >> >> create table test ( >&

[GENERAL] Retrieving value of column X days later

2016-08-07 Thread Tim Smith
Hi, Let's say I've got a table : create table test ( when date, foo numeric, bar numeric, alice numeric, bob numeric); insert into test values ('2016-01-01',1,2,3,4); insert into test values ('2016-01-02',5,6,7,8); insert into test values ('2016-01-03',9,10,11,12); insert into test values ('2016

Re: [GENERAL] Merging timeseries in postgres

2016-07-15 Thread Tim Smith
eneral-ow...@postgresql.org > ] *On > Behalf Of *David G. Johnston > *Sent:* Thursday, 14 July, 2016 08:23 > *To:* Nick Babadzhanian > *Cc:* Tim Smith; pgsql-general > *Subject:* Re: [GENERAL] Merging timeseries in postgres > > > > On Thu, Jul 14, 2016 at 8:18 AM, Nick B

Re: [GENERAL] Upsert with a partial unique index constraint violation

2016-07-14 Thread Tim Dawborn
Awesome. Thanks, Tom. Glad to see this issue has been patched upstream. I'll use the alternative syntax in the meantime. Cheers, Tim On 13 July 2016 at 01:03, Tom Lane wrote: > Peter Geoghegan writes: > > On Mon, Jul 11, 2016 at 12:06 AM, Tim Dawborn > wrote: > >>

[GENERAL] Merging timeseries in postgres

2016-07-14 Thread Tim Smith
-02 | 0.001 || 2003-01-02 | 0.002 (2 rows) dx | nx |dx1 | nx1 +---++--- 2000-01-02 | 0.005 || | | 2002-01-02 | 0.001 | | 2003-01-02 | 0.002 Which isn't very pretty and doesn't re

Re: [GENERAL] Upsert with a partial unique index constraint violation

2016-07-12 Thread Tim Dawborn
, b) WHERE d = true DO UPDATE SET c = 'four' WHERE foo.a = 1 AND foo.b = 2 and foo.d = true; ERROR: there is no unique or exclusion constraint matching the ON CONFLICT specification On 12 July 2016 at 13:43, Peter Geoghegan wrote: > On Mon, Jul 11, 2016 at 12:06 AM, Tim Dawborn &

[GENERAL] Upsert with a partial unique index constraint violation

2016-07-11 Thread Tim Dawborn
there is no unique or exclusion constraint matching the ON CONFLICT specification If anyone knows what I'm doing wrong and how to get this to work, or knows that this is not possible to achieve, I'm all ears. Cheers, Tim [1] https://www.postgresql.org/docs/9.5/static/sql-insert.html

Re: [GENERAL] Corrupted Dabatabase

2016-06-27 Thread Tim Clarke
The issue sounds more like your server than just Postgres - search the net for "read only file system" for your OS. Tim Clarke On 27/06/16 14:28, Pau Marc Muñoz Torres wrote: > Hello Everydody, > > My database is corrupted, each time i try to list all the tables in > th

Re: [GENERAL] Help needed structuring Postgresql correlation query

2016-06-21 Thread Tim Smith
Thanks for that, looks like something to sink my teeth into ! On 21 June 2016 at 13:29, Alban Hertroys wrote: > >> On 19 Jun 2016, at 10:58, Tim Smith wrote: >> >> Hi, >> >> My postgresql-fu is not good enough to write a query to achieve this >> (some ma

[GENERAL] Help needed structuring Postgresql correlation query

2016-06-20 Thread Tim Smith
the "potential sample" window) and the result corr(target,potential). Hope that makes sense Tim -- 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] NULL concatenation

2016-05-12 Thread Tim Clarke
Wrap the source columns in your line: txt:= txt1 || txt2 || txt3; in coalesce() calls Tim Clarke On 12/05/16 09:47, Sridhar N Bamandlapally wrote: > txt:= txt1 || txt2 || txt3; smime.p7s Description: S/MIME Cryptographic Signature

Re: [GENERAL] Slow join over three tables

2016-04-28 Thread Tim van der Linden
n using reports_id_age_gender_created_idx on reports r (cost=0.56..1.42 rows=1 width=20) (actual time=0.134..0.135 rows=1 loops=4076) Index Cond: (id = d.rid) Heap Fetches: 0 Planning time: 29.415 ms Execution time: 723.545 ms And this is now indeed much closer to the ~660 ms from before, it doesn't make much of a difference after all. Cheers, Tim -- 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] Slow join over three tables

2016-04-27 Thread Tim van der Linden
Index Cond: (id = a.rid) Heap Fetches: 0 Planning time: 18.310 ms Execution time: 129.483 ms Still fast enough ... but I was wondering why the planner would not use the new index and instead fall back on the "report_drugs_drug_idx" single column index. > Alban Hertroys >

Re: [GENERAL] Slow join over three tables

2016-04-27 Thread Tim van der Linden
on reports r (cost=0.56..2.01 rows=1 width=20) (actual time=0.190..0.191 rows=1 loops=448) Index Cond: (id = a.rid) Heap Fetches: 0 Planning time: 15.238 ms Execution time: 119.431 ms So your hunch was right, not much difference there. But man ... this query is now flying ... Hat's off to you, sir! > Alban Hertroys Cheers, Tim -- 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] Slow join over three tables

2016-04-27 Thread Tim van der Linden
> -- > David Rowley http://www.2ndQuadrant.com/ > PostgreSQL Development, 24x7 Support, Training & Services Cheers, Tim -- 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] Slow join over three tables

2016-04-27 Thread Tim van der Linden
lter: 5 Buffers: shared hit=35510 read=20111 Planning time: 13.962 ms Execution time: 5357.520 ms > -- > Victor Y. Yegorov Cheers, Tim -- 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] Slow join over three tables

2016-04-27 Thread Tim van der Linden
Rows Removed by Filter: 5 Planning time: 15.968 ms Execution time: 4313.755 ms Both the (rid, adverse) and the (id, age, gender, created) indexes are now used. Yet ... this is "only" 1 second faster, still 4 seconds to complete this query (the join(s)). Is this truly the most that I could get out of it ... or could further tweaking to PostgreSQL's configuration be of any help here? > David Rowley http://www.2ndQuadrant.com/ > PostgreSQL Development, 24x7 Support, Training & Services Cheers, Tim -- 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] Slow join over three tables

2016-04-27 Thread Tim van der Linden
the result set if the where clause is pushed into the > INNER JOIN criteria- Correct. I have tried those as well, but the planner seems to take the exact same path and as a result the query time is unchanged. > > ... > > -- > Best Regards > Sameer Kumar | DB Solution Architect Cheers, Tim -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general

[GENERAL] Slow join over three tables

2016-04-26 Thread Tim van der Linden
the cluster from an SSD drive, as a traditional HDD could not even manage the query in under 5 minutes. The system has a total memory of 24 GB, runs on Debian and uses an 4Ghz 8 core i7-4790 processor. Some important postgresql.conf readouts: - shared_buffers = 4GB - work_mem = 64MB - maintenance_w

Re: [GENERAL] Pgsql troubleshooting & Iscsi

2016-04-26 Thread Tim Klicks
/system/postgresql-9.5.service [Unit] Description=PostgreSQL 9.5 database server After=syslog.target After=network.target *After=remote-fs.target* . . . 3. systemctl daemon-reload Now, my server is able to reboot and startup the db as it has the remote-fs dependency defined Best Regards, Tim. On

Re: [GENERAL] Windows performance

2016-02-12 Thread Tim Clarke
On 12/02/16 15:45, Adrian Klaver wrote: > On 02/12/2016 07:37 AM, Sterpu Victor wrote: >> Hello >> Why is Postgres so slow on Windows compared to linux? >> Can I do something to match the performance? >> I have 2 servers: >> - one is Windows 8, CPU XEON, 8 CORES, 32G of RAM - my test query runs >>

Re: [GENERAL] Code of Conduct: Is it time?

2016-01-10 Thread Tim Clarke
idea > their joke was mean. > > My other concern about CoCs is I fear someone is going to come and demand > we change Master/Slave to Leader/Follower, because Master is a male term > and Slave is insensitive to grand-children of slaves. > > > Thanks, > Regina +1 -- Ti

Re: [GENERAL] No postgresql-9.5-prefix ?

2016-01-09 Thread Tim Smith
Adrian Any chance you could answer my original question now that I have demonstrated to you what I meant by the PG repo even if I committed the cardinal sin of not pointing you to the exact page on the PG website ? Apologies for the tone, but I did ask a very simple question !

Re: [GENERAL] No postgresql-9.5-prefix ?

2016-01-08 Thread Tim Smith
On Friday, 8 January 2016, Adrian Klaver wrote: > On 01/08/2016 07:43 AM, Tim Smith wrote: > >> Hi, >> >> Many apologies if I missed some announcement anywhere, but there >> appears to be no postgresql-9.5-prefix in the Postgres repository ? >> > > W

[GENERAL] No postgresql-9.5-prefix ?

2016-01-08 Thread Tim Smith
Hi, Many apologies if I missed some announcement anywhere, but there appears to be no postgresql-9.5-prefix in the Postgres repository ? Is this a deliberate omission or is it "coming real soon now" ? Thanks ! Tim -- Sent via pgsql-general mailing list (pgsql-general@postgresql.or

Re: [GENERAL] Postgresql INET select and default route ?

2015-12-14 Thread Tim Smith
Fabuous ! Thank you ! On 14 December 2015 at 07:52, Albe Laurenz wrote: > Tim Smith wrote: >> Re: I am surprised that you don't expect "0.0.0.0/0" to be returned by the >> first >> query if you expect it to be returned by the second. >> Is that an ove

Re: [GENERAL] Postgresql INET select and default route ?

2015-12-13 Thread Tim Smith
for 0.0.0.0/0 to be returned if there is no more specific match. On 9 December 2015 at 12:45, Albe Laurenz wrote: > Tim Smith wrote: >> create table test(a inet); >> insert into test values ('0.0.0.0/0'); >> insert into test values ('10.1.2.3'); >

[GENERAL] Postgresql INET select and default route ?

2015-12-09 Thread Tim Smith
Hi, create table test(a inet); insert into test values ('0.0.0.0/0'); insert into test values ('10.1.2.3'); => select * from test; a --- 0.0.0.0/0 10.1.2.3 (2 rows) This works as expected . => select * from test where a <<= '10.1.2.3'; a -- 10.1.2.3 (1 row) This

Re: [GENERAL] JDBC and inet type

2015-12-07 Thread Tim Smith
Great, thanks! On 4 December 2015 at 12:17, Bill Moran wrote: > On Fri, 4 Dec 2015 09:41:24 + > Tim Smith wrote: > >> When I use "preparedStatement.setString(5,ip);" to send values to a >> stored function, it obviously gets sent to postgres as "c

[GENERAL] JDBC and inet type

2015-12-04 Thread Tim Smith
need to add explicit type casts.". What is the appropriate workaround ? Thanks! Tim -- 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 a postgres table as a multi-writer multi-updater queue

2015-11-25 Thread Tim Uckun
I'll add my two cents. I set up something similar a while ago. Here are my suggestions for what they are worth. You don't ever want to delete from such a table so you need to set up something which allows you to truncate the tables when you no longer need them. One way to accomplish this is

Re: [GENERAL] Importing directly from BCP files

2015-11-16 Thread Tim Uckun
I am going to ask them that but there are tons of legacy files which might need to be dealt with again in the future so I was hoping to use them directly.

Re: [GENERAL] Importing directly from BCP files

2015-11-16 Thread Tim Uckun
> > the binary form of the BCP file output is undocumented. So if all the BCP > files you have are the binary(native) version you are up this creek without > a paddle. > > Ugh. Yes it looks like that's the creek I am on. Thanks Microsoft! > So, moving to another creek. It depends on the amount

Re: [GENERAL] Importing directly from BCP files

2015-11-16 Thread Tim Uckun
> > > On openSuSE 13.2 > > sudo zypper install freetds-tools > > Ubuntu 14.04 > > sudo apt-get install freetds-bin > > aklaver@killi:~> freebcp -h > usage: freebcp [[database_name.]owner.]table_name {in | out} datafile > [-m maxerrors] [-f formatfile] [-e errfile] > [-F firstrow] [

Re: [GENERAL] Importing directly from BCP files

2015-11-16 Thread Tim Uckun
I don't see any documentation anywhere about the BCP format and as I said googling for "BCP format" gives a zillion links about the format files. Every project on github just calls out the BCP command but I am on linux and that doesn't help me at all. Bummer. This is going to be a huge pain to tr

Re: [GENERAL] Importing directly from BCP files

2015-11-15 Thread Tim Uckun
> > > I moved a database from MS Sql Server 2000 to Postgresql a few years > ago via BCP files. I used a Python script to do some fixup on the > BCP files to make them importable as CSV files into Postgresql. I > don't know if quirks I ran into are still an issue with newer versions > of Sql Serv

Re: [GENERAL] Importing directly from BCP files

2015-11-15 Thread Tim Uckun
> > > That appears to depend on the -f option > > > I have the format files so that's good. > > Have you tried opening a file in a text editor to see what they look like? > > Yes. It looks like a binary file with lots of non printable ch

[GENERAL] Importing directly from BCP files

2015-11-15 Thread Tim Uckun
Does anybody have any documentation on what a BCP file from SQL server looks like? I have a directory full of BCP files and I would like to import them into PG. Has anybody done anything like this before? Thanks

Re: [GENERAL] Error when test on DBT2 Postgresql

2015-11-10 Thread Tim Chou
performance also makes sense to me. Best, Tim 2015-11-09 10:54 GMT-05:00 Adrian Klaver : > On 11/08/2015 07:40 PM, Tim Chou wrote: > >> Hi Adrian, >> >> Thank you all the time. I also realized that DBT2 has some bugs. >> Actually, I have sent an email to DBT2&#

Re: [GENERAL] Error when test on DBT2 Postgresql

2015-11-08 Thread Tim Chou
Hi Adrian, Thank you all the time. I also realized that DBT2 has some bugs. Actually, I have sent an email to DBT2's mailing list. However, no one responded me. The latency of a txn is not high in my test. But the number of txns processed in one minute are not high. Thank you. Best. Tim

[GENERAL] Error when test on DBT2 Postgresql

2015-11-07 Thread Tim Chou
tions per minute (NOTPM) 0.8 minute duration 0 total unknown errors 97.0 seconds(s) ramping up It seems only 2 txns/sec. Is that too low? How can I improve the performance? 3. How can I test the performance in distributed mode? Looking forward to your replies. Thanks, Tim

[GENERAL] Better way to process boolean query result in shell-like situations?

2015-10-28 Thread Tim Landscheidt
putting around '/bin/bash -c "[…]"' with yet another level of quoting. The best idea I had so far was to cause a runtime error (here with the logic reversed: If the user exists, psql re- turns failure, otherwise success): | [tim@passepartout ~]$ psql -c "SELECT usename

Re: [GENERAL] Multiple word synonyms (maybe?)

2015-10-22 Thread Tim van der Linden
get this up and running it might offer a nice opportunity to write a small post about this to expand on my PostgreSQL series... > -- > Kevin Grittner > EDB: http://www.enterprisedb.com > The Enterprise PostgreSQL Company Cheers, Tim -- 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] Multiple word synonyms (maybe?)

2015-10-20 Thread Tim van der Linden
(a unique phrase linked to its more generic replacement)? > ​Geoff​​ Cheers, Tim -- 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] Multiple word synonyms (maybe?)

2015-10-20 Thread Tim van der Linden
o be used on one of the next phases of the medical application. Thanks for the heads-up! > Cheers, > Rob Cheers, Tim -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general

[GENERAL] Multiple word synonyms (maybe?)

2015-10-20 Thread Tim van der Linden
atural language lookup perspective >you still wish to tie "Heart attack" to "Acute MI" so when a client search on >one, the other will turn up as well. Should I write my own tokenizer to catch all these words and present them as a single token? Or is this completely o

Re: [GENERAL] How can I use crosstab functons in PostgreSQL 9.3?

2015-10-15 Thread Tim Clarke
Looks to me like argument types possibly? The article creates various combinations of crosstab() function but you are passing in a query. Wrap your query in quotes (and then escape those within it). Then you'll be passing in a "text" type not an "unknown" as the error c

Re: [GENERAL] Delete rule does not prevent truncate

2015-07-27 Thread Tim Smith
> > Just in case it has not been made obvious yet, rules are silently > deprecated. They still exist because views depend on them, but it is > generally considered best practices to not use them outside that realm. Well, the manual doesn't seem to reflect that fact. If that's how the developers

Re: [GENERAL] Delete rule does not prevent truncate

2015-07-27 Thread Tim Smith
On 23 July 2015 at 19:25, Scott Marlowe wrote: > stick to triggers, they're faster Erm, not according to your beloved manual !!! 38.7. Rules Versus Triggers " a rule issuing one extra command is likely to be faster than a trigger" "The summary is, rules will only be significantly slower than t

  1   2   3   4   5   6   7   8   >