"Karl F. Larsen" wrote:
>
> I'm wondering if ANYONE has used the posgress data base? It comes
> already loaded on Red Hat 5.2 and I printed the large book "PostgrSQL
> User's Guide" by Thomas Lockhart. It is exactly useless to me!
Sure, I installed it and it works quite well.
>
> I found there is a posgres login and so I can su - postgres and I
> will be in that login. I did a "createdb mydb" and it worked. Then I used
> psql mydb and that worked. Then I saw that destroydb mydb works fine.
Okay, so far so good. Once you create a database you can access it in
one of two ways. One is as you did, using the psql monitor and using
the appropriate SQL statements. Thus to use the mydb database you
would start psql as $ psql mydb. See the man pages for psql.
Another means of access is to write an appropriate C program utilizing
the LIBPQ library (preferable).
>
> I now have postgres open in an nxterm window by itself and want to
> enter a data base which is an ascii phone number name address list. But
> there is no way to do this. The book stops here and goes off talking about
> SQL and without any explanation.
Once you've opened your database via psql you utilize SQL to create
the tables which comprise your database, insert values into the
tables, and perform queries on those tables. For maintaining a "name",
"address", "phone" table an SQL statement to create such a table might
look like this:
CREATE TABLE address (
name char(20),
address char(30),
phone char(15)
);
You then use SQL commands such as INSERT (to insert values into the
table), SELECT (to select/query that database), etc. A basic knowledge
of SQL would probably be helpful.
>
> I am just lost. Is there a REAL Postgres User's Manual? Should I
> quit trying to use it because I am so stupid? The postgres-HOWTO is even
> MORE confusing bringing in perl and other things. I just want to put in
> names and telephone numbers.
>
Because SQL is generally used in conjunction with other languages such
as C, Perl, etc. to create a complete application.
What/which manual are you using?? There is some html documentation
available which gives a decent overview of postgresql, including a
basic rundown of enough SQL to get you started. It was installed when
I installed postgresql under RH 5.0 in the directory
"/usr/doc/postgresql6.2.1/doc/manual/". If you don't have the
documentation I am sure it can be gotten from the postgresql site. A
good book on SQL might also come in handy.
An alternative to using Postgresql/SQL might be to use the "gdbm -Gnu
Database manager" database. While it is not SQL compliant and as
versatile as SQL, gdbm is sometimes quite simple useful for creating
simple databases. See the man pages "$ man gdbm", or "$info gdbm", for
information on this.
Of course there is always the option of creating a simple application
using a flat file structure. This can be easily done using Perl or C.
Good Luck
/John <[EMAIL PROTECTED]>
--
email: [EMAIL PROTECTED]
Local mailserver <landreau.ruffe.edu> , remote <ns.computer.net>
Just a drop in the basket helps keep your city clean!