"Danny Stewart" <dstewart(at)pcfa(dot)org> writes:
> I am trying to use
> SELECT substring(id from position(~ '[0-9]' in id)) FROM resources ;
> but that returns:
> Unable to identify a prefix operator '~' for type 'unknown'
I think you are mixing up substring() and position(). If I understand
your problem correctly, what you need is just the regex-style substring
function:
regression=# select substring('Folder 567 Section 6' from '[0-9]+');
substring
-----------
567
(1 row)
regards, tom lane