Ahhh. Schemas. Schemas are basically namespaces that live between the database and table level. Imagine a department in a company that handles financials having a database called just that, finance. Now, if we have accounts receiveable, accts payable, billables, etc, we can put them each in a different schema, so we have
psql template1
create database finance;
\c finance
create schema customers;
create schema accts_payable;
create schema accts_receiveable;
create schema billables;
create table customers.customer_accts (....;
create table accts_payable.sometable ....;
create table accts_receiveable.someothertable
Now we can put default different security models in each schema, so that accts_receiveable people can READ from the accts_payable, but not change it, and vice versa...
So, where MySQL lets you join databases like:
select * from db1.table1, db2.table2 join on ()...
In Postgresql the same syntax would be withing a single database, but across multiple schemas. This means large joins and what not can benefit from the ability to play in one area so to speak, while you get much the same security you would from multiple databases.
In 7.4, they are now implementing the information schema. Here's a short list of all the tables currently in the information schema:
applicable_roles
check_constraints
column_domain_usage
column_privileges
column_udt_usage
columns
constraint_column_usage
constraint_table_usage
data_type_privileges
domain_constraints
domain_udt_usage
domains
element_types
enabled_roles
information_schema_catalog_name
key_column_usage
parameters
referential_constraints
role_column_grants
role_routine_grants
role_table_grants
role_usage_grants
routine_privileges
routines
schemata
sql_features
sql_implementation_info
sql_languages
sql_packages
sql_sizing
sql_sizing_profiles
table_constraints
table_privileges
tables
triggered_update_columns
triggers
usage_privileges
view_column_usage
view_table_usage
views
select * from information_schema.oneoftheabove;
gives a pretty neat little display.
Using the information_schema you can get:
select * from check_constraints where constraint_name='constraint_name';