S.Nori
S.Nori

Reputation: 113

AWS Redshift - Identity Field Syntax

What does this Redshift Identity field creation syntax mean:

idfield int DEFAULT "identity"(6035942, 0, ('1,1'::character varying)::text) NOT NULL

Upvotes: 0

Views: 656

Answers (1)

53epo
53epo

Reputation: 909

See also this question

It will create an INT column named idfield which will get autopopulated with a numeric sequence starting at 1, and incrementing by 1 for every new record. "Autopopulated" means you don't have to specify that column in any INSERT statement: it will automatically get a new value.

A simpler syntax would be idfield int IDENTITY(1, 1) NOT NULL

Upvotes: 1

Related Questions