IDENTITY

Description

Clause that specifies that the column is an IDENTITY column. (RedShift SQL Language Reference Identity).

Grammar Syntax

IDENTITY ( seed, step )

Sample Source Patterns

Input Code:

IN -> Redshift_01.sql
CREATE TABLE table1 (
    doc INTEGER,
    id1 INTEGER IDENTITY(1,1),
    id2 INTEGER  DEFAULT "identity"(674435, 0, ('5,3'::character varying)::text),
    id3 INTEGER  DEFAULT default_identity(963861, 1, '1,2'::text),
    id4 INTEGER  DEFAULT "default_identity"(963861, 1, '1,6'::text)
);

INSERT INTO table1 (doc) VALUES (1),(2),(3);

SELECT * FROM table1;

Output Code:

OUT -> Redshift_01.sql
CREATE TABLE table1 (
    doc INTEGER,
    id1 INTEGER IDENTITY(1,1) ORDER,
    id2 INTEGER IDENTITY(5,3) ORDER,
    id3 INTEGER IDENTITY(1,2) ORDER,
    id4 INTEGER IDENTITY(1,6) ORDER
)
COMMENT = '{ "origin": "sf_sc", "name": "snowconvert", "version": {  "major": 0,  "minor": 0,  "patch": "0" }, "attributes": {  "component": "redshift",  "convertedOn": "12/04/2024",  "domain": "test" }}';

INSERT INTO table1 (doc) VALUES (1),(2),(3);

SELECT * FROM
 table1;

Known Issues

No issues were found.

There are no known issues.

Last updated