8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-01-22 20:43:02 +01:00
firebird-mirror/doc/sql.extensions/README.management_statements_psql.md

30 lines
925 B
Markdown
Raw Normal View History

# Management Statements in PSQL
2018-11-28 14:05:25 +01:00
Before Firebird 4, management statements were not allowed inside PSQL blocks. They were allowed only as top-level SQL statements, or as top-level statement of an `EXECUTE STATEMENT` embedded in a PSQL block.
Now they are allowed inside PSQL blocks (triggers, procedures, execute block) directly.
2018-11-28 14:05:25 +01:00
As many applications depends that some management statements be issued on the connection start, `ON CONNECT` triggers is a good place to put them in this situation.
The management statements part of this improvement are:
2018-11-28 14:05:25 +01:00
- `ALTER SESSION RESET`
2019-11-08 18:16:33 +01:00
- `SET BIND OF ... TO`
2018-11-28 14:05:25 +01:00
- `SET DECFLOAT ROUND`
- `SET DECFLOAT TRAPS TO`
- `SET ROLE`
- `SET SESSION IDLE TIMEOUT`
- `SET STATEMENT TIMEOUT`
- `SET TIME ZONE`
- `SET TRUSTED ROLE`
## Examples
```sql
create or alter trigger on_connect on connect
as
begin
2019-11-08 18:16:33 +01:00
set bind of decfloat to double precision;
set time zone 'America/Sao_Paulo';
end
```