GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing www.postgresql.org — 2.3. Creating a New Table November 19, 2026: PostgreSQL 19 Released!
Development Versions:
devel
This documentation is for an unsupported version of PostgreSQL.
You may want to view the same page for the current version, or one of the other supported versions listed above instead. 2.3. Creating a New Table #You can create a new table by specifying the table name, along with all column names and their types: CREATE TABLE weather (
city varchar(80),
temp_lo int, -- low temperature
temp_hi int, -- high temperature
prcp real, -- precipitation
date date
);
You can enter this into White space (i.e., spaces, tabs, and newlines) can be used freely in SQL commands. That means you can type the command aligned differently than above, or even all on one line. Two dashes (“
PostgreSQL supports the standard SQL types The second example will store cities and their associated geographical location: CREATE TABLE cities (
name varchar(80),
location point
);
The Finally, it should be mentioned that if you don't need a table any longer or want to recreate it differently you can remove it using the following command: DROP TABLE
|
| You are visitor 01402775 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |