Re: [GENERAL] Regexp + spaces PG 9.1

2017-05-30 Thread Patrick B
2017-05-31 16:34 GMT+12:00 David G. Johnston : > On Tue, May 30, 2017 at 9:17 PM, Patrick B > wrote: > >> >> regexp_matches(name, '((main|medium).name/\d+.\d+)') as filename, >> >> >> Example here: http://sqlfiddle.com/#!15/5f4f0/4 >> >>1. can only get the jpg file name >> >> ​Because those

Re: [GENERAL] Regexp + spaces PG 9.1

2017-05-30 Thread David G. Johnston
On Tue, May 30, 2017 at 9:17 PM, Patrick B wrote: > > regexp_matches(name, '((main|medium).name/\d+.\d+)') as filename, > > > Example here: http://sqlfiddle.com/#!15/5f4f0/4 > >1. can only get the jpg file name > > ​Because those are the only two file names consisting of one or more numbers,

[GENERAL] Regexp + spaces PG 9.1

2017-05-30 Thread Patrick B
Hi guys, I've got a column which stores the file name on it, the column is character varying(255). I'm selecting that value in a CTE query; basically: test1 AS ( SELECT regexp_matches(name, '((main|medium).name/\d+.\d+)') as filename, * from test1; ) select filename[1] from test1 Exa

Re: [GENERAL] pg_basebackup error: replication slot "pg_basebackup_2194" already exists

2017-05-30 Thread Ludovic Vaugeois-Pepin
On Tue, May 30, 2017 at 9:32 PM, Magnus Hagander wrote: > On Tue, May 30, 2017 at 9:14 PM, Ludovic Vaugeois-Pepin > wrote: >> >> I ran into the issue described below with 10.0 beta. The error I got is: >> >> pg_basebackup: could not create temporary replication slot >> "pg_basebackup_2194": ERROR

Fwd: [GENERAL] pg_basebackup error: replication slot "pg_basebackup_2194" already exists

2017-05-30 Thread Ludovic Vaugeois-Pepin
Le 30 mai 2017 9:32 PM, "Magnus Hagander" a écrit : On Tue, May 30, 2017 at 9:14 PM, Ludovic Vaugeois-Pepin wrote: > > I ran into the issue described below with 10.0 beta. The error I got is: > > pg_basebackup: could not create temporary replication slot > "pg_basebackup_2194": ERROR: replicati

Re: [GENERAL] 9.5 "chained equality" behavior

2017-05-30 Thread David G. Johnston
On Tue, May 30, 2017 at 2:32 PM, David G. Johnston < david.g.johns...@gmail.com> wrote: > ​...​ > namely because aside from equality all of the comparison operators > convert their inputs to a boolean and so cannot be placed in sequence like > shown here (boolean compared to, say, integer doesn't

Re: [GENERAL] 9.5 "chained equality" behavior

2017-05-30 Thread David G. Johnston
On Tue, May 30, 2017 at 1:56 PM, Joshua Ma wrote: > Our team is upgrading from 9.4 to 9.5, and we noticed this behavior change: > > 9.4: > # SELECT true = true = true; > ?column? > -- > t > (1 row) > > 9.5: > # SELECT true = true = true; > ERROR: syntax error at or near "=" > LINE 1: S

Re: [GENERAL] 9.5 "chained equality" behavior

2017-05-30 Thread Tom Lane
Joshua Ma writes: > Our team is upgrading from 9.4 to 9.5, and we noticed this behavior change: > 9.5: > # SELECT true = true = true; > ERROR: syntax error at or near "=" > LINE 1: SELECT true = true = true; > Now, there's actually a larger problem with this, since it's not actually > chained eq

Re: [GENERAL] Access Management question

2017-05-30 Thread John R Pierce
On 5/30/2017 2:06 PM, chiru r wrote: Is there any reason, why it is showing roles name as owner of table instead of user? 'user' is a synonym for 'role' with login permission. CREATE USER fred; is exactly the same as... CREATE ROLE fred WITH LOGIN; when you SET ROLE rolename; its

[GENERAL] Access Management question

2017-05-30 Thread chiru r
Hi All, I have a question about access management in PostgreSQL , please help me to understand. I am creating a role dba_admin with superuser role. after that created a user scott and then granted dba_admin role to user scott. postgres=# create role dba_admin superuser; CREATE ROLE postgres=# c

Re: [GENERAL] 9.5 "chained equality" behavior

2017-05-30 Thread Thomas Kellerer
Joshua Ma schrieb am 30.05.2017 um 22:56: We're going to fix usages of this to instead do (a = b && a = c) instead of (a = b = c). That has to be (a = b AND a = c) The && operator is not valid for booleans -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make chan

[GENERAL] 9.5 "chained equality" behavior

2017-05-30 Thread Joshua Ma
Our team is upgrading from 9.4 to 9.5, and we noticed this behavior change: 9.4: # SELECT true = true = true; ?column? -- t (1 row) 9.5: # SELECT true = true = true; ERROR: syntax error at or near "=" LINE 1: SELECT true = true = true; Now, there's actually a larger problem with this,

Re: [GENERAL] pg_basebackup error: replication slot "pg_basebackup_2194" already exists

2017-05-30 Thread Magnus Hagander
On Tue, May 30, 2017 at 9:14 PM, Ludovic Vaugeois-Pepin wrote: > I ran into the issue described below with 10.0 beta. The error I got is: > > pg_basebackup: could not create temporary replication slot > "pg_basebackup_2194": ERROR: replication slot "pg_basebackup_2194" > already exists > > A rac

Re: [GENERAL] pg_basebackup error: replication slot "pg_basebackup_2194" already exists

2017-05-30 Thread Kenneth Marshall
On Tue, May 30, 2017 at 09:14:41PM +0200, Ludovic Vaugeois-Pepin wrote: > I ran into the issue described below with 10.0 beta. The error I got is: > > pg_basebackup: could not create temporary replication slot > "pg_basebackup_2194": ERROR: replication slot "pg_basebackup_2194" > already exists >

[GENERAL] pg_basebackup error: replication slot "pg_basebackup_2194" already exists

2017-05-30 Thread Ludovic Vaugeois-Pepin
I ran into the issue described below with 10.0 beta. The error I got is: pg_basebackup: could not create temporary replication slot "pg_basebackup_2194": ERROR: replication slot "pg_basebackup_2194" already exists A race condition? Or maybe I am doing something wrong. Release: Name

[GENERAL] Slow query plan used

2017-05-30 Thread Wetzel, Juergen (Juergen)
I have a question concerning the query planner. I observe that chosen query plan differs on length and content of a like search expression. We have a view combining data from two tables, both containing same number of rows (round about 3). Used PostgreSQL version is 9.3.15 on Windows. DDL of