pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Regex on field value
3+ messages / 3 participants
[nested] [flat]

* Regex on field value
@ 2018-04-14 20:59 Mike Martin <redtux1@gmail.com>
  2018-04-14 21:06 ` Re: Regex on field value David G. Johnston <david.g.johnston@gmail.com>
  0 siblings, 1 reply; 3+ messages in thread

From: Mike Martin @ 2018-04-14 20:59 UTC (permalink / raw)
  To: pgsql-general@lists.postgresql.org

Is this possible, eg
Substring(field, regex include other field name)
Thanks

^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: Regex on field value
  2018-04-14 20:59 Regex on field value Mike Martin <redtux1@gmail.com>
@ 2018-04-14 21:06 ` David G. Johnston <david.g.johnston@gmail.com>
  2018-04-14 21:12   ` Re: Regex on field value Adrian Klaver <adrian.klaver@aklaver.com>
  0 siblings, 1 reply; 3+ messages in thread

From: David G. Johnston @ 2018-04-14 21:06 UTC (permalink / raw)
  To: Mike Martin <redtux1@gmail.com>; +Cc: pgsql-general@lists.postgresql.org <pgsql-general@lists.postgresql.org>

On Saturday, April 14, 2018, Mike Martin <redtux1@gmail.com> wrote:

> Is this possible, eg
> Substring(field, regex include other field name)
>

Your example doesn't make sense but if you are asking whether a regular
expression can be stored in a column the answer is yes - though it's
nothing but a text value with runtime limitations.

David J.

^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: Regex on field value
  2018-04-14 20:59 Regex on field value Mike Martin <redtux1@gmail.com>
  2018-04-14 21:06 ` Re: Regex on field value David G. Johnston <david.g.johnston@gmail.com>
@ 2018-04-14 21:12   ` Adrian Klaver <adrian.klaver@aklaver.com>
  0 siblings, 0 replies; 3+ messages in thread

From: Adrian Klaver @ 2018-04-14 21:12 UTC (permalink / raw)
  To: David G. Johnston <david.g.johnston@gmail.com>; Mike Martin <redtux1@gmail.com>; +Cc: pgsql-general@lists.postgresql.org <pgsql-general@lists.postgresql.org>

On 04/14/2018 02:06 PM, David G. Johnston wrote:
> On Saturday, April 14, 2018, Mike Martin <redtux1@gmail.com 
> <mailto:redtux1@gmail.com>> wrote:
> 
>     Is this possible, eg
>     Substring(field, regex include other field name)

Something like?:

select substring(link_key from '^' || c_id  ), link_key, c_id from 
projection where link_key != 'no_key' limit 10;

  substring |  link_key   |  c_id
-----------+-------------+--------
  6RPLF     | 6RPLF-1646  | 6RPLF
  6RPLF     | 6RPLF-1646  | 6RPLF
  6RPLF     | 6RPLF-1646  | 6RPLF
  6RPLF     | 6RPLF-1646  | 6RPLF
  4RPLF     | 4RPLF-1694  | 4RPLF
  10CEHB    | 10CEHB-2628 | 10CEHB
  10CEHB    | 10CEHB-2628 | 10CEHB
  10CEHB    | 10CEHB-2628 | 10CEHB
  10CEHB    | 10CEHB-1698 | 10CEHB
  1GPLF     | 1GPLF-1704  | 1GPLF
(10 rows)

> 
> 
> Your example doesn't make sense but if you are asking whether a regular 
> expression can be stored in a column the answer is yes - though it's 
> nothing but a text value with runtime limitations.
> 
> David J.
> 


-- 
Adrian Klaver
adrian.klaver@aklaver.com




^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2018-04-14 21:12 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2018-04-14 20:59 Regex on field value Mike Martin <redtux1@gmail.com>
2018-04-14 21:06 ` David G. Johnston <david.g.johnston@gmail.com>
2018-04-14 21:12   ` Adrian Klaver <adrian.klaver@aklaver.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox