Postgresql: How to use curl with function

笑着哭i 提交于 2021-01-28 08:20:22

问题


I have a function parse_sdf(text).
When I call the function like this:

INSERT INTO test.table("Id", "Test") 
(SELECT props -> 'Id', props -> 'Test' FROM parse_sdf());

When I execute the INSERT with pgsql I want to pass as a parameter a text file which I download via curl. Like this:

INSERT INTO test.table("Id", "Test") 
(SELECT props -> 'Id', props -> 'Test' FROM parse_sdf('curl http://test/Files/text.txt'));

But it doesn't work. Is there a way to accomplish this?

UPDATE:

Postgres version: 10
Command will be executed with ExecuteSqlCommand command from Npgsql package for EF Core.

来源:https://stackoverflow.com/questions/50004712/postgresql-how-to-use-curl-with-function

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!