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

Querying Postgres Materialized Views Catalog: relation "pg_matviews" does not exist #3403

Open
mikeblum opened this issue May 28, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@mikeblum
Copy link

mikeblum commented May 28, 2024

Version

1.26.0

What happened?

A bug happened! Running:

go install github.com/sqlc-dev/sqlc/cmd/sqlc@latest
sqlc generate

errors with:

relation "pg_matviews" does not exist.

tried :exec, :many as well in terms of the sqlc annotations. sqlc vet returns the same error.


prior art:


versions:

❯ sqlc version
v1.26.0

Relevant log output

No response

Database schema

No response

SQL queries

-- name: ListMatViews :execresult

SELECT schemaname AS schema_name,
       matviewname AS view_name,
       matviewowner AS owner,
       ispopulated AS is_populated,
       definition
FROM pg_matviews
ORDER BY schemaname,
         matviewname;

Configuration

No response

Playground URL

https://play.sqlc.dev/p/0eae0cbbe4f0c8bd76da5385dfb3e69a9196f6bad0b01ace20a669b9621274a2

What operating system are you using?

macOS ARM M1

What database engines are you using?

PostgreSQL

SELECT version();
PostgreSQL 16.2 (Debian 16.2-1.pgdg120+2) on aarch64-unknown-linux-gnu, compiled by gcc (Debian 12.2.0-14) 12.2.0, 64-bit

What type of code are you generating?

Go

❯ go version
go version go1.22.3 darwin/arm64
@mikeblum mikeblum added bug Something isn't working triage New issues that hasn't been reviewed labels May 28, 2024
@terricain
Copy link
Contributor

This looks like its because sqlc doesnt know about the pg system catalogs - #1171

@kyleconroy kyleconroy removed the triage New issues that hasn't been reviewed label Aug 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants