0

What does this Redshift Identity field creation syntax mean:

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

S.Nori
  • 113
  • 11

1 Answers1

1

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

53epo
  • 784
  • 5
  • 7
  • Thanks @Schepo. Yes, I understood that this is an Identity column. But couldn't understand the syntax. The Link you have provided has answered the question. – S.Nori Aug 09 '21 at 17:59