Skip to content

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

Open
@mikeblum

Description

@mikeblum

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions