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
When you use the SQL Editor View and define a function via create or replace... to test if a function works properly and then immediately execute the function via SELECT it will say "no rows returned" although this might be completely false. Probably it is somehow only taking the result of the first statement (function definition).
Note: I am using plv8 language (pgsql extension) but I am pretty sure it works with all languages like this since it doesn't look like a language-related problem.
To Reproduce
Steps to reproduce the behavior, please provide code snippets or a repository:
Go to the SQL Editor
Type in something like ():
create or replace function foobar()
returns smallint as $$
var rows = plv8.execute(
'SELECT COUNT(id) as c FROM whatever_table'
);
return rows[0].c;
$$ language plv8;
SELECT foobar()
Click RUN to execute the sql
Expected behavior
It should return the row with the count
Actual Behaviour
Returns no rows.
The text was updated successfully, but these errors were encountered:
Hey @burmecia . I'd rather close the related issue or rephrase it. Normally an issue should contain proper description which supabase/postgres-meta#143 does not. But yeah, probably related.
This issue has been fixed. For example, run below SQL in SQL Editor,
create or replacefunctionfoobar()
returns smallintas $$
var rows =plv8.execute(
'SELECT 42 as c'
);
return rows[0].c;
$$ language plv8;
SELECT foobar()
Bug report
Describe the bug
When you use the SQL Editor View and define a function via
create or replace...
to test if a function works properly and then immediately execute the function via SELECT it will say "no rows returned" although this might be completely false. Probably it is somehow only taking the result of the first statement (function definition).Note: I am using plv8 language (pgsql extension) but I am pretty sure it works with all languages like this since it doesn't look like a language-related problem.
To Reproduce
Steps to reproduce the behavior, please provide code snippets or a repository:
RUN
to execute the sqlExpected behavior
It should return the row with the count
Actual Behaviour
Returns no rows.
The text was updated successfully, but these errors were encountered: