On Thu, 17 Feb 2011, wes wrote:
> I don't think it's this. I copied and pasted the create table statement
> and the insert statement into my own testing DB and got the same error. I
> fixed it by putting single-quotes around the data for that column, and
> then got the same error for a different column. it seems it's interpreting
> data types based on the first character. so for a column whose first
> character is a numeral, PG believes it's a number, and throws an error on
> the alphabetical component.
How interesting! That's the sqlite default: columns are not typecast but
assigned based on the content. The .sql file came from a sqlite dump. The
DATE columns were originally DATETIME, but I changed them since no times
were visible; I can change these back.
> Pretty much, you have to quote all strings, and NOT quote all integers. Once
> I fixed all those, then it complained about your date column:
Since the file is ASCII (or the lower 127 chars for UTF-8), I wonder if I
can learn _why_ postgres is interpreting attribute type by content rather
than by the DDL.
In response to
pdxpug by date
|Next:||From: Rich Shepard||Date: 2011-02-18 17:02:10|
|Subject: timestamp and input format|
|Previous:||From: wes||Date: 2011-02-17 15:49:33|
|Subject: Re: SQLite to Postgres, II|