I'm attempting to use pgProvider as part of a move to Postgresql to get membership working in a .NET MVC4 web app, however I keep encountering the following error:
ERROR: 42P01: relation "versions" does not exist
So far I've set up the web.config as suggested and confirmed that the provider is successfully connecting to the database using .NET Reflector. I've narrowed the issue down to the ValidateVersion()
function within the DDLManager.cs file in pgProvider.
Essentially what is happening is pgProvider is trying to check if it should auto-create the membership tables (by checking if the tables already exist). However the way in which it does this is by running this query:
select count(*) from pg_tables where schemaname = 'public' and tablename = 'versions';
And then tries to parse the result into an int, returning the bool from int.TryParse()
as the indicator of whether the table exists or not. But because the result that is being returned is 0 instead of NULL (which I assume is what pgProvider expects if there is no table), it always evaluates to true...because obviously 0 is an int. Therefore, it thinks all the tables exist and tries to run on a query on the "versions" table which hasn't been created.
So I'm not sure if it's an issue with my database returning 0 when it should return NULL or if it's an issue with pgProvider not actually looking at what is returned. Where should I go from here?