In oracle I could create .sql files and run them with a structure (like a stored procedure) with
begin
declare
end;
I did some tests, because I need to run scripts to fix problems, not is necessary record it as a stored procedure/function on server, so like in Oracle, I want to run it once and check the result.
Not is possible run .sql files on postgres with CURSOR, declare, variables, etc.. , only directly on server with stored procedures/functions ?