Click here to Skip to main content
Rate this: bad
good
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
[Property]
    [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
     </property>
 
suggest a way to solve this Map column types boolean to integer...
Posted 18-Mar-13 20:23pm
Edited 18-Mar-13 20:24pm
v2

1 solution

Rate this: bad
good
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?
  Permalink  
Comments
Aarti Meswania at 19-Mar-13 1:35am
   
are you talking to set column type bit in postgres?
_Maxxx_ at 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)



Advertise | Privacy | Mobile
Web03 | 2.8.150301.1 | Last Updated 19 Mar 2013
Copyright © CodeProject, 1999-2015
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