Answer the question
In order to leave comments, you need to log in
How to solve error in sql function which should export csv file?
Docker project.
There is a function:
\include_relative bbox_array.sql
\include_relative webapi_sheet_features_query.sql
\include_relative webapi_exec.sql
create or replace function webapi_sheet_features_excel__get
(req json, out head json, out body json)
language sql stable as $fn$
copy (
select webapi_exec(format(
... тут всякая логика ...
), req)
from webapi_sheet_features_query(req)
) to './test.csv' with csv delimiter ','
$fn$; // !!!!ЗДЕСЬ 66 СТРОЧКА
psql:/app/webapi_sheet_features_excel__get.sql:66: ERROR: return type mismatch in function declared to return record
DETAIL: Function's final statement must be SELECT or INSERT/UPDATE/DELETE RETURNING.
CONTEXT: SQL function "webapi_sheet_features_excel__get"
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question