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

Allow nextval() to take a regclass instance #879

Merged
merged 2 commits into from
Oct 24, 2024
Merged

Conversation

fulghum
Copy link
Contributor

@fulghum fulghum commented Oct 22, 2024

Allows the nextval() function to take a regclass parameter. Also changes the output function of regclass so that the returned relation name is schema-qualified if the schema is not on search_path.

This change also moves the GetCurrentSchemas() function into a new settings package to break a package import cycle. The new settings package is intended for low-level functions that access settings, without dependencies on other packages.

Fixes: #850

@fulghum fulghum force-pushed the fulghum/nextval_regclass branch from da78a20 to c0c7eff Compare October 22, 2024 23:33
Copy link
Contributor

github-actions bot commented Oct 22, 2024

Main PR
Total 42090 42090
Successful 12864 12867
Failures 29226 29223
Partial Successes1 4892 4892
Main PR
Successful 30.5631% 30.5702%
Failures 69.4369% 69.4298%

${\color{lightgreen}Progressions}$

sequence

QUERY: SELECT nextval('sequence_test'::regclass);
QUERY: SELECT nextval('sequence_test'::regclass);
QUERY: SELECT nextval('sequence_test'::regclass);

Footnotes

  1. These are tests that we're marking as Successful, however they do not match the expected output in some way. This is due to small differences, such as different wording on the error messages, or the column names being incorrect while the data itself is correct.

@fulghum fulghum force-pushed the fulghum/nextval_regclass branch from c0c7eff to 11b329a Compare October 23, 2024 00:06
@fulghum fulghum requested a review from Hydrocharged October 23, 2024 00:21
…e text->regclass->text conversion is very slow.
Copy link
Collaborator

@Hydrocharged Hydrocharged left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! One of the changes are a little concerning though

server/types/text.go Show resolved Hide resolved
@fulghum fulghum merged commit c84a300 into main Oct 24, 2024
13 checks passed
@fulghum fulghum deleted the fulghum/nextval_regclass branch October 24, 2024 16:43
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.

Column default value expression error
2 participants