Ira Kloostra Nathan
Ira Kloostra Nathan

Reputation: 148

Attempt to create table ingnored or not executed postgresql

Im trying set up postgresql but every time I try make a Table:

CREATE TABLE player (discord_id, game_id, game_username)

It does nothing no errors. Then when I do \dt to list tables it says this:

roblox=# \dt
Did not find any relations.

Why can't I create a table?

Upvotes: 1

Views: 49

Answers (1)

Matthew Barlowe
Matthew Barlowe

Reputation: 2328

You need to set the type you want the columns to be in Postgres. Postgres doesn't assume what type of data you are passing it unless you explicitly tell it.

CREATE TABLE player (discord_id int, game_id int, game_username varchar);

For example. Here are the docs on this function https://www.postgresql.org/docs/9.1/sql-createtable.html

Here is a list of all the data types in Postgres

Upvotes: 2

Related Questions