Session functions
Connection identity, selected database, named locks and statement state.
Connection identity, selected database, named locks and statement state.
connection_id
| Signature | Purpose | Source definition |
|---|---|---|
mysql.connection_id() → bigint | Return the PostgreSQL backend PID for this connection. | SQL |
current_user
| Signature | Purpose | Source definition |
|---|---|---|
mysql."current_user"() → text | Effective PostgreSQL role formatted as role@%. | SQL · C |
database
| Signature | Purpose | Source definition |
|---|---|---|
mysql.database() → text | Return the MySQL database selected in this session. | SQL · C |
found_rows
| Signature | Purpose | Source definition |
|---|---|---|
mysql.found_rows() → bigint | Read the session’s found-row count. | SQL · C |
get_lock
| Signature | Purpose | Source definition |
|---|---|---|
mysql.get_lock("any", "any") → bigint | Acquire a named session lock with a timeout. | SQL · C |
is_free_lock
| Signature | Purpose | Source definition |
|---|---|---|
mysql.is_free_lock("any") → bigint | Check whether a named lock is available. | SQL · C |
is_used_lock
| Signature | Purpose | Source definition |
|---|---|---|
mysql.is_used_lock("any") → bigint | Look up the holder of a named lock. | SQL · C |
last_insert_id
| Signature | Purpose | Source definition |
|---|---|---|
mysql.last_insert_id() → bigint | Read the session’s last generated insert ID. | SQL · C |
release_all_locks
| Signature | Purpose | Source definition |
|---|---|---|
mysql.release_all_locks() → bigint | Release all named locks held by this session. | SQL · C |
release_lock
| Signature | Purpose | Source definition |
|---|---|---|
mysql.release_lock("any") → bigint | Release a named session lock. | SQL · C |
row_count
| Signature | Purpose | Source definition |
|---|---|---|
mysql.row_count() → bigint | Read the affected-row count for the previous statement. | SQL · C |
schema
| Signature | Purpose | Source definition |
|---|---|---|
mysql.schema() → text | Return the MySQL database selected in this session. | SQL · C |
session_user
| Signature | Purpose | Source definition |
|---|---|---|
mysql."session_user"() → text | Session role and client host. | SQL · C |
sleep
| Signature | Purpose | Source definition |
|---|---|---|
mysql.sleep(seconds numeric) → character varying | Wait for the requested number of seconds. | SQL |
user
| Signature | Purpose | Source definition |
|---|---|---|
mysql."user"() → text | Return PostgreSQL current_user as text. | SQL |
uuid
| Signature | Purpose | Source definition |
|---|---|---|
mysql.uuid() → text | Generate a UUID. | SQL |
uuid_short
| Signature | Purpose | Source definition |
|---|---|---|
mysql.uuid_short() → text | Generate a short MySQL-style identifier. | SQL · C |
version
| Signature | Purpose | Source definition |
|---|---|---|
mysql.version() → text | Return the advertised MySQL server version. | SQL · C |