|From:||Robert Schreiber <bobschreiber(at)charter(dot)net>|
|Subject:||PostgreSQL 9.3.5 substring(text from pattern for escape) bug|
|Views:||Raw Message | Whole Thread | Download mbox | Resend email|
I believe I have come across a bug in the substring(text from pattern
for escape) function.
What I am attempting to do is take a string like 'QMy NameQ' , strip off
leading/and/or/trailing Qs and return 'My Name'.
The substring() call that I have coded is substring(xxx from 'Q?#"%#"Q?'
My understand of this is:
Q? -- matches 0 or 1 occurrences of Q (the leading one, if present)
#" -- starts data collection
% -- matches any number of characters
#" -- ends data collection
Q? -- matches 0 or 1 occurrences of Q (the trialing one, if present)
What appears to be happening is that the _Q? on the tail_ is being
matched, but _the Q is also being included in the collected data.__
The attached PSQL test.sql file creates a table, populates it with 7
test cases with my expected results, and then executes substring()
There is an attached test_output.txt file is the PSQL output that
illustrates the problem. The column "Error" is true when the actual
value disagrees with what I expected.
PostgreSQL 9.3.5, compiled by Visual C++ build 1600, 64-bit
Running under Windows 10 64-bit.
|Next Message||Daniel Verite||2019-05-11 11:18:23||Re: PostgreSQL 9.3.5 substring(text from pattern for escape) bug|
|Previous Message||Tom Lane||2019-05-10 21:05:09||Re: inconsistent results querying table partitioned by date|