Objects
Browse and manage views, materialized views, functions, triggers, types, sequences and the server settings. Studio edition.
Open it#
In the Studio edition, switch to Advanced and pick Objects in the sidebar. Kind of object switches between Views, Functions, Triggers, Types, Sequences and Settings. Schema limits the list to one schema (or All schemas), and Filter by name narrows it. The kind stays in the address, such as /advanced/objects?view=functions.
Every change shows its SQL and waits for your confirmation, as described in Every change shows its SQL. Dropping asks you to type the object's name. In read-only mode everything can be seen and nothing changed.
Views#
The list has views and materialized views, with their owner. A materialized view that was never refreshed is marked no data. Pick one to see its Definition.
- New view asks for the schema, the name, whether it is Materialized, and the Query. The query must be one
SELECT,WITH,VALUESorTABLEstatement. - Edit a view runs
CREATE OR REPLACE VIEW: the columns stay the same, and new ones go at the end. If other objects use the view, it warns you: replacing keeps them, but fails if a column is removed, renamed or changes type. - Edit a materialized view drops it and creates it again with the new query, in one transaction. Its data is computed again, and its indexes and grants are lost; the preview warns you.
- Refresh a materialized view recomputes its data. The Concurrently option doesn't block readers, and runs outside a transaction. It needs a unique index on plain columns of the materialized view, and data already in it.
- Drop lists the objects that depend on the view. If there are any, tick Drop them too (CASCADE) to drop them as well.
Functions#
Functions and procedures, with their signature, return type, language, volatility (immutable, stable, volatile) and whether they are SECURITY DEFINER.
- Code shows the full definition.
- Edit in SQL editor opens a new SQL editor tab with its
CREATE OR REPLACEready to change and run. - Drop lists what depends on it, as with views.
Triggers#
User triggers, with their table, whether they are enabled or disabled, and their definition. The internal triggers that PostgreSQL uses for foreign keys are not listed.
Disable and Enable switch a trigger with ALTER TABLE … DISABLE TRIGGER and ENABLE TRIGGER. Disabling warns you: while disabled, the trigger doesn't fire, so whatever it keeps up to date (audit rows, totals, timestamps) stops changing.
Types#
Enums, domains (with their base type), composite types and ranges, each with the columns that use it, also as an array.
For an enum:
- Add value adds a New value at a Position: At the end, or before or after an existing value.
- Click a value to rename it.
PostgreSQL can't remove a value from an enum, so Gresbase doesn't offer it.
Sequences#
Each sequence with its type, increment, limits, CYCLE, owner, the column it belongs to (for serial and identity columns) and its current value. The value shows as "—" before the first nextval, or when your role can't read the sequence.
Restart runs ALTER SEQUENCE … RESTART: at its start value, or at a value you type. The confirmation warns you that a sequence restarted too low can hand out numbers already used, and inserts may then fail on unique keys.
Settings#
The server settings from pg_settings, with value and unit, description, Source (where the value comes from) and Applies (when a change takes effect). Search by name, description or category. Settings that need a restart are marked needs restart, and changed ones still waiting for it, restart pending.
This view is read-only. Change settings in postgresql.conf, with ALTER SYSTEM or with -c in the server command.
Permissions#
| Action | Needs |
|---|---|
| See everything | Any role. Definitions and code follow what PostgreSQL lets the role read. |
| Create a view | CREATE on the schema, and SELECT on what the query reads. |
| Edit, refresh or drop a view, drop a function, change an enum | Owning the object. |
| Enable or disable a trigger | Owning the table. |
| Restart a sequence | Owning it. |
See also Security and networking.