Questions tagged [pattern-matching]
The pattern-matching tag has no summary.
95 questions
0 votes
1 answer
15 views
Negative lookahead in table-matching pattern for psql or pg_dump
I'm trying to do a schema-only pg_dump of my database, however with data from one or two specific tables included. This means I can't use the --schema-only or --data-only options of pg_dump, and I can'...
0 votes
1 answer
72 views
Pattern match with CTE
How do you pattern match using cte? id accountids email a12 456,789,012 [email protected] b23 546,982,123 [email protected] c45 654,982,456 [email protected] I've tried following: with cte1 as ( select '''' || '{'...
0 votes
1 answer
1k views
How to get exact match when the column used for filtering is comma-separated list in postgresql
I have a column which will have values like: FC FCW FC,FCW FX,FC My input used for filtering should give correct result (match the exact value in the column) ex: FC like 'FC,FCW' --> true FC like '...
0 votes
1 answer
6k views
How to match a column against an array of seach strings?
I have a table jsondocs with the following columns: id SERIAL json TEXT I want to check if the columns json contains some values but not exact match. For example I can to do something like: select * ...
0 votes
1 answer
669 views
* wildcard only matching whitespace in mysql match against
I am trying to set up a search function on my web site. I have a table called projects with the following content: +----+--------+------------------------------------------------------------+----------...
-2 votes
1 answer
2k views
How to store only US/Canada phone numbers in postgres?
I want to store only US and Canada phone numbers in a Postgres TEXT column. I don't want to use pg_libphonenumber. What CHECK constraints should I be using for this purpose?
0 votes
1 answer
746 views
MySQL - Search Alphanumeric string using wildcards - underscore (_) and asterisk (*)
I have a table, products, with a product_id column as follows: product_id 110177 110177T 177 I am trying to filter down the product results that should fetch result as below but it is also fetching ...
0 votes
1 answer
3k views
Find partial match with textsearch query
I have the following query that I did hard looking on this site: SELECT * FROM renns WHERE ( to_tsvector('english', coalesce(numar_admin, '')) || to_tsvector('english', coalesce(...