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

RPC returning table alias now works for pg 11/12 #2737

Merged
merged 2 commits into from
Apr 5, 2023

Conversation

steve-chavez
Copy link
Member

The new LATERAL query used for calling the function, introduced on #2677, failed on functions that returned a domain like CREATE DOMAIN projects_domain AS projects.

Work around that by changing the query conditionally, by obtaining a bool that represents the composite alias on the SchemaCache and only do this on pg 11 and 12.

The new LATERAL query used for calling the function, introduced on
PostgREST#2677, failed on functions
that returned a domain like `CREATE DOMAIN projects_domain AS projects`.

Work around that by changing the query conditionally, by
obtaining a bool that represents the composite alias on the SchemaCache
and only do this on pg 11 and 12.
@@ -376,8 +376,7 @@ spec actualPgVersion =
]|]
{ matchHeaders = [matchContentTypeJson] }

-- https://github.com/PostgREST/postgrest/pull/2677#issuecomment-1444976849
when (actualPgVersion >= pgVersion130) $
when (actualPgVersion >= pgVersion110) $
Copy link
Member Author

Choose a reason for hiding this comment

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

This is the main thing. These tests now pass for pg 11 and 12.

Co-authored-by: Laurence Isla <vanquisher.laurence.02@gmail.com>
@steve-chavez steve-chavez merged commit acf6232 into PostgREST:main Apr 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants