ts_rewrite in 10.4

Started by Douglas Dooleover 7 years ago3 messages
#1Douglas Doole
dougdoole@gmail.com

As I was double checking that the new function marking from 10.4 merged
correctly to our fork, I noticed that one of the ts_rewrite entries looks
wrong.

The release notes say:
ALTER FUNCTION pg_catalog.ts_rewrite(tsquery, tsquery, tsquery) PARALLEL
UNSAFE;

But when I pull pg_proc.h from 10.4, I find:
DATA(insert OID = 3684 ( ts_rewrite PGNSP PGUID 12 1 0 0 0 f f f f t f i s
3 0 3615 "3615 3615 3615" ...

Which I think means the function is still marked parallel safe. Am I
missing something?

- Doug
Salesforce

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Douglas Doole (#1)
Re: ts_rewrite in 10.4

Douglas Doole <dougdoole@gmail.com> writes:

The release notes say:
ALTER FUNCTION pg_catalog.ts_rewrite(tsquery, tsquery, tsquery) PARALLEL
UNSAFE;

But when I pull pg_proc.h from 10.4, I find:
DATA(insert OID = 3684 ( ts_rewrite PGNSP PGUID 12 1 0 0 0 f f f f t f i s
3 0 3615 "3615 3615 3615" ...

Which I think means the function is still marked parallel safe. Am I
missing something?

Oh ... that's a mistake in the release notes :-(. The 3-argument form of
ts_rewrite doesn't execute any user-supplied query; AFAICS it's not any
less safe than anything else. The 2-argument form runs a user-supplied
query string, and *does* need to be marked unsafe. So the patch got
it right, but then we got confused while making the notes.

regards, tom lane

#3Jonathan S. Katz
jkatz@postgresql.org
In reply to: Tom Lane (#2)
Re: ts_rewrite in 10.4

On May 10, 2018, at 10:16 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:

Douglas Doole <dougdoole@gmail.com> writes:

The release notes say:
ALTER FUNCTION pg_catalog.ts_rewrite(tsquery, tsquery, tsquery) PARALLEL
UNSAFE;

But when I pull pg_proc.h from 10.4, I find:
DATA(insert OID = 3684 ( ts_rewrite PGNSP PGUID 12 1 0 0 0 f f f f t f i s
3 0 3615 "3615 3615 3615" ...

Which I think means the function is still marked parallel safe. Am I
missing something?

Oh ... that's a mistake in the release notes :-(. The 3-argument form of
ts_rewrite doesn't execute any user-supplied query; AFAICS it's not any
less safe than anything else. The 2-argument form runs a user-supplied
query string, and *does* need to be marked unsafe. So the patch got
it right, but then we got confused while making the notes.

Updated notes in news section. Unfortunately too late to update email :(

Thanks,

Jonathan