Loading topic
psql client, and a check that both a5 min readpsql, what happens when it starts, and how to run your first statement. It assumes you can use a terminal and that PostgreSQL is installed with a running server, which the previous chapters covered. It also assumes you know what a database and a table are.5 min readpsql as the previous chapter showed. You should also be comfortable reading command-line options and setting environme6 min readpsql and run a statement, as covered in the previous chapters. It explains how PostgreSQL organizes who can connect and where data lives. That model explains most of the "role does not exist" and "database does not exist" errors you will hit early on.6 min readpsql session as a role that can create databases (the postgres superuser in the examples). It also assumes you know what4 min readCREATE TABLE: column types, constraints, identity columns, and the errors you are most likely to hit. It assumes you can open psql, you have created firstdb in the previous chapter, and you know a table holds rows with a fixed set of named columns.5 min readINSERT works in PostgreSQL, how identity columns fill in keys for you, and the errors you will meet when a row breaks a rule. It assumes you have a running server, a psql session connected to firstdb, and the books table from the previous chapter. You should know what a6 min readpsql, and have created the books table in firstdb with the three rows from the previous chapter. If you are not connected to firstdb, run \c firstdb first. Check the prompt: it should read firstdb=#.4 min readSELECT to the rows you want and put them in a stable order. It assumes you can connect with psql, that you created firstdb and the books table in earlier chapters, and that you can run a basic SELECT. The chapter covers WHERE, ORDER BY, LIMIT, and t4 min read\c, \dt, \d books, and \q without much explanation. This chapter explains how those commands work, shows the ones you will use most, and covers the mistakes people commonly make with them.5 min readpsql, that you have the books table from the earlier chapters, and that you can run SELECT with WHERE. If your table is missing, the setup block below recreates it.4 min readpsql cannot connect, what each one means, and how to fix it.6 min readfirstdb. It also covers what can block a drop, how to check that everything is gone, and what to leave in place. It assumes you can open psql, you know the difference between a database and a table, and you have worked through the 6 min read