Skip site navigation (1) Skip section navigation (2)

Problem inserting data

From: Tk421 <vrobador(at)gmail(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: Problem inserting data
Date: 2008-06-20 12:20:18
Message-ID: 485BA082.8060605@gmail.com (view raw or flat)
Thread:
Lists: pgsql-sql
   Hello everybody.

    I''ve just converted an access database to postgres. The conversion 
was ok, but when i'm trying to insert data on some tables with boolean 
types from a Visual Basic application i receive an error. A sample:

    table example, with firs field of integer, second of type text and 
third of type boolean

    the query: INSERT INTO EXAMPLE VALUES (1, 'text', 0)

    When i used access this worked fine, in boolean types 0 is false and 
1 is true, but in postgres (8.1 and 8.3 version) i receive the next error:

    column "premarco" is of type boolean but expression is of type integer

    My question is, can i force postgres to accept integer values as 
boolean without changin query to INSERT INTO EXAMPLE VALUES (1, 'text', 
0::boolean). This is a problem because if I have to do this i will have 
to test about one hundred queryes

    Thank you very much

Responses

pgsql-sql by date

Next:From: Chris PrestonDate: 2008-06-20 13:05:48
Subject: Cross Tab Functions
Previous:From: Peter KovacsDate: 2008-06-20 07:37:49
Subject: Re: "TZ"/"tz" not supported

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group