1
0
mirror of https://github.com/jbranchaud/til synced 2026-01-07 00:58:02 +00:00

Add Edit Existing Functions as a postgres til.

This commit is contained in:
jbranchaud
2015-07-12 16:27:34 -05:00
parent 0e7dfeeda5
commit 003dc78534
2 changed files with 22 additions and 0 deletions

View File

@@ -59,6 +59,7 @@ smart people at [Hashrocket](http://hashrocket.com/).
- [Configure The Timezone](postgres/configure-the-timezone.md) - [Configure The Timezone](postgres/configure-the-timezone.md)
- [Count Records By Type](postgres/count-records-by-type.md) - [Count Records By Type](postgres/count-records-by-type.md)
- [Default Schema](postgres/default-schema.md) - [Default Schema](postgres/default-schema.md)
- [Edit Existing Functions](postgres/edit-existing-functions.md)
- [Extracting Nested JSON Data](postgres/extracting-nested-json-data.md) - [Extracting Nested JSON Data](postgres/extracting-nested-json-data.md)
- [Fizzbuzz With Common Table Expressions](postgres/fizzbuzz-with-common-table-expressions.md) - [Fizzbuzz With Common Table Expressions](postgres/fizzbuzz-with-common-table-expressions.md)
- [Generate Series Of Numbers](postgres/generate-series-of-numbers.md) - [Generate Series Of Numbers](postgres/generate-series-of-numbers.md)

View File

@@ -0,0 +1,21 @@
# Edit Existing Functions
In the `psql` console, use `\ef` with the name of a function to fetch and
open the definition of the function. The function will be opened in your
system `$EDITOR` in the form of the `create or replace function` query.
Executing
```sql
> \ef now
```
will open the following in your default editor
```sql
CREATE OR REPLACE FUNCTION pg_catalog.now()¬
RETURNS timestamp with time zone¬
LANGUAGE internal¬
STABLE STRICT¬
AS $function$now$function$¬
```