The database has finally been initialized.
4. Start the database
D:\pgsql8.3.3\bin>pg_ctl start
server starting
D:\pgsql8.3.3\bin>Login: The last time the database was closed was 2008-09-08 23:52:28 HKT
Log: database system is ready to accept connections
Log: autovacuum launcher started
Error: Syntax error At the first character near "syncdb" or near
Statement: syncdb
syncdb
Error: Syntax error At the 1st character near "*" or near
Statement: *
create table t(id int primary key, col2 varchar(32))
/
select * from t
go
Note: CREATE TABLE / PRIMARY KEY will create an implicit index "t_pkey" for table "t"
5. Use the psql command to try to build a table:
D:\pgsql8.3.3\bin>createuser spring
Shall the new role be a superuser? (y/n) y
D:\pgsql8.3.3\bin>psql -U spring iihero
Welcome to psql 8.3.3, which is the PostgreSQL interactive text terminal.
Type: \copyright Shows Issuance Terms
\h Displays instructions for SQL commands
\? Display the instructions for the pgsql command
\g or end with a semicolon (;) to execute the query
\q Exit
iihero=# \d t
No associations with the name "t" were found.
iihero=# create table t(id int primary key, col2 varchar(32));
Note: CREATE TABLE / PRIMARY KEY will create an implicit index "t_pkey" for table "t"
CREATE TABLE
iihero=# insert into t values(1, 'iihero');
INSERT 0 1
iihero=# select * from t;
id | col2
----+--------
1 | iihero
(1 data list)
iihero=# quit
iihero-# \q
Finally, the simple configuration is completed, and you can directly use this environment to do some simple experiments in the future.
If you want to write some codes, there are probably some problems. The document says that you need to have a VS2008 C Runtime library. I'm so dizzy, I have to install this thing.
Let's see if there is a lower version of pgsql that is not installed.
Previous page12Read the full text