Answer the question
In order to leave comments, you need to log in
Why doesn't my primary key work?
I don’t understand a little why the primary key doesn’t work for me and it goes constantly as a null value.
Here is a screenshot
It seems that it should increase?
Answer the question
In order to leave comments, you need to log in
PostgreSQL has smallserial, serial and bigserial data types. They are for creating unique identity columns. This is analogous to the AUTO_INCREMENT property found in some other databases.
You are using BIGINT type, replace with BIGSERIAL.
Simple example:
CREATE TABLE books (
id SERIAL PRIMARY KEY,
title VARCHAR(100) NOT NULL,
primary_author VARCHAR(100) NULL
);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question