Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 1DE7A4770DC for ; Thu, 23 Jan 2003 23:45:56 -0500 (EST) Received: from cook.itsd.co.nz (visp5-179.visp.co.nz [210.54.179.5]) by postgresql.org (Postfix) with ESMTP id 375AC47740E for ; Thu, 23 Jan 2003 21:55:51 -0500 (EST) Received: from K2 (k2.md5summer.org [10.0.0.50]) by cook.itsd.co.nz (8.12.3/8.12.3/Debian -4) with SMTP id h0O2tp7f023677 for ; Fri, 24 Jan 2003 15:55:53 +1300 Message-ID: <01df01c2c354$2bac5a60$3200000a@K2> From: "Luke Pascoe" To: Subject: CAST from VARCHAR to INT Date: Fri, 24 Jan 2003 15:56:19 +1300 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1106 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200301/380 X-Sequence-Number: 11245 (Postgres 7.2.1) I screwed up when I was designing a table a while back and made a column a VARCHAR that referenced (and should have been) an INT. Now I'm trying to correct my mistake, I've created a new table and I'm trying to INSERT INTO...SELECT the data into it, but it's complaining that it can't stick a VARCHAR into an INT. All the values in the column are valid integers (the foreign key sees to that) but even a CAST won't do it. How can I force it to copy/change the values? ======================================== Luke Pascoe Senior Developer / Systems administrator KMG (NZ) Limited. http://www.kmg.co.nz Mobile: (021) 303019 Email: luke.p@kmg.co.nz ========================================