resources
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| resources [2011/11/15 15:43] – [Getting Connection Information] k2patel | resources [2020/08/10 02:35] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 62: | Line 62: | ||
| == Read Only User == | == Read Only User == | ||
| - | This only allow user to access database but can not write to it. | + | This only allow user to access database but can not write to it.\\ |
| + | <note important> | ||
| <code sql> | <code sql> | ||
| Line 69: | Line 70: | ||
| GRANT SELECT ON ALL TABLES IN SCHEMA public TO carol; | GRANT SELECT ON ALL TABLES IN SCHEMA public TO carol; | ||
| </ | </ | ||
| + | |||
| + | <note tip>If there is ERROR : pg_dump: The command was: LOCK SEQUENCE public.client_group IN ACCESS SHARE MODE See next Section </ | ||
| + | |||
| + | <code sql> | ||
| + | \dp public.client_group; | ||
| + | GRANT SELECT ON ALL SEQUENCES IN SCHEMA public TO backup; | ||
| + | </ | ||
| + | |||
| + | <note tip>Even you can use above commands to create backup user for specific database.</ | ||
| ==== Getting Connection Information ==== | ==== Getting Connection Information ==== | ||
| Line 78: | Line 88: | ||
| Following is the available procedures / variable. | Following is the available procedures / variable. | ||
| - | Name | + | <code text> |
| - | Return Type | + | Name Description |
| - | Description | + | current_catalog name of current database (called |
| - | current_catalog | + | current_database() name of current database |
| - | name | + | current_schema[()] name of current schema |
| - | name of current database (called " | + | current_schemas(boolean) names of schemas in search path, optionally including implicit schemas |
| - | current_database() | + | current_user user name of current execution context |
| - | name | + | current_query() text of the currently executing query, as submitted by the client (might contain more than one statement) |
| - | name of current database | + | pg_backend_pid() Process ID of the server process attached to the current session |
| - | current_schema[()] | + | pg_listening_channels() channel names that the session is currently listening on |
| - | name | + | inet_client_addr() address of the remote connection |
| - | name of current schema | + | inet_client_port() port of the remote connection |
| - | current_schemas(boolean) | + | inet_server_addr() address of the local connection |
| - | name[] | + | inet_server_port() port of the local connection |
| - | names of schemas in search path, optionally including implicit schemas | + | pg_my_temp_schema() OID of session' |
| - | current_user | + | pg_is_other_temp_schema(oid) boolean is schema another session' |
| - | name | + | pg_postmaster_start_time() server start time |
| - | user name of current execution context | + | pg_conf_load_time() configuration load time |
| - | current_query() | + | session_user session user name |
| - | text | + | user equivalent |
| - | text of the currently executing query, as submitted by the client (might contain more than one statement) | + | version() PostgreSQL version |
| - | pg_backend_pid() | + | </ |
| - | int | + | |
| - | Process ID of the server process attached to the current session | + | |
| - | pg_listening_channels() | + | |
| - | setof text | + | |
| - | channel names that the session is currently listening on | + | |
| - | inet_client_addr() | + | |
| - | inet | + | |
| - | address of the remote connection | + | |
| - | inet_client_port() | + | |
| - | int | + | |
| - | port of the remote connection | + | |
| - | inet_server_addr() | + | |
| - | inet | + | |
| - | address of the local connection | + | |
| - | inet_server_port() | + | |
| - | int | + | |
| - | port of the local connection | + | |
| - | pg_my_temp_schema() | + | |
| - | oid | + | |
| - | OID of session' | + | |
| - | pg_is_other_temp_schema(oid) | + | |
| - | boolean | + | |
| - | is schema another session' | + | |
| - | pg_postmaster_start_time() | + | |
| - | timestamp with time zone | + | |
| - | server start time | + | |
| - | pg_conf_load_time() | + | |
| - | timestamp with time zone | + | |
| - | configuration load time | + | |
| - | session_user | + | |
| - | name | + | |
| - | session user name | + | |
| - | user | + | |
| - | name | + | |
| - | equivalent | + | |
| - | version() | + | |
| - | text | + | |
| - | PostgreSQL version | + | |
resources.1321371829.txt.gz · Last modified: 2020/08/10 02:29 (external edit)
