StartingPostgreSQLOnSolaris

Starting up PostgreSQL on Solaris Express Developer Edition 01/08

PostgreSQL comes included out-of-the-box with SXDE 01/08. For more information on PostgreSQL and Solaris, see this page

It is pretty easy to get PostgreSQL initialized and running as a service on SXDE 01/08. You simply need to grant yourself rights to administer PostgreSQL and then start the service. The first time the service is started,
initdb
is called automatically, and you're ready to connect to the database server.

Granting yourself PostgreSQL admin privileges

Unless you're running as root (not recommended), you should grant your userid the rights to manage the PostgreSQL service.

You can use
usermod
to do this, but this is tricky, because you need to list all the privileges you already have and add Postgres Administration onto the list. If you just specify "Postgres Administration" then you actually have revoked all your other rights. I speak from experience.

So I would recommend using the UI to do this.

  • Bring up "Administration->Users and Groups" and enter the root password.
  • Select your userid and choose "Properties"
  • Select the "User Privileges" tab
  • Scroll until you find "Postgres Administration" and check the checkbox, and press "OK"

Image:postgres-priv_StartingPostgreSQLOnSolaris.jpg


Start the PostgreSQL service.

This also has the very nice side effect of initializing the database

$ /usr/sbin/svcadm enable postgresql:version_82

Then check to make sure it's running:

$ svcs | grep postgresql
It should show it as
enabled
. If it doesn't, then run {svcs -x} and it will provide you with more information about what went wrong. Note that you may need to wait about thirty seconds for it to start for the first time, as it is initializing the database.

That's it. You now have PostgreSQL running as a service. It will restart every time you reboot.

Connect to PostgreSQL

You can connect to PostgreSQL easily in NetBeans, as the JDBC driver is already included.

You can follow these instructions, using the username 'postgres' and an empty password. If all is set up correctly, the connection should succeed and you're ready to go.

Not logged in. Log in, Register

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo