Skip to content

Support PostgreSQL CREATE TABLE LIKE #481

Closed
@mmcloughlin

Description

@mmcloughlin

The following create table statement

CREATE TABLE changes (
    ranked INT NOT NULL
);

CREATE TABLE changes_ranked (
    LIKE changes INCLUDING ALL,
    rank_by_effect_size INT NOT NULL,
    rank_by_abs_percent_change INT NOT NULL
);


-- name: AllRanked :many
SELECT * FROM changes_ranked;

produces model

type ChangesRanked struct {
       RankByEffectSize       int32
       RankByAbsPercentChange int32
}

Columns from the changes table are ignored.

(Aside: I encountered this while trying to work around #159. The changes_ranked table is an attempt to materialize what would have been a subquery.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions