Skip to content

pg_catalog.pg_tables uses interface{} rather than string types #2714

Closed
@weeco

Description

@weeco

Version

1.21.0

What happened?

This query:

-- name: GetTables :many
SELECT *
FROM pg_catalog.pg_tables
WHERE schemaname != 'pg_catalog' AND
    schemaname != 'information_schema';

generates the following schema:

type GetTablesRow struct {
	Schemaname  interface{}
	Tablename   interface{}
	Tableowner  interface{}
	Tablespace  interface{}
	Hasindexes  pgtype.Bool
	Hasrules    pgtype.Bool
	Hastriggers pgtype.Bool
	Rowsecurity pgtype.Bool
}

The type for Schemaname, Tablename, Tableowner should be string and for Tablespace a string pointer instead of the interface{} I believe.

Relevant log output

No response

Database schema

No response

SQL queries

-- name: GetTables :many
SELECT *
FROM pg_catalog.pg_tables
WHERE schemaname != 'pg_catalog' AND
    schemaname != 'information_schema';

Configuration

No response

Playground URL

No response

What operating system are you using?

macOS

What database engines are you using?

PostgreSQL

What type of code are you generating?

Go

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingtriageNew issues that hasn't been reviewed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions