I'm trying to execute a function via linked server in SQL Server like below and getting an error:
SELECT * FROM PGNP_OLTP.MyQAdb.[public].arc_orders();
Msg 4122, Level 16, State 1, Line 1
Remote table-valued function calls are not allowed.
The function call works fine if executed directly in PG or via SSIS but not in SQL query via linked server as per PGNP documentation. I'm using version 1.4 64bits on SQL Server 2008 SP2 connecting to PG 9.0 on Linux.
Here is my provider string:
'PROVIDER=PGNP.1;USERID=pg_dev;SSL=allow;PORT=5432;FORCEUTF8=ON;NESTED_TRANS=ON;CNV_SPECIAL_FLTVAL=ON;
BULK_METHOD=COPY;BULK_INSERT=1000;'
Is there any way to run these function calls from SQL directly? My intention was to convert all lingering code into SQL code objects (stored procs) and execute them from SQL jobs where we have history,logging,execution stats but this error means no PG function calls are allowed?
The function actually returns VOID and all it does it backs-up orders then delets them so there is no actual record set returned by it.
After I tried similar syntax to SSIS except the full (four) name qualifier I gett a different error:
SELECT PGNP_OLTP.MyQAdb.[public].arc_orders();
Msg 344, Level 16, State 1, Line 1
Remote function reference 'PGNP_OLTP.MyQAdb.public.arc_orders' is not allowed, and the column name 'PGNP_OLTP' could not be found or is ambiguous.
So I guess my basic simple question is:
Is there any way to run PG function in SQL code via Linked Servers (as documented by PGNP) using full (four) name qualifier?
