Re: [GENERAL] Pattern Matching question - PG 9.6

Поиск
Список
Период
Сортировка
От Patrick B
Тема Re: [GENERAL] Pattern Matching question - PG 9.6
Дата
Msg-id CAJNY3iuySkvg1j-KQKsefTJsMn9wxpWNckHhaOHSAMGuT48LnA@mail.gmail.com
обсуждение исходный текст
Ответ на [GENERAL] Pattern Matching question - PG 9.6  (Patrick B <patrickbakerbr@gmail.com>)
Список pgsql-general


2017-05-15 15:20 GMT+12:00 Patrick B <patrickbakerbr@gmail.com>:


 

AS you can see above, when performing this query:
SELECT * FROM test1 WHERE client_id = 10 AND path ~ '^/testfile/client/[0-9]+/attachment/(([0-9]{1,14})|(unassigned))/'

I get 5 rows. But actually I only want/need 3 of them:

  • with the 'master' variation
  • and if it is unassigned (attachment/unassigned); then i want it too

The rows that I should be getting are:

5   /testfile/client/10/attachment/1000/master/   10

7   /testfile/client/10/attachment/unassigned/file/1001/master   10

8   /testfile/client/10/attachment/unassigned/file/1002/master   10


What am I doing wrong?

Thanks

Patrick.


В списке pgsql-general по дате отправления:

Предыдущее
От: Patrick B
Дата:
Сообщение: [GENERAL] Pattern Matching question - PG 9.6
Следующее
От: "David G. Johnston"
Дата:
Сообщение: Re: [GENERAL] Pattern Matching question - PG 9.6