Content-Length: 261514 | pFad | https://github.com/postgresml/postgresml/pull/1114

89 Mutable SQL commands should be used with Spi::update(). by higuoxing · Pull Request #1114 · postgresml/postgresml · GitHub
Skip to content

Mutable SQL commands should be used with Spi::update(). #1114

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

Merged
merged 1 commit into from
Oct 23, 2023

Conversation

higuoxing
Copy link
Contributor

@higuoxing higuoxing commented Oct 23, 2023

Commands like 'INSERT', 'CREATE TABLE' are modifying database objects. They should be used with 'Spi::update()'12.

Besides, one of the unnecessary calling of '.clone()' is removed.

Co-Authored-By: Chen Mulong chenmulong@gmail.com

Footnotes

  1. https://www.postgresql.org/docs/current/spi-spi-execute.html

  2. https://github.com/pgcentralfoundation/pgrx/blob/64fbc2e2efb06212046082ffcde2e794ccb4d48a/pgrx/src/spi/client.rs#L60

Commands like 'INSERT', 'CREATE TABLE' are modifying database objects.
They should be used in 'Spi::update()'[1][2].

Besides, one of the unnecessary calling of '.clone()' is removed.

[1]: https://www.postgresql.org/docs/current/spi-spi-execute.html
[2]: https://github.com/pgcentralfoundation/pgrx/blob/64fbc2e2efb06212046082ffcde2e794ccb4d48a/pgrx/src/spi/client.rs#L60

Co-Authored-By: Chen Mulong <chenmulong@gmail.com>
@higuoxing higuoxing changed the title Mutable SQL commands should be used in Spi::update(). Mutable SQL commands should be used with Spi::update(). Oct 23, 2023
@montanalow montanalow self-requested a review October 23, 2023 15:46
@montanalow
Copy link
Contributor

Thanks for this fix!

@montanalow montanalow merged commit a46825a into postgresml:master Oct 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: https://github.com/postgresml/postgresml/pull/1114

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy