From owner-freebsd-database Thu Jan 18 10:25: 3 2001 Delivered-To: freebsd-database@freebsd.org Received: from cc762335-a.ebnsk1.nj.home.com (cc762335-a.ebnsk1.nj.home.com [24.3.219.36]) by hub.freebsd.org (Postfix) with SMTP id 4405937B402 for ; Thu, 18 Jan 2001 10:24:41 -0800 (PST) Received: (qmail 76283 invoked from network); 18 Jan 2001 18:23:30 -0000 Received: from athena.faerun.com (HELO athena) (192.168.0.2) by cc762335-a.ebnsk1.nj.home.com with SMTP; 18 Jan 2001 18:23:30 -0000 Message-Id: <4.2.2.20010118131827.00c82d50@netmail.home.com> X-Sender: damascus@netmail.home.com X-Mailer: QUALCOMM Windows Eudora Pro Version 4.2.2 Date: Thu, 18 Jan 2001 13:24:03 -0500 To: Francisco Reyes From: Carroll Kong Subject: Re: Need help with PostgreSQL database Cc: freebsd-database@FreeBSD.ORG In-Reply-To: Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed Sender: owner-freebsd-database@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG At 01:05 AM 1/18/01 -0500, Francisco Reyes wrote: >I installed PostgresSQL from ports. I am trying to access any database or >to create a new one, without much luck. > >I noticed the port made a user called pgsql. Am I supposed to use this? >I tried using that user by becoming root and then that user. Then I tried >psql. > >It complained about database "psql" not existing. If I try "psql test" it >gives me read access denied. > >Any hints on getting PosgreSQL going on FreeBSD? >I bought a book and I am looking at the tutorial, but before I can use >them I need to be able to create a database or use the "test" database. I had trouble with PostgreSQL on FreeBSD before since I did not know where to look. I cannot quite remember where else to look for except the PostgreSQL documentation on their website. man psql (you will most likely need to add the postgresql man pages in your man path for this to succeed) tells you that by default you will end up creating a db after your own name if you just run psql. You can pass a parameter that lets you choose another db. Conversely, you can setup an environment variable that always chooses a particular db, or even a user! PGDATABASE=yourdb PGUSER=dbuser To create a db, take a look at the /usr/local/pgsql/bin. That is where all the db specific binaries are held. createdb will help create a new db. There are parameters there to create a db under the name of another user. You might want to add a new user before that begins. Just get into the test database. "psql test" Use the create user command to make a subordinate user and then create a db under his name, and you should be set to go. -Carroll Kong To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-database" in the body of the message