Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove STRICT from all functions #172

Open
steve-chavez opened this issue Dec 12, 2024 · 0 comments
Open

Remove STRICT from all functions #172

steve-chavez opened this issue Dec 12, 2024 · 0 comments
Labels

Comments

@steve-chavez
Copy link
Member

Problem

While working on supporting DELETE with a request body, I added a new parameter with a NULL default to grant backwards compat:

create or replace function net.http_delete(
...
    body jsonb default NULL
)
    returns bigint
    strict
    volatile
    parallel safe
    language plpgsql

Then while doing:

select net.http_delete('http://localhost:8080/delete');

I kept getting a NULL result, after a lot of time of head-scratching, I realized it was because of the STRICT modifier in the function. That clause is always surprising, the behavior escapes the natural flow of code.

It also causes performance problems (PostgREST/postgrest-docs#224). IMO it should NEVER be used.

Solution

Remove STRICT from all functions.

While at it, clean up the signatures of the functions from unnecessary words like volatile, etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant