Re: [Novice] Create Table

From: Jeff Self <jself(at)nngov(dot)com>
To: cgoodfellow(at)tealuxe(dot)com
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: [Novice] Create Table
Date: 2002-02-11 17:01:56
Message-ID: 1013446916.12978.4.camel@personnel_test
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

You need to be in the database that you want to create a table. Example:

psql testdb <--- This puts you in the testdb database

testdb=# <--- You should see this now
>From here, you can create the table as below:

testdb=# create table test
( testid SERIAL PRIMARY KEY,
testname VARCHAR(20) NOT NULL DEFAULT '',
testdate DATE,
quantity INTEGER,
amount NUMERIC(8,2)
);

This will create a table. Standard SQL syntax. Try to pick up Bruce
Momjian's book 'PostgreSQL Introduction and Concepts'

On Mon, 2002-02-11 at 11:24, Christopher A. Goodfellow wrote:
> Hello All,
>
> I am a real novice to postgresql and am having trouble creating a new
> table in my existing database through the psql monitor.
>
> I have read the programmers guide, the create table syntax, and searched
> for some examples but with no luck. Are there any good examples of step by
> step how to create a new table?
>
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 3: if posting/reading through Usenet, please send an appropriate
> subscribe-nomail command to majordomo(at)postgresql(dot)org so that your
> message can get through to the mailing list cleanly
--
Jeff Self
Information Technology Analyst
Department of Personnel
City of Newport News
2400 Washington Ave.
Newport News, VA 23607
757-926-6930

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Brian Johnson 2002-02-11 17:07:47 postmaster start options on RedHat 7.2
Previous Message Josh Berkus 2002-02-11 16:58:18 Re: how to INSERT foreign keys?