Re: [GENERAL] regexp_matches where clause - PG 9.1

2017-04-06 Thread Patrick B
2017-04-07 14:19 GMT+12:00 David G. Johnston : > On Thu, Apr 6, 2017 at 7:15 PM, Patrick B > wrote: > >> >> David, >> That won't work. >> > > ​Actually, it works fine, you just keep moving the under-specified problem > space. > ​ > I'd suggest creating a self-contained running example that gets y

Re: [GENERAL] regexp_matches where clause - PG 9.1

2017-04-06 Thread David G. Johnston
On Thu, Apr 6, 2017 at 7:15 PM, Patrick B wrote: > > David, > That won't work. > ​Actually, it works fine, you just keep moving the under-specified problem space. ​ I'd suggest creating a self-contained running example that gets you close and show what the final output should be. David J.

Re: [GENERAL] regexp_matches where clause - PG 9.1

2017-04-06 Thread Arjen Nienhuis
On Apr 7, 2017 4:16 AM, "Patrick B" wrote: 2017-04-07 14:08 GMT+12:00 David G. Johnston : > On Thu, Apr 6, 2017 at 6:33 PM, Patrick B > wrote: > >> When actually I just want the 'main'' >> > > ​SELECT * FROM tbl WHERE path_name ~ '/main$' ? > > David J. > ​ > David, That won't work. When p

Re: [GENERAL] regexp_matches where clause - PG 9.1

2017-04-06 Thread Arjen Nienhuis
On Apr 7, 2017 4:08 AM, "David G. Johnston" wrote: On Thu, Apr 6, 2017 at 6:33 PM, Patrick B wrote: > When actually I just want the 'main'' > ​SELECT * FROM tbl WHERE path_name ~ '/main$' ? David J. ​ Or just: SELECT 'main';

Re: [GENERAL] regexp_matches where clause - PG 9.1

2017-04-06 Thread Patrick B
2017-04-07 14:08 GMT+12:00 David G. Johnston : > On Thu, Apr 6, 2017 at 6:33 PM, Patrick B > wrote: > >> When actually I just want the 'main'' >> > > ​SELECT * FROM tbl WHERE path_name ~ '/main$' ? > > David J. > ​ > David, That won't work. When performing the select, I got: /{s3bucket}/files

Re: [GENERAL] regexp_matches where clause - PG 9.1

2017-04-06 Thread David G. Johnston
On Thu, Apr 6, 2017 at 6:33 PM, Patrick B wrote: > When actually I just want the 'main'' > ​SELECT * FROM tbl WHERE path_name ~ '/main$' ? David J. ​

Re: [GENERAL] regexp_matches where clause - PG 9.1

2017-04-06 Thread Patrick B
2017-04-06 18:10 GMT+12:00 Patrick B : > > 2017-04-06 17:35 GMT+12:00 Arjen Nienhuis : > >> >> >> On Apr 6, 2017 05:57, "Patrick B" wrote: >> >> Hi guys, >> >> i've got this column: >> >> path_name character varying(255) >>> >> >> I store full S3 bucket path for the attachments of my application

Re: [GENERAL] regexp_matches where clause - PG 9.1

2017-04-05 Thread Patrick B
2017-04-06 17:35 GMT+12:00 Arjen Nienhuis : > > > On Apr 6, 2017 05:57, "Patrick B" wrote: > > Hi guys, > > i've got this column: > > path_name character varying(255) >> > > I store full S3 bucket path for the attachments of my application on it; > example: > > /{s3bucket}/filesuser/client/278011

Re: [GENERAL] regexp_matches where clause - PG 9.1

2017-04-05 Thread Arjen Nienhuis
On Apr 6, 2017 05:57, "Patrick B" wrote: Hi guys, i've got this column: path_name character varying(255) > I store full S3 bucket path for the attachments of my application on it; example: /{s3bucket}/filesuser/client/27801123/attachment/4510/main > /{s3bucket}/filesuser/client/27801123/attac

[GENERAL] regexp_matches where clause - PG 9.1

2017-04-05 Thread Patrick B
Hi guys, i've got this column: path_name character varying(255) > I store full S3 bucket path for the attachments of my application on it; example: /{s3bucket}/filesuser/client/27801123/attachment/4510/main > /{s3bucket}/filesuser/client/27801123/attachment/4510/file > I wanna do a select, wh