https://github.com/luk4z7/plpgsql-tools
Helpers for PL/pgSQL applications
https://github.com/luk4z7/plpgsql-tools
database plpgsql postgres postgresql psql sql
Last synced: 8 months ago
JSON representation
Helpers for PL/pgSQL applications
- Host: GitHub
- URL: https://github.com/luk4z7/plpgsql-tools
- Owner: luk4z7
- License: bsd-3-clause
- Created: 2016-11-30T02:55:32.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2017-11-30T02:52:24.000Z (about 8 years ago)
- Last Synced: 2025-04-08T04:13:26.466Z (10 months ago)
- Topics: database, plpgsql, postgres, postgresql, psql, sql
- Language: PLpgSQL
- Homepage:
- Size: 11.7 KB
- Stars: 14
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
### Getting started
```bash
git clone https://github.com/luk4z7/plpgsql-tools.git
```
**Execute the file `init.sh` and enter your name of database for deploy**
```bash
https://github.com/luk4z7/plpgsql-tools for the canonical source repository
Helpers for PL/pgSQL applications
____ _ __ ____ ___ _
| _ \| | / / __ __ _/ ___| / _ \| |
| |_) | | / / '_ \ / _` \___ \| | | | |
| __/| |___ / /| |_) | (_| |___) | |_| | |___
|_| |_____/_/ | .__/ \__, |____/ \__\_\_____|
|_| |___/
PostgreSQL
Enter the database name:
```
Then just connect to the database and run a query
```sql
SELECT * FROM helper_functions;
```
```bash
function | description | parameters | return
----------------------------------+---------------------------------------------------------------------------------------+---------------------------------------------------------+-------------------
pg_get_definition_tables_json() | Return all metadata of tables in the specific schema | {"schema CHARACTER VARYING"} | TEXT
pg_search_table() | Return all tables that match a name of table or column | {"keyword CHARACTER VARYING"} | CHARACTER VARYING
pg_show_activity() | Show activity of all users and transactions in all databases | {""} | TEXT
pg_show_larger_object() | Show size of all objects in database | {"size INTEGER (in bytes)"} | CHARACTER VARYING
pg_show_size_databases() | Show size of all databases | {""} | CHARACTER VARYING
pg_show_tables_with_oid_lo() | Show all tables with column type oid or lo | {""} | CHARACTER VARYING
pg_size_object() | Show information about object, size, entries, type, pages | {"objectName TEXT"} | CHARACTER VARYING
pg_terminate_backend() | Terminate processes by status | {"status CHARACTER VARYING"} | BOOLEAN
pg_terminate_backend_all() | Terminate all processes except the that executing the function | {""} | BOOLEAN
pg_truncate_larger_tables() | Truncate all data of large tables, WARNING, don't execute this function in production | {"size INTEGER (in bytes)"} | BOOLEAN
pg_truncate_tables_with_search() | Truncate all tables with ilike, WARNING, don't execute this function in production | {"schema TEXT","key for search TEXT","preview BOOLEAN"} | VOID
```