Postgresql Quoted Table/Column names

Feb 10, 2015 at 3:08 PM
I am working with a Postgresql database where the tables and column name must be quoted.
I have an insert method:
context.IgnoreIfAutoMapFails(true);
id = context.Insert("\"Carriers\"", entity)
    .AutoMap(x => x.Id,
        x => x.IsDeleted,
        x => x.IsDirty,
        x => x.IsNew)
    .ExecuteReturnLastId<int>();
I get a column name does not exist error because the column name are not quoted. Is there a way to tell the builder to quote the column names.
Developer
Feb 14, 2015 at 11:42 AM
It seems your problem is unusual,why don't you change your tables/columns name remove the quote?

if you have to quote,you need modify your own fluentdata version.good luck!
Feb 14, 2015 at 3:25 PM
Thank you for your response. I can't remove the quotes as this is a legacy database. I made the following changes to fluent data. I adding a Boolean property “UseQuotes” which has a default value of false. I then changes the EscapeColumnName method in the PostgreSqlProvider class to the following:
public string EscapeColumnName(string name)  {
    return UseQuotes ? "\"" + name + "\"" : name;
}
Marked as answer by RWBradley on 2/14/2015 at 7:25 AM