I'm trying to copy a table from SQLServer Express 2005 to PostgreSQL 8.4 for Windows via DTSWizard, but it's created with quotes in its identifiers and COPY emits an error.
The source database has collation Modern_Spanish_CI_AS (codepage 1252), and destination database uses the same codepage for collation and character type, but UTF-8 for encoding.
PGNP is configured to use COPY as the bulk insert method (there is no problem using Value sets), and "Lower Case Schema" and "Force UTF8" are unchecked.
The table to copy has only one bigint column, and is created right with this script (from the profiler log):
- Code: Select all
---------- Client SQL ------------
CREATE TABLE "T$REC" (
"DN_PK" bigint
)
---------- Executed SQL ---------
create table "T$REC"
("DN_PK" bigint)
But when the copy starts, I get an error stating that the column doesn't exist in the table (the message is in Spanish and with strange characters due to different codepages):
- Code: Select all
---------- Client SQL ------------
COPY "T$REC"(DN_PK) FROM stdin WITH DELIMITER '|' CSV
---------- Error ---------
ERROR: no existe la columna «dn_pk» en la relación «T$REC»
Apart from that, I get a similar error when I don't use quotes to query that table and its column from pgAdmin III:
- Code: Select all
-- Executing query:
BEGIN;
EXPLAIN ANALYZE VERBOSE SELECT
DN_PK
FROM
"T$REC"
;
ROLLBACK;
Query result with 0 rows will be returned.
ERROR: no existe la columna «dn_pk»
LINE 4: DN_PK
^
********** Error **********
ERROR: no existe la columna «dn_pk»
SQL state: 42703
Character: 43
Thanks.
