Skip to content

Import from sqlite ignores generated columns #1687

@c-w

Description

@c-w

pgloader 3.6.7~devel skips sqlite generated columns when importing to postgres. I'd expect this to translate to postgres generated columns.

Minimal repro

Step 1: create a sqlite database with a generated column.

sqlite3 foo.db 'create table foo(id integer, gen integer generated always as (id+1));'

Step 2: run pgloader

pgloader --with 'create no indexes' --with 'no foreign keys' --with 'schema only' \
  sqlite://./foo.db "pgsql://${PGUSER}:${PGPASSWORD}@${PGHOST}/${PGDATABASE}"

Step 3: inspect postgres schema

psql -c '\d+ foo'

Actual: schema in postgres doesn't include generated column

                                          Table "public.foo"
 Column |  Type  | Collation | Nullable | Default | Storage | Compression | Stats target | Description 
--------+--------+-----------+----------+---------+---------+-------------+--------------+-------------
 id     | bigint |           |          |         | plain   |             |              | 
Access method: heap

Expected: schema in postgres includes generated column

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions