You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently we use pgtle.install_extension to create the extension code which is part of the code block. The block could contain multiple statements to create multiple objects. If the extension creation failed due to any syntax error, it would be difficult to debug since the error does not have any reference or line number
What are you trying to solve?
To make it easy to debug the failed extension creation.
Here the sample code to reproduce it
pg_tle | 1.1.1 | pgtle | Trusted Language Extensions for PostgreSQL
SELECT pgtle.install_extension( 'get_count', '1.0.0', 'Sample count function',
$pgtle$
Create or replace function get_count(len_from int, len_to int)
returns int
language plpgsql
as
$$
declare
film_count integer;
begin
film_count = len_from + len_to;
return film_count;
end;
$$
grant execute on function get_count(int, int) to public;
$pgtle$
);
postgres=> \i get_count.sql
install_extension
t
(1 row)
postgres=> create extension get_count;
ERROR: syntax error at or near "grant"
I intentionally did not add ; after the $$ of the function and it failed to create the extension. But the error message is not easy to debug as some extension may have may grant statements ( or similar)
The text was updated successfully, but these errors were encountered:
Describe the problem
Currently we use pgtle.install_extension to create the extension code which is part of the code block. The block could contain multiple statements to create multiple objects. If the extension creation failed due to any syntax error, it would be difficult to debug since the error does not have any reference or line number
To make it easy to debug the failed extension creation.
Here the sample code to reproduce it
pg_tle | 1.1.1 | pgtle | Trusted Language Extensions for PostgreSQL
SELECT pgtle.install_extension( 'get_count', '1.0.0', 'Sample count function',
$pgtle$
Create or replace function get_count(len_from int, len_to int)
returns int
language plpgsql
as
$$
declare
film_count integer;
begin
film_count = len_from + len_to;
return film_count;
end;
$$
grant execute on function get_count(int, int) to public;
$pgtle$
);
postgres=> \i get_count.sql
install_extension
t
(1 row)
postgres=> create extension get_count;
ERROR: syntax error at or near "grant"
I intentionally did not add ; after the $$ of the function and it failed to create the extension. But the error message is not easy to debug as some extension may have may grant statements ( or similar)
The text was updated successfully, but these errors were encountered: