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

Question:

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 "("
LINE 1: CREATE DATABASE product (

*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.

Asked By: Mr Coin

||

Answers:

CREATE TABLE product (
    id serial primary key, 
    name varchar(32),
    description text,
    price decimal(5,2)
);
Answered By: Nathan Erkamp
Categories: questions Tags: ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.