How do I save my tables? - Mailing list pgsql-novice

From Kimberly Israel
Subject How do I save my tables?
Date
Msg-id 1379421215.44509.YahooMailNeo@web161601.mail.bf1.yahoo.com
Whole thread Raw
Responses Re: How do I save my tables?  (David Johnston <polobo@yahoo.com>)
Re: How do I save my tables?  (Thomas Kellerer <spam_eater@gmx.net>)
List pgsql-novice
I'm brand-new to database building (though I've worked with already-built databases running queries and such).  I'm trying to build a database for some ecological data.  I'm working in pgAdmin III and am comfortable with using SQL queries to create and populate the tables.  What I don't understand is how to save the tables.  Yesterday I created several tables and was able to run queries that combined data from more than one table at a time, but when I reopened pgAdmin III today, the database I had created was there, but the tables were all gone.  I tried to save my work, but what got saved was a .sql file that seems to only contain the code for creating the database.  Basically what I need to know is how do I put my tables somewhere where I'll be able to continue working with them after a 
period of having the computer off?

I'm running "PostgreSQL 9.3.0, compiled by Visual C++ build 1600, 32-bit" and I installed it with the EnterpriseDB installer.  I used all the default settings in the setup.  

My OS is Windows 7 Home Premium, Version 6.1 (Build 7601: Service Pack 1).

I realize this is probably an extremely stupid question; I haven't been able to find anything on a level that I can understand.  I really appreciate any help you can provide.

Thanks,
Kimberly Israel

P.S. My log from yesterday is below.  I don't know if it'll be of any help, but just in case.  A lot of the errors are just me stumbling around figuring things out.

2013-09-16 11:32:55 EDT LOG:  database system was shut down at 2013-09-16 11:32:40 EDT
2013-09-16 11:32:55 EDT LOG:  database system is ready to accept connections
2013-09-16 11:32:55 EDT LOG:  autovacuum launcher started
2013-09-16 12:29:37 EDT LOG:  could not receive data from client: No connection could be made because the target machine actively refused it.

2013-09-16 12:39:11 EDT FATAL:  password authentication failed for user "Main"
2013-09-16 12:39:11 EDT DETAIL:  Connection matched pg_hba.conf line 82: "host    all             all             ::1/128                 md5"
2013-09-16 12:39:22 EDT FATAL:  password authentication failed for user "Main"
2013-09-16 12:39:22 EDT DETAIL:  Connection matched pg_hba.conf line 82: "host    all             all             ::1/128                 md5"
2013-09-16 12:41:20 EDT ERROR:  syntax error at or near "pg_restore" at character 1
2013-09-16 12:41:20 EDT STATEMENT:  pg_restore
-U postgres
-d dvdrental C:
SELECT version();
2013-09-16 12:47:20 EDT LOG:  could not receive data from client: No connection could be made because the target machine actively refused it.

2013-09-16 12:50:28 EDT LOG:  could not receive data from client: No connection could be made because the target machine actively refused it.

2013-09-16 13:33:20 EDT ERROR:  CREATE DATABASE cannot be executed from a function or multi-command string
2013-09-16 13:33:20 EDT STATEMENT:  CREATE DATABASE firedata;
CREATE TABLE Plot_description(
plot_id smallint,
site_id smallint,
treatment varchar(8),
desc_sample_date date,
post1_over_sample_date date,
post2_over_sample_date date,
post3_over_sampe_date date,
elevation smallint,
slope smallint,
aspect smallint,
landform_code smallint,
position_code smallint,
shape_code smallint,
utm_zone smallint,
utm_n integer,
utm_e integer,
photo_dist real,
photo_azimuth smallint,
PRIMARY KEY (plot_id)
);
2013-09-16 13:41:07 EDT ERROR:  table "plot_description" does not exist
2013-09-16 13:41:07 EDT STATEMENT:  DROP TABLE Plot_description;
2013-09-16 13:45:57 EDT ERROR:  column "desc_sample_date" is of type date but expression is of type integer at character 60
2013-09-16 13:45:57 EDT HINT:  You will need to rewrite or cast the expression.
2013-09-16 13:45:57 EDT STATEMENT:  INSERT INTO plot_description VALUES ('2010-041',1,'Burned',7/20/2010,1663,15,142,3,1,3,18,3898624,747319,16.7,150);
2013-09-16 13:47:07 EDT ERROR:  column "post1_over_sample_date" is of type date but expression is of type integer at character 72
2013-09-16 13:47:07 EDT HINT:  You will need to rewrite or cast the expression.
2013-09-16 13:47:07 EDT STATEMENT:  INSERT INTO plot_description VALUES ('2010-041',1,'Burned','7/20/2010',1663,15,142,3,1,3,18,3898624,747319,16.7,150);
2013-09-16 13:54:15 EDT ERROR:  column "desc_sample_date" is of type date but expression is of type integer at character 60
2013-09-16 13:54:15 EDT HINT:  You will need to rewrite or cast the expression.
2013-09-16 13:54:15 EDT STATEMENT:  INSERT INTO plot_description VALUES ('2010-041',1,'Burned',7/20/2010,6/13/2012,'NULL','NULL',1663,15,142,3,1,3,18,3898624,747319,16.7,150);
2013-09-16 13:54:42 EDT ERROR:  invalid input syntax for type date: "NULL" at character 84
2013-09-16 13:54:42 EDT STATEMENT:  INSERT INTO plot_description VALUES ('2010-041',1,'Burned','7/20/2010','6/13/2012','NULL','NULL',1663,15,142,3,1,3,18,3898624,747319,16.7,150);
2013-09-16 14:32:19 EDT ERROR:  column "treament" does not exist at character 42
2013-09-16 14:32:19 EDT STATEMENT:  SELECT slope FROM plot_description WHERE treament = 'Control';
2013-09-16 14:38:52 EDT ERROR:  value too long for type character varying(12)
2013-09-16 14:38:52 EDT STATEMENT:  INSERT INTO landform VALUES 
(1, 'ridgetop'),
(2, 'open slope'),
(3, 'spur ridge'),
(4, 'gap'),
(5, 'knob'),
(6, 'plunging cove'),
(7, 'bottom'),
(8, 'bench');
2013-09-16 14:40:10 EDT ERROR:  type "charvar" does not exist at character 63
2013-09-16 14:40:10 EDT STATEMENT:  CREATE TABLE landform (
landform_code smallint,
landform_type charvar(14)
);
2013-09-16 14:49:49 EDT ERROR:  syntax error at or near "1" at character 23
2013-09-16 14:49:49 EDT STATEMENT:  INSERT INTO position
(1, 'upper'),
(2, 'mid'),
(3, 'lower');
2013-09-16 15:54:19 EDT ERROR:  syntax error at or near "Sugar" at character 72
2013-09-16 15:54:19 EDT STATEMENT:  INSERT INTO species VALUES
(1, 'Striped Maple'),
(2, 'Red Maple),
(3, 'Sugar Maple),
(4, 'Buckeye),
(5, 'Serviceberry),
(6, 'Yellow Birch),
(7, 'Sweet Birch),
(8, 'Muscle Wood),
(9, 'Hickory),
(10, 'American Chestnut),
(11, 'Hazelnut),
(12, 'Flowering Dogwood),
(13, 'Hawthorn),
(14, 'Persimmon),
(15, 'American Beech),
(16, 'White Ash),
(17, 'Ash),
(18, 'Silverbell),
(19, 'Witch Hazel),
(20, 'Mountain Holly),
(21, 'American Holly),
(22, 'Yellow Poplar),
(23, 'Cucumber Tree),
(24, 'Fraser Magnolia),
(25, 'Blackgum),
(26, 'Hophornbeam),
(27, 'Sourwood),
(28, 'Short Leaf Pine),
(29, 'Table Mt Pine),
(30, 'Loblolly Pine),
(31, 'Pitch Pine),
(32, 'White Pine),
(33, 'Virginia Pine),
(34, 'Sycamore),
(35, 'Fire Cherry),
(36, 'Black Cherry),
(37, 'White Oak),
(38, 'Scarlet Oak),
(39, 'Southern Red Oak),
(40, 'Blackjack Oak),
(41, 'Chestnut Oak),
(42, 'Northern Red Oak),
(43, 'Post Oak),
(44, 'Black Oak),
(45, 'Black Locust),
(46, 'Sassafras),
(47, 'Slippery Elm),
(48, 'Snag),
(49, 'Basswood),
(50, 'Eastern Hemlock),
(51, 'Carolina Hemlock);
2013-09-16 15:55:12 EDT ERROR:  syntax error at or near "Buckeye" at character 72
2013-09-16 15:55:12 EDT STATEMENT:  INSERT INTO species VALUES
(1, 'Striped Maple'),
(2, 'Red Maple),
(4, 'Buckeye),
(5, 'Serviceberry),
(6, 'Yellow Birch),
(7, 'Sweet Birch),
(8, 'Muscle Wood),
(9, 'Hickory),
(10, 'American Chestnut),
(11, 'Hazelnut),
(12, 'Flowering Dogwood),
(13, 'Hawthorn),
(14, 'Persimmon),
(15, 'American Beech),
(16, 'White Ash),
(17, 'Ash),
(18, 'Silverbell),
(19, 'Witch Hazel),
(20, 'Mountain Holly),
(21, 'American Holly),
(22, 'Yellow Poplar),
(23, 'Cucumber Tree),
(24, 'Fraser Magnolia),
(25, 'Blackgum),
(26, 'Hophornbeam),
(27, 'Sourwood),
(28, 'Short Leaf Pine),
(29, 'Table Mt Pine),
(30, 'Loblolly Pine),
(31, 'Pitch Pine),
(32, 'White Pine),
(33, 'Virginia Pine),
(34, 'Sycamore),
(35, 'Fire Cherry),
(36, 'Black Cherry),
(37, 'White Oak),
(38, 'Scarlet Oak),
(39, 'Southern Red Oak),
(40, 'Blackjack Oak),
(41, 'Chestnut Oak),
(42, 'Northern Red Oak),
(43, 'Post Oak),
(44, 'Black Oak),
(45, 'Black Locust),
(46, 'Sassafras),
(47, 'Slippery Elm),
(48, 'Snag),
(49, 'Basswood),
(50, 'Eastern Hemlock),
(51, 'Carolina Hemlock);
2013-09-16 15:55:43 EDT ERROR:  unterminated quoted string at or near "'Red Maple);" at character 54
2013-09-16 15:55:43 EDT STATEMENT:  INSERT INTO species VALUES
(1, 'Striped Maple'),
(2, 'Red Maple);
2013-09-16 17:07:12 EDT LOG:  received fast shutdown request
2013-09-16 17:07:12 EDT LOG:  aborting any active transactions
2013-09-16 17:07:12 EDT LOG:  autovacuum launcher shutting down
2013-09-16 17:07:12 EDT LOG:  shutting down
2013-09-16 17:07:12 EDT LOG:  database system is shut down

pgsql-novice by date:

Previous
From: Jon Theil Nielsen
Date:
Subject: Re: Several problems with installation on FreeBSD - how to reinstall without loosing data
Next
From: Kevin Grittner
Date:
Subject: Re: Several problems with installation on FreeBSD - how to reinstall without loosing data