http://www.postgresql.org/docs/9.1/interactive/functions-string.html
-- search substringposition('om' in 'Thomas') = 3-- substring by positionsubstring('Thomas' from 2 for 3) = hom-- matching pattern, # as delimiter, use #" in pattern, pattern must match whole stringsubstring('foobar' from '%#"o_b#"%' for '#') = oob-- matching regular expression, () indicates re to fetch, (?:re) is non-reporting re that only group but not fetchsubstring('foobar' from 'o.b') oobsubstring('foobar' from 'o(.)b') osubstring(category from '^(.*?)(?:: .*)?$') as mcat, substring('Thomas' from '...$') = 'mas'http://www.postgresql.org/docs/9.1/interactive/functions-matching.html