https://github.com/andyatkinson/db-stuff
Tutorials from PostgreSQL Stored Procedures
https://github.com/andyatkinson/db-stuff
postgresql sql
Last synced: 3 months ago
JSON representation
Tutorials from PostgreSQL Stored Procedures
- Host: GitHub
- URL: https://github.com/andyatkinson/db-stuff
- Owner: andyatkinson
- Created: 2018-08-24T17:12:32.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2018-08-24T17:12:47.000Z (almost 7 years ago)
- Last Synced: 2025-02-10T15:50:48.082Z (5 months ago)
- Topics: postgresql, sql
- Language: PLpgSQL
- Homepage:
- Size: 1000 Bytes
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Tutorials from [PostgreSQL Stored Procedures](http://www.postgresqltutorial.com/postgresql-stored-procedures/)
#### Stored procedures
`\df` to list all stored procedures
View stored procedure code with `\df+ function`, e.g. `\df+ inc` or `\ef func` to edit the function
`inc` - increment a number
Usage: `SELECT inc(20);``get_sum(a,b)`
Usage: `select get_sum(1,2);``hi_lo(a,b,c)`
Usage: `select hi_lo(1,2,3);``sum_avg(NUMERIC[])`
Usage: `select sum_avg(1,2,3,4,5);`