Re: [GENERAL] initdb createuser commands

2016-10-29 Thread Gavin Flower
On 30/10/16 11:25, John R Pierce wrote: On 10/29/2016 3:02 PM, Samuel Williams wrote: FYI,https://wiki.archlinux.org/index.php/PostgreSQL mentions initdb, createuser, createdb and several others. I think my suggestion is still relevant and something that would improve the system for new users

Re: [GENERAL] initdb createuser commands

2016-10-29 Thread Melvin Davidson
On Sat, Oct 29, 2016 at 6:25 PM, John R Pierce wrote: > On 10/29/2016 3:02 PM, Samuel Williams wrote: > >> FYI,https://wiki.archlinux.org/index.php/PostgreSQL mentions initdb, >> createuser, createdb and several others. I think my suggestion is >> still relevant and something that would improve

Re: [GENERAL] initdb createuser commands

2016-10-29 Thread John R Pierce
On 10/29/2016 3:02 PM, Samuel Williams wrote: FYI,https://wiki.archlinux.org/index.php/PostgreSQL mentions initdb, createuser, createdb and several others. I think my suggestion is still relevant and something that would improve the system for new users and it would break it for the existing c

Re: [GENERAL] initdb createuser commands

2016-10-29 Thread Adrian Klaver
On 10/29/2016 03:02 PM, Samuel Williams wrote: FYI, https://wiki.archlinux.org/index.php/PostgreSQL mentions initdb, createuser, createdb and several others. I think my suggestion is still relevant and something that would improve the system for new users :) Seems to me the solution would be to

Re: [GENERAL] initdb createuser commands

2016-10-29 Thread Samuel Williams
FYI, https://wiki.archlinux.org/index.php/PostgreSQL mentions initdb, createuser, createdb and several others. I think my suggestion is still relevant and something that would improve the system for new users :) -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make change

Re: [GENERAL] Row level security performance joining large tables

2016-10-29 Thread Tom Lane
"David R. Pike" writes: > I recently applied RLS to several large (several million rows) tables in my > 9.5 database and noticed that queries against a single large RLS protected > table perform well however queries that join several large RLS protected > tables perform very poorly. The explai

Re: [GENERAL] What is the 'data2' directory for?

2016-10-29 Thread Steven Hirsch
On Tue, 25 Oct 2016, Tom Lane wrote: Steven Hirsch writes: I notice that PostgreSQL (both 9.5.4 and 9.6) create a 'data2' directory as a peer to the 'data' directory I specified at database initialization. What is this directory for and what parameter determines its location? Postgres itsel

Re: [GENERAL] Cannot access the return value of a PostgreSQL function using ADO

2016-10-29 Thread Adrian Klaver
On 10/28/2016 08:08 AM, Mick GRIFFIN wrote: > Hi, > > I have a Postgres function > > > > CREATE OR REPLACE FUNCTION updateconfigitem(inputkey character varying, > > inputvalue character varying, > > modif

Re: [GENERAL] initdb createuser commands

2016-10-29 Thread Samuel Williams
I think there is an opportunity here to make the experience for new users better. Firstly, I think having one or two top level commands, perhaps pga [postgres admin], and pg [postgres client], with well documented sub-commands. Ideally `man pg` would tell you all the client commands and `man pga`

[GENERAL] postgres installer fails with comspec error even though it is correct

2016-10-29 Thread Venkatesh Gudi (vgudi)
Hi, I am trying to install postgres on windows 7 64 bit machine. I get a COMSPEC error message. I checked comspec using %COMSPEC%" /C "echo test ok and it looks okay. Following is the detailed error message. Executing C:\Users\tempuser\AppData\Local\Temp/postgresql_installer_f998810adb/temp_che

[GENERAL] Cannot access the return value of a PostgreSQL function using ADO

2016-10-29 Thread Mick GRIFFIN
Hi, I have a Postgres function CREATE OR REPLACE FUNCTION updateconfigitem(inputkey character varying, inputvalue character varying, modifier character varying) RETURNS integer AS $BODY$ BEGIN UPDATE con

[GENERAL] Row level security performance joining large tables

2016-10-29 Thread David R. Pike
I recently applied RLS to several large (several million rows) tables in my 9.5 database and noticed that queries against a single large RLS protected table perform well however queries that join several large RLS protected tables perform very poorly. The explain plan shows the optimizer is sca

Re: [GENERAL] Best way to return Random rows from a table with non-repeatability of rows

2016-10-29 Thread Kiran
Hi Chris, Thank you very much. Will look into examples and syntax. regards Kiran On Sat, Oct 29, 2016 at 3:18 PM, Chris Mair wrote: > Dear folks, >> >> I have a table with thousands of rows ( currently 15 thousand but will >> grow very fast). >> I need to return from the query rows which are

Re: [GENERAL] E-R diagram code U1

2016-10-29 Thread Rich Shepard
On Sat, 29 Oct 2016, Adrian Klaver wrote: http://stackoverflow.com/questions/5628533/what-does-i1-i2-u1-means-in-visio-database-relationship-diagram http://stackoverflow.com/questions/23533702/about-entity-relationship-diagram Thanks, Adrian. I suspected that I was not effectively expressing

Re: [GENERAL] E-R diagram code U1

2016-10-29 Thread Adrian Klaver
On 10/29/2016 09:47 AM, Rich Shepard wrote: On Sat, 29 Oct 2016, Tom Lane wrote: What does U1 represent? Unique constraint, perhaps? I'm just guessing. Tom, That's my guess, too. I've not seen it used before now and did not know if it's a standard code for something or one specific t

Re: [GENERAL] E-R diagram code U1

2016-10-29 Thread Rich Shepard
On Sat, 29 Oct 2016, Tom Lane wrote: What does U1 represent? Unique constraint, perhaps? I'm just guessing. Tom, That's my guess, too. I've not seen it used before now and did not know if it's a standard code for something or one specific to this agency. Thanks, Rich -- Sent via p

Re: [GENERAL] E-R diagram code U1

2016-10-29 Thread Tom Lane
Rich Shepard writes: >Looking at the entity-relationship diagram for a regulatory agency database > they have attribute identifiers of PK, FKn, and U1. The first is the Primary > Key and the second is a Foreign Key, but I've not before seen a 'Un' > identifyier. I've no idea what DBMS they're

[GENERAL] E-R diagram code U1

2016-10-29 Thread Rich Shepard
Looking at the entity-relationship diagram for a regulatory agency database they have attribute identifiers of PK, FKn, and U1. The first is the Primary Key and the second is a Foreign Key, but I've not before seen a 'Un' identifyier. I've no idea what DBMS they're using (but suspect Oracle). My

Re: [GENERAL] initdb createuser commands

2016-10-29 Thread Adrian Klaver
On 10/29/2016 03:31 AM, Samuel Williams wrote: (For some reason the first time I sent this message it was blocked due to the keyword "sub-". So, I've changed that and am re-sending.) I think there is an opportunity here to make the experience for new users better. Firstly, I think having one or

Re: [GENERAL] How to hint 2 coulms IS NOT DISTINCT FROM each other

2016-10-29 Thread Kim Rose Carlsen
>> This doesn't do much good. This doesn't tell the planner that the 3 >> customer_ids are actually of same value, and it therefore can't filter them >> as it sees fit. > You do know you can index on a function, and the planner then keeps > stats on it when you run analyze right? Yes, but I don'

Re: [GENERAL] Best way to return Random rows from a table with non-repeatability of rows

2016-10-29 Thread Chris Mair
Dear folks, I have a table with thousands of rows ( currently 15 thousand but will grow very fast). I need to return from the query rows which are random and non-repeating. I know there is random() function, but would like to know from postgresql practitioners before embarking that path. Pleas

Re: [GENERAL] How to hint 2 coulms IS NOT DISTINCT FROM each other

2016-10-29 Thread Scott Marlowe
On Sat, Oct 29, 2016 at 6:55 AM, Kim Rose Carlsen wrote: >> try this :-D > >> create or replace function indf(anyelement, anyelement) returns anyelement >> as >> $$ >> select $1 = $2 or ($1 is null and $2 is null); >> $$ language sql; >> >> CREATE VIEW view_circuit_with_status AS ( >>SELECT

Re: [GENERAL] How to hint 2 coulms IS NOT DISTINCT FROM each other

2016-10-29 Thread Kim Rose Carlsen
> try this :-D > create or replace function indf(anyelement, anyelement) returns anyelement as > $$ > select $1 = $2 or ($1 is null and $2 is null); > $$ language sql; > > CREATE VIEW view_circuit_with_status AS ( >SELECT r.*, > s.circuit_status, > s.customer_id AS s_cust

[GENERAL] Best way to return Random rows from a table with non-repeatability of rows

2016-10-29 Thread Kiran
Dear folks, I have a table with thousands of rows ( currently 15 thousand but will grow very fast). I need to return from the query rows which are random and non-repeating. I know there is random() function, but would like to know from postgresql practitioners before embarking that path. Please l

Re: [GENERAL] WHERE ... IN condition and multiple columns in subquery

2016-10-29 Thread Alexander Farber
Thank you for the advices and I have also got few answers at http://stackoverflow.com/questions/40304011/where-in-condition-and-multiple-columns-in-subquery Regards Alex

Re: [GENERAL] initdb createuser commands

2016-10-29 Thread Samuel Williams
(For some reason the first time I sent this message it was blocked due to the keyword "sub-". So, I've changed that and am re-sending.) I think there is an opportunity here to make the experience for new users better. Firstly, I think having one or two top level commands, perhaps pga [postgres ad

Re: [GENERAL] SELECT DISTINCT ON removes results

2016-10-29 Thread Geoff Winkless
On 28 October 2016 at 21:39, Guyren Howe wrote: > Using 9.5, this query: > > SELECT o.id, >a.number AS awb > FROM pt.orders o > LEFT JOIN ( > SELECT DISTINCT ON ((string_agg(air_way_bills.number::text, > ','::text))) > string_agg(air_way_bills.number::