Unanswered: Please help clarify "database" meaning.
I have been with PostgreSQL for a few days. I also installed Postgres Forms.
Need and would appreciate help on these questions, assuming one is Postgres user with the superuser password:
1. "postgres" I gathered is the System database. It is created during installation of the postgresql package. When we create another database database2, then we have a "cluster" of TWO databases. I read that one can only be connected to one database at a time. However, when we close postgres and open database2, don't we in a way still have a connection to postgres (the system database)?
2. This instruction comes with the postgres forms package:
Using 'Tools -> Install example database', you can install one of these example databases in the currently opened database (my underlining). This database should be completely empty. It should not even contain the pfm_* tables.
However, it seems to me that a database is not actually installed WITHIN a database, or can that be done?
3. It seems to me that when using postgresql, one is really always WITHIN a database in order to create another database, and the database is created in parallel to the database from the one where the creation was made. So, being IN a database, one can create a new one, but one can not access the one created unless one closes the current one and opens the new one created. Am I uderstanding this correctly? Please help me get cleared on this, which kind of gives me a headache right now.
A database server may (and almost always does) have multiple databases 'within' it. These databases are stored internally, in files on the server.
When you 'connect to a database,' you are actually connecting to a database server, which processes your commands, ensuring that they are processed against the correct 'set' of database objects (and the underlying associated data files.)
Unlike a PC file based database app like MS Access, there are hundreds to thousands of internal database files that you should not access directly; the database server keeps track of what is stored where, and how. You use a 'front-end' client, which connects to the server 'back end,' to view and/or manipulate the data. The server controls who access what, and the manner in which they do so, via a standard interface.
Last edited by loquin; 06-18-12 at 13:24.
"Lisa, in this house, we obey the laws of thermodynamics!" - Homer Simpson
"I have my standards. They may be low, but I have them!" - Bette Middler
"It's a book about a Spanish guy named Manual. You should read it." - Dilbert
I think your confusion comes from the multiple meanings that people put into the word "database".
Very often this is simply used to denote a "collection of information" or the entirety of tables for a specific business. Some people use the term "database" to refer to the software that is running (e.g. to denote a specific "database product" such as PostgreSQL, Oracle or DB2), some people call a bunch of text files "a database" which - after all - is correct as well. It simply isn't a relational database.
Sometimes the database server process is simply referred to as "database", sometimes the whole server hardware is referred to as "the database".
So in the quote "you can install one of these example databases in the currently opened database." the first "database" refers to the collection of tables and their content (=rows), the second term refers to the technical concept inside a Postgres server