Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Inserting with empty values in PostgreSQL causes error

My table has three columns, but I'm only using one for most rows.

I'm trying to do a basic insert in PSQL, like so:

grouper=> INSERT INTO master_list VALUES ('Ebay',,);

But I'm getting a syntax error:

ERROR:  syntax error at or near ","
LINE 1: INSERT INTO master_list VALUES ('Ebay',,);
                                               ^

Any advice or suggestions welcome!

like image 438
some1 Avatar asked Jan 22 '14 23:01

some1


1 Answers

Try

INSERT INTO master_list VALUES ('Ebay',null,null);

or

INSERT INTO master_list (fieldname) VALUES ('Ebay');
like image 191
carexcer Avatar answered Oct 01 '22 03:10

carexcer