6. Rules you must follow — prohibitions and limitations
By the end of this chapter: You avoid five mistakes that you cannot undo, and you know ten design limitations.
Time: 10 min (reading)
6.1 Five prohibitions
⚠ Prohibition 1 — Do not start or stop PostgreSQL by itself with
pg_ctl
- Reason: PostgreSQL that starts without the supervisor process (
grit_admin) shuts itself down after about 60 seconds.- Instead: Use
gritdb-startandgritdb-stop.
⚠ Prohibition 2 — Do not delete or replace
datafiles/pgdataby itself
- Reason:
pgdata,checkpoint,queue, andcold_filedepend on each other. If only some of them change, GritDB cannot start.- Instead: To create new data, use
install_gritdb.sh --reinit-data. It keeps the existing data under a new name (Admin, chapter 3).
⚠ Prohibition 3 — Do not delete the replication slot
gritsurfer_slot
- Reason: GritDB uses this slot as the point from which it continues to receive PostgreSQL changes. If you delete it, the WAL that GritDB needs disappears, and GritDB data can differ from PostgreSQL.
- Instead: Leave it as it is. If
pg_walkeeps growing, do not delete the slot. Contact support with the procedure in 7.4.
⚠ Prohibition 4 — Do not edit the GritDB managed block in
postgresql.conf
- Target: The lines from
# >>> gritdb managed beginto# <<< gritdb managed end. This includes the two marker lines. The block contains settings such asshared_preload_libraries,wal_level,search_path, andport.- Reason: GritDB can stop working, or the next installation or upgrade can lose settings in
postgresql.conf(GDB-INSTALL-004).- Instead: Change settings with the procedure in Admin, chapter 5.
⚠ Prohibition 5 — Do not stop GritDB processes one by one with
kill
- Reason: The four processes are one unit. If only some of them die, you must clean up the remaining processes and the shared memory separately.
- Instead: Use
gritdb-stop. If it is urgent, usegritdb-stop --quick.
6.2 Ten limitations to know
| # | Limitation | Impact | What to do |
|---|---|---|---|
| 1 | CPU: x86-64 with the cx16 and sse4_2 instructions |
GritDB does not start on a server without them. The installation script only warns | Check in advance with item 3 of the checklist in chapter 2 |
| 2 | Registered tables require REPLICA IDENTITY FULL |
Tables without it are rejected at registration | Before you register, run ALTER TABLE <table> REPLICA IDENTITY FULL; |
| 3 | New databases are copies of template1 (PostgreSQL default) |
Databases created with TEMPLATE template0 do not have the gritsurfer extension |
CREATE DATABASE <name>; — omit TEMPLATE |
| 4 | wal_level = logical is fixed |
If you change it, GritDB does not work | Do not change it (prohibition 4) |
| 5 | Installation directory path: 80 characters or fewer | A longer path is rejected at installation (GDB-INSTALL-005) | Use the standard path |
| 6 | Data: datafiles/ as one unit, at the same path |
If you back up, move, or delete only part of it, GritDB cannot start. If you move it to another path, GritDB loses the cold files (the GritDB engine’s files for analytic queries, section 1.2) | Handle it as one unit and keep it at the installed path (Admin, chapter 8) |
| 7 | Logs can contain original SQL text | Data exposure when you send logs outside | Review and mask the logs before you send them out (7.4) |
| 8 | TRUNCATE and structure changes (ALTER TABLE) on registered tables are not applied to the GritDB engine |
Analytics session results differ from regular session results | Do not run them on registered tables (Admin, chapter 6) |
| 9 | One transaction can write only a limited number of rows to registered tables. The limit depends on server memory. The initial copy of a table that you receive by replication from an operational database is also one transaction | If a transaction goes over the limit, GritDB stops (PostgreSQL included) | Commit bulk loads in batches below half the limit. Check the limit in Admin, chapter 6 |
| 10 | Analytics sessions do not apply row-level security (RLS) policies | Rows that RLS hides are visible in analytics sessions | Do not register tables that you protect with RLS or per-account privileges (Admin, chapter 11) |
Learn more
- For all limitations, see Admin, chapter 10.