Answer the question
In order to leave comments, you need to log in
How to add an empty row to a table in PostgreSQL?
Good day dear!
There was a need to create empty rows in a Postgres table. For example, we have a table:
id - SERIAL,
title - VARCHAR
INSERT INTO table1 (title) VALUES (NULL);
since most tables have a title field . But when it comes to tables that do not have a title field , it becomes necessary to override the methods of the class that creates empty rows, and this looks rather strange in terms of code quality. INSERT INTO table1 (id) VALUES (NULL);
or INSERT INTO table1 () VALUES ();
, but PG stubbornly refuses to accept such constructions.
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question