pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Luke Pascoe <luke.p@kmg.co.nz>
To: pgsql-sql@postgresql.org
Subject: CAST from VARCHAR to INT
Date: Fri, 24 Jan 2003 15:56:19 +1300
Message-ID: <01df01c2c354$2bac5a60$3200000a@K2> (raw)

(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
========================================





view thread (7+ messages)  latest in thread

Message-ID: <01df01c2c354$2bac5a60$3200000a@K2>
Permalink:  ../01df01c2c354$2bac5a60$3200000a@K2/
Also on:    postgresql.org/message-id/01df01c2c354$2bac5a60$3200000a@K2

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: luke.p@kmg.co.nz
  Subject: Re: CAST from VARCHAR to INT
  In-Reply-To: <01df01c2c354$2bac5a60$3200000a@K2>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox