Re: Precise Pangolion pretty pithy preview.
An explanation on how to install PostgreSQL on Oneiric is here.
PostgreSQL comes with two template databases, template0 and template1. The first is used to restore the second if the second becomes corrupted. In ten years of using PostgreSQL I have never encountered a corrupted database. User databases are usually created using template1. If one wants to deploy a set of databases with a special base configuration, say with TCL, Python, Perl or PL/SQL as available tools, one uses CREATE LANGUAGE on template1 to add them to that template. Then, one can add tables, functions, triggers, etc... to template1 to create the special base database. Rename it to something useful and use it as the template to create subsequent databases. (When one uses CREATE DATABASE it will create the new database using the database from which the command was issued, unless another was specificed in the command. If things get messed up one can log into template0 as postgres (the first "superuser") and copy it over tempate1. I say this theoretcially. I have never had to do that.
When I install PostgreSQL as a local server on my machine I open a Konsole and issue
which gets me into the psql console admin program with the template1 database loaded. From there I can issue
The "\h" command will list all the commands. "\h commmad" will give help on the specific command.
Then, start PGAdminIII and click the connection icon (power plug). Enter the name of the database (in my case jerry), server location as localhost, and jerry's password. The reason:
In case I forgot, PostgreSQL is an object database in which you can create rows in tables by inheriting rows from other tables. The docs explains that feature and their exampe of the weather database illustrates it.
There is a database documentation tool written in Java called DRUID. I used it to design databases, SQL scripts, triggers, indexes, etc..., and then to create graphical documentation, Then I could generate scripts for Oracle, or PostgreSQL, and several others, that would allow me to create that database configuration on that specific server. I don't know how its progressed in the last 3.5 years, so user beware.
An explanation on how to install PostgreSQL on Oneiric is here.
PostgreSQL comes with two template databases, template0 and template1. The first is used to restore the second if the second becomes corrupted. In ten years of using PostgreSQL I have never encountered a corrupted database. User databases are usually created using template1. If one wants to deploy a set of databases with a special base configuration, say with TCL, Python, Perl or PL/SQL as available tools, one uses CREATE LANGUAGE on template1 to add them to that template. Then, one can add tables, functions, triggers, etc... to template1 to create the special base database. Rename it to something useful and use it as the template to create subsequent databases. (When one uses CREATE DATABASE it will create the new database using the database from which the command was issued, unless another was specificed in the command. If things get messed up one can log into template0 as postgres (the first "superuser") and copy it over tempate1. I say this theoretcially. I have never had to do that.
When I install PostgreSQL as a local server on my machine I open a Konsole and issue
Code:
sudo -u postgres psql
Code:
\CREATE USER jerry WITH SUPERUSER PASSWORD 'mypasswd'; \CREATE DATABASE jerry WITH OWNER = jerry; \q
Then, start PGAdminIII and click the connection icon (power plug). Enter the name of the database (in my case jerry), server location as localhost, and jerry's password. The reason:
Postgresql is configured to use 'ident sameuser' authentication for any connections from the same machine by default. You can refer to the Postgresql documentation for more information. This basically implies that if your Ubuntu username is 'foo' and you add 'foo' as a Postgresql user then you can connect to the database without using a password.
This is how you create a database account (which is also a database superuser in this particular case) with the same name as your login name and a generate a password for it. This is necessary as the only user who can connect to a fresh install is the postgres user.
This is how you create a database account (which is also a database superuser in this particular case) with the same name as your login name and a generate a password for it. This is necessary as the only user who can connect to a fresh install is the postgres user.
There is a database documentation tool written in Java called DRUID. I used it to design databases, SQL scripts, triggers, indexes, etc..., and then to create graphical documentation, Then I could generate scripts for Oracle, or PostgreSQL, and several others, that would allow me to create that database configuration on that specific server. I don't know how its progressed in the last 3.5 years, so user beware.
Comment