Thanks to visit codestin.com
Credit goes to github.com

Skip to content

inserting large number of rows using unnest with an array column #44

@retorquere

Description

@retorquere

If I try to insert an array column, I get error: type "varchar[][]" does not exist

await connection.query(sql`
      INSERT INTO xx (id, txt)
      SELECT *
      FROM ${sql.unnest(
        [
          [1, ['"', "'"]],
          [2, ["'", '"']],
        ],
        [
          'int4',
          'varchar[]'
        ]
      )}
    `)

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions