For the complete documentation index, see llms.txt. This page is also available as Markdown.

Postgres

Basics

postgres
su postgres  .. to get into his shell account
psql         .. to login to sql

Navigate the database:

\list     .... list the databases
\c [DB]   .... to select the database [DATABASE]
\d        .... to list the tables

select * from users;

File Traverse

  • You can read a file from psql, that you normally wouldnt be allowed!

CREATE TABLE demo(t text);
COPY demo from '[/var/lib/postgresql/9.4/key.txt]';
SELECT * FROM demo;

Find Creds

Last updated