Appendix C. SQL primer
PostgreSQL supports almost the whole ANSI SQL-92, 1999 standard logic as well as many of the SQL:2003, SQL:2006, and some of the SQL:2008 constructs. In this appendix we’ll cover these as well as some PostgreSQL-specific SQL language extensions. Because we’re remaining fairly focused on standard functionality, the content in this appendix is applicable to other standards-compliant relational databases.
The information_schema is a catalog introduced in SQL-92 and enhanced in each subsequent version of the specs. Although it’s a standard, sadly most commercial and open source databases don’t completely support it. We know that the following common databases do: PostgreSQL (7.3+), MySQL 5+ (not sure about 4), and Microsoft SQL Server 2000+.
The most useful views in this schema are tables, columns, and views; they provide a catalog of all the tables, columns, and views in your database.