0

I wanto to change the schema of the elmah_error table from public to elmah.

I'm getting this error: Npgsql.NpgsqlException: relation "elmah_error" does not exist. It keep's searching for this table on public only.

On the Web.config I'm trying to set schema=elmah on the errorLog with no success. Found some Sqlerrolog.cs to add the schema, but I'm using PgsqlErrorLog on errorLog and found no PgsqlErrorLog.cs to change.

Someone have a hint about what to do in this situation?

Thanks everyone.

Hossein Narimani Rad
  • 31,361
  • 18
  • 86
  • 116

1 Answers1

0

I am not as familiar with the asp.net or C# side, but on the PostgreSQL side there are three basic approaches. The first is to qualify the table with a schema name, i.e.

select ... from elmah.elmah_error

Another option is to set search path for the session:

SET search_path = 'elmah';

A third option is to alter parameters so that the search path will automatically be set.

ALTER USER aspnet_user SET search_path = 'elmah';

You can alter users or databases to set the search path.

Chris Travers
  • 25,424
  • 6
  • 65
  • 182