PostgreSQL : ERROR: syntax error at or near "("

I started to learn PSQL. I have a question how to solve this problem, in my opinion the code should be ok but BD says otherwise ;). Can someone help me with this. Thank you in advance.

The code is from a terminal on Ubuntu (this is the method I want to create the table), not from pgAdmin.

exercises_db=# CREATE TABLE* product (
exercises_db(# id serial, 
exercises_db(# name varchar(32),
exercises_db(# description text,
exercises_db(# price decimal(5,2),
exercises_db(# PRIMARY KEY(id)
exercises_db(# );

ERROR:  syntax error at or near "("

*Errata: I already changed in the example, I did not notice that I was doing instead of "TABLE", "DATABASE". Again, thank you very much for your help.

>Solution :

CREATE TABLE product (
    id serial primary key, 
    name varchar(32),
    description text,
    price decimal(5,2)

Leave a Reply