Click here to Skip to main content
13,052,163 members (37,557 online)
Rate this:
Please Sign up or sign in to vote.
I have application in nhibernate & postgresql
migrating from sql to postgres
in postgres column type is integer but It gives error while update-insert data
    [Column(1, Name = "is_deleted", SqlType = "INTEGER")]
    public virtual bool IsDeleted
        get { return isDeleted; }
        set { isDeleted = value; }

Npgsql.NpgsqlException: column "is_deleted" is of type integer but expression is of type boolean Severity: ERROR Code: 42804

I have try to map column type in app.config file but not working...
<property name="query.substitutions">
       true 1, false 0

suggest a way to solve this Map column types boolean to integer...
Posted 18-Mar-13 19:23pm
Updated 18-Mar-13 19:24pm

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Purely a guess as I don't know the technology, but have you tried setting the SQLType as bit even though the real column is int?
Aarti Meswania 19-Mar-13 1:35am
are you talking to set column type bit in postgres?
_Maxxx_ 19-Mar-13 5:06am
sorry - I think it's boolean in Postgres? so yes, I'm suggesting you see what happens if you tell the code it's a boolean even thought he column type is an integer.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web01 | 2.8.170713.1 | Last Updated 19 Mar 2013
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100