Skip to content

Commit

Permalink
Update user-defined actions
Browse files Browse the repository at this point in the history
Co-authored-by: Iain Cox <iain@timescale.com>
  • Loading branch information
atovpeko and billy-the-fish authored Feb 10, 2025
1 parent 9b01b00 commit e81e128
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ the SQL procedural language [PL/pgSQL][plpgsql].
The basic syntax of a function suitable for a user-defined action is:

```sql
CREATE FUNCTION <function_name> (arguments)
CREATE FUNCTION <function_name> (required arguments)
RETURNS <return_datatype> AS $<variable_name>$
DECLARE
<declaration>;
Expand All @@ -37,10 +37,10 @@ RETURNS <return_datatype> AS $<variable_name>$
END; LANGUAGE <language>;
```

This is an example of a function returns the total row count of a table
This is an example of a function that returns the total row count of a table
within a database.

Use this code to create the function:
Use this code to create the function. Note that `job_id` and `config` are required arguments.

```sql
CREATE FUNCTION totalRecords (job_id INT DEFAULT NULL, config JSONB DEFAULT NULL)
Expand Down

0 comments on commit e81e128

Please sign in to comment.