Re: tsvector string representation and parsing

2022-02-24 Thread Tom Lane
=?UTF-8?Q?Johannes_Gra=c3=abn?= writes: > Before using format(), I tried just generating those strings by doubling > any single quote or backslash and enclosing the whole string in single > quotes, but that didn't seem a safe way, though it works in principle: That's the documented requirement,

Re: tsvector string representation and parsing

2022-02-23 Thread Johannes Graƫn
Thanks, Tom. On 23/02/2022 23.30, Tom Lane wrote: =?UTF-8?Q?Johannes_Gra=c3=abn?= writes: This is a minimal example that goes wrong (but shouldn't IMHO: SELECT format('%L:1', '\:')::tsvector format(%L) is designed to produce a SQL literal, which does not have the same requirements as a

Re: tsvector string representation and parsing

2022-02-23 Thread Tom Lane
=?UTF-8?Q?Johannes_Gra=c3=abn?= writes: > This is a minimal example that goes wrong (but shouldn't IMHO: >> SELECT format('%L:1', '\:')::tsvector format(%L) is designed to produce a SQL literal, which does not have the same requirements as a tsvector element ... yeah, they're close, but not clos