Closed rndor closed 6 years ago
Of note, calling the function thusly [Sql("SELECT * FROM test.get_widget(@id)")]
also works as expected.
It looks likes the latest version of the npgsql library changed the behavior. We use sequential access to speed up performance, but that's no longer compatible with output parameters. Should be an easy fix.
This is definitely a difference in npgsql 4.0. v3.x works fine. Let me see how we can fix it.
I've updated the code to strip out the sequential access mode when using pgsql and there is an output parameter.
This is fixed in v6.2.5, to be released next week.
In the meantime, using npgsql 3.x is a workaround.
Fantastic, I look forward to the update. Thanks for your quick response on this as well as issue #381.
6.2.5 is now available
Issue
Using a Postgres function with a SETOF (or TABLE) return value throws the following exception:
Steps to reproduce
Database
Create table:
and plpgsql functions:
C# code
Along with the following C# code:
Run the following (i.e. in Startup()):
Expected behavior
The record should be returned as expected. This doesn't appear to be an issue with other return types (like returning INT in the insert_widget function). Also, changing the Sql attribute to the following...
[Sql("SELECT * FROM test.widget WHERE id = @id")]
...works as expected as well.