Install the complete package with local command reference and every published mode.
install postgresqlpostgresqlUse
postgresql [options] · postgresql : <sql>postgresqlshow the current
postgresql -c <host> <user> [database] [-p <port>] [-n] [-m [name]]connect; password is requested separately unless -n is used
-use <database>select another database by reconnecting
-llist databases
-tlist public tables and views
-s <table>show columns and data types
-n <table> [rows]preview table rows
-f <table> <text> [rows]find text across table columns
-o <table> [-j|-csv] [file] [-f]export table rows
-a <table> : <json>insert one row from a JSON object
-w <table> <field> <value> : <json>update matching rows from a JSON object
-d <table> <field> <value>delete matching rows
-m [name]save the current connection in .lil.key; default name is the database
-M <name>remove a saved connection
-k [name]list saved connections or inspect one without showing its password
-K <name>connect using a saved connection
-edisconnect and clear connection data
postgresql : <sql>execute native SQL
postgresql load <file.sql|file.json>execute SQL or restore a lil logical JSON dump
postgresql dump [file.json] [-f]create a logical JSON dump of public tables
Start with -s products to inspect columns, -n products 2 to preview two rows, and -f products shoe 2 to search. A SELECT after : is useful when the compact options cannot express your query. -o products -csv tmp/products.csv writes a portable table export.
For changes, -a inserts a row, -w updates all rows matching the chosen field and -d deletes all matches. Check the selection and back up first. dump is a lil JSON copy of data from public tables, **not** a full pg_dump: it does not recreate the schema, indexes, roles or extensions. load accepts either this JSON format (into existing tables) or SQL. These examples are illustrative;
-l lists databases, -t lists public tables/views, -s shows column definitions, -n previews rows and -f searches text across one table. -o exports table rows as JSON or CSV.
-a inserts one JSON object, -w updates rows selected by one field/value pair and -d deletes matching rows. Use native SQL for joins, transactions and advanced
Because lil does not invoke system pg_dump, dump creates a logical JSON snapshot of public table rows. load restores that lil JSON format or executes a supplied SQL file. Use the server's native backup tooling when a complete
-c requests the password outside command history. -use reconnects to another database with the same session credentials.
Commands run with the privileges of the connected
The lil JSON dump is data-only: schema objects and indexes are not recreated. JSON restore is transactional, and export or dump refuses a table above 100000 rows instead of writing partial data.
Without -m, connection data remains scoped to the current PHP session. -m [name] explicitly stores the current profile in the protected .lil.key file (0600), -K <name> reconnects from it, -k lists or inspects profiles without exposing a stored password, and -M <name> removes one. kill removes .lil.key together with the other core state. Treat the file as sensitive because an opted-in profile can contain database credentials.
Run the prepared examples directly on the page. Their results are prebuilt and shown in the browser; no terminal command is executed on the server.
Install the current compatible version. Choose Base for the complete feature set or Minimum for the reduced package; use upgrade to update a module that is already installed.
Base and Minimum are two packages of the same current module release, not separate command versions.
Install the complete package with local command reference and every published mode.
install postgresqlInstall the reduced package. Local reference is omitted;
install postgresql -mInstall exactly this published version.
install postgresql -v 1.1.4Ask upgrade to check compatibility and replace the installed block only when needed.
upgrade postgresqlRemove the extension block while leaving the core and unrelated modules intact.
install postgresql -uExamples are copyable command lines, not actions executed by this website. Review paths, permissions and destructive flags before running them on a real project.
postgresqlIllustrative sandbox preview — no live connection
A connection is required; the status view names the server and selected database.postgresql -c localhost demo shop -nIllustrative sandbox preview — no live connection
Connection example: server and database will be shown after a successful connection.postgresql -c localhost demo shopIllustrative sandbox preview — no live connection
Password is requested separately; selected database: shop.postgresql -c localhost demo shop -p 5433 -nIllustrative sandbox preview — no live connection
Connection example: server and database will be shown after a successful connection.postgresql -use shopIllustrative sandbox preview — no live connection
Selected database: shop (requires an active connection)postgresql -lIllustrative sandbox preview — no live connection
postgres
shoppostgresql -tIllustrative sandbox preview — no live connection
products BASE TABLEpostgresql -s productsIllustrative sandbox preview — no live connection
column_name data_type
id bigint
sku text
name text
category text
price numeric
active booleanpostgresql -n products 2Illustrative sandbox preview — no live connection
sku=SHOE-1 name=City shoe category=shoes price=79.9 active=True
sku=BAG-1 name=Canvas bag category=bags price=44.5 active=Truepostgresql -f products shoe 2Illustrative sandbox preview — no live connection
sku=SHOE-1 name=City shoe category=shoes price=79.9 active=Truepostgresql -o products -jIllustrative sandbox preview — no live connection
[
{
"sku": "SHOE-1",
"name": "City shoe",
"category": "shoes",
"price": 79.9,
"active": true
},
{
"sku": "BAG-1",
"name": "Canvas bag",
"category": "bags",
"price": 44.5,
"active": true
}
]postgresql -o products -csv tmp/products.csvIllustrative sandbox preview — no live connection
Saved sandbox/tmp/products.csv (if the destination does not exist)postgresql -o products -j tmp/products.json -fIllustrative sandbox preview — no live connection
Saved sandbox/tmp/products.json (replace existing file only with -f)postgresql -a products : {"sku":"NEW-1","name":"Sample","category":"test","price":5,"active":true}Illustrative sandbox preview — no live connection
Inserted 1 (example with a fresh, isolated copy)postgresql -w products sku SHOE-1 : {"price":75}Illustrative sandbox preview — no live connection
Updated 1 (illustrative single matching row)postgresql -d products sku SHOE-1Illustrative sandbox preview — no live connection
Deleted 1 (example only; all matches would be affected)postgresql : SELECT COUNT(*) AS total FROM productsIllustrative sandbox preview — no live connection
total
2postgresql dump tmp/shop-pg.jsonIllustrative sandbox preview — no live connection
Saved sandbox/tmp/shop-pg.json
Format lil-postgresql-json (logical data export, not server backup)postgresql dump tmp/shop-pg.json -fIllustrative sandbox preview — no live connection
Saved sandbox/tmp/shop-pg.json
Format lil-postgresql-json (logical data export, not server backup)postgresql load db/postgresql.sqlIllustrative sandbox preview — no live connection
SQL/JSON import requires an existing schema; running the supplied CREATE TABLE twice causes a conflict.postgresql load tmp/shop-pg.jsonIllustrative sandbox preview — no live connection
SQL/JSON import requires an existing schema; running the supplied CREATE TABLE twice causes a conflict.postgresql -m shop-demoIllustrative sandbox preview — no live connection
Saved shop-demo (stores a sensitive profile in .lil.key)postgresql -kIllustrative sandbox preview — no live connection
No saved connections (unless a profile has already been saved)postgresql -k shop-demoIllustrative sandbox preview — no live connection
Saved connection not found: shop-demo (unless saved earlier)postgresql -K unknownIllustrative sandbox preview — no live connection
Saved connection not found: unknownpostgresql -M unknownIllustrative sandbox preview — no live connection
Saved connection not found: unknownpostgresql -eIllustrative sandbox preview — no live connection
+postgresql -c localhost demo shop -p 99999 -nIllustrative sandbox preview — no live connection
Invalid database portpostgresql -s missing_tableIllustrative sandbox preview — no live connection
Table not found: missing_tablesandbox/db/postgresql.sqlThe example uses a file or directory from the protected /sandbox/ documentation workspace.
CREATE TABLE products (id BIGSERIAL PRIMARY KEY, sku text UNIQUE NOT NULL, name text NOT NULL, category text NOT NULL, price numeric(10,2) NOT NULL, active boolean NOT NULL DEFAULT true);
INSERT INTO products(sku,name,category,price,active) VALUES ('SHOE-1','City shoe','shoes',79.90,true),('BAG-1','Canvas bag','bags',44.50,true);
Current stable release of