Database Reference
In-Depth Information
This output raises many questions, I know. We've discussed templates already. Other
interesting things are that we can turn connections on and off for a database, and we
can set connection limits for them as well.
Also, you can see that each database has a default tablespace. So, data tables get created
inside one specific database, and the data files for that table get placed in one tablespace.
We can also see that each database has a collation sequence, which is the way various
language features are defined. More on that in other sections.
How many tables in a database?
The number of tables in a relational database is a good measure of the complexity
of a database, so it is a simple way to get to know any database.
How to do it...
From any interface, type in the following SQL command:
SELECT count(*) FROM information_schema.tables
WHERE table_schema NOT IN ('information_schema',
'pg_catalog');
You can also look at the list of tables directly and judge whether that is a small or large number.
In psql, you can see your own tables using the following:
postgres@ebony:~/8.3/main$ psql -c "\d"
List of relations
Schema | Name | Type | Owner
--------+----------+-------+----------
public | accounts | table | postgres
public | branches | table | postgres
 
Search WWH ::




Custom Search