Lorenzo Alberton
« Articles
PostgreSQL cheat sheet
Abstract: Cheat sheet for PostgreSQL 8. A handy reference of the PostgreSQL datatypes, an useful query reference (with an eye on the INFORMATION_SCHEMA tables) and a list of the internal PostgreSQL functions.
While there is already a number of cheat sheets for Postgresql available on the web, I couldn't find one in this format and with the kind of information I wanted, so I wrote one.
A detailed description of the cheat sheet follows, and you can start downloading it here:
- PostgreSQL cheat sheet (GIF, 90KB)
- PostgreSQL cheat sheet (PDF, 105KB)
- PostgreSQL cheat sheet (PNG, 123KB)
PostgreSQL Cheat Sheet - Details
The cheat sheet is organized in 4 sections. The first section contains a list of the available data types, their description and the range of values that each of them supports.
The second section contains a list of the Internal functions. PostgreSQL features an huge number of internal functions, that should make the developer's life easier. They're listed here, grouped by field of interest (mathematical, geometric, string, aggregate, conditional, network, date and time functions).
The third section contains some useful queries, like the ones to manage TRANSACTION
s, SAVEPOINT
s and SEQUENCE
s, and a sample query with a "LIMIT
/ OFFSET
" clause.
The last section contains a some useful queries against the INFORMATION_SCHEMA.
The new INFORMATION_SCHEMA makes working with system tables (aka catalog or pg_* tables) easier. I wrote here some queries to retrieve a list of the tables, fields, indices, constraints, functions and triggers.
Disclaimer
If you wish to link to the PostgreSQL cheat sheet from elsewhere, rather than linking directly to the sheet please link to this page so others can find the description. Thank you.
Related articles
Latest articles
- On batching vs. latency, and jobqueue models
- Updated Kafka PHP client library
- Musings on some technical papers I read this weekend: Google Dremel, NoSQL comparison, Gossip Protocols
- Historical Twitter access - A journey into optimising Hadoop jobs
- Kafka proposed as Apache incubator project
- NoSQL Databases: What, When and Why (PHPUK2011)
- PHPNW10 slides and new job!
Filter articles by topic
AJAX, Apache, Book Review, Charset, Cheat Sheet, Data structures, Database, Firebird SQL, Hadoop, Imagick, INFORMATION_SCHEMA, JavaScript, Kafka, Linux, Message Queues, mod_rewrite, Monitoring, MySQL, NoSQL, Oracle, PDO, PEAR, Performance, PHP, PostgreSQL, Profiling, Scalability, Security, SPL, SQL Server, SQLite, Testing, Tutorial, TYPO3, Windows, Zend FrameworkFollow @lorenzoalberton