Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error - column does not exist (default value) #36

Open
jonmc12 opened this issue Sep 25, 2011 · 4 comments
Open

Error - column does not exist (default value) #36

jonmc12 opened this issue Sep 25, 2011 · 4 comments
Labels

Comments

@jonmc12
Copy link

jonmc12 commented Sep 25, 2011

I am getting the following error when trying to import DB. This column has a DEFAULT value:

Creating table orders...
Error:
CREATE TABLE "orders" (
"id" integer DEFAULT nextval('orders_id_seq'::regclass) NOT NULL,
"customer_id" integer,
"status" character varying(255) DEFAULT Unseen::character varying NOT NULL,
"dispatcher_note" text,
"driver_note" text,
"items_billed_archive" numeric(6, 2),
"payment_status" character varying(255),
"transaction_id" character varying(255),
"restaurant_status" text,
"faxed" text
)
WITHOUT OIDS;
Mysql2psql: conversion failed: ERROR: column "unseen" does not exist

Is there a fix or workaround for this error?

@kakubei
Copy link

kakubei commented Jan 21, 2014

I am getting a similar error:

Mysql2psql: conversion failed: ERROR:  column "videoformat" does not exist

CREATE TABLE "dvd_locales" (
  "id" integer DEFAULT nextval('dvd_locales_id_seq'::regclass) NOT NULL,
  "dvd_id" bigint NOT NULL,
  "locale" character varying(2) NOT NULL,
  "price" character varying(12),
  "region" integer,
  "releaseDate" date,
  "rated_id" integer,
  "videoFormat" character varying(4) check( videoFormat in ('NTSC','PAL')) DEFAULT 'NTSC'::character varying
)
WITHOUT OIDS;

I could create the table and columns by hand, but the thing is that the migration will not proceed because of this error. How can I migrate the tables that it does like and then worry about the errors afterwards?

@shinnc
Copy link

shinnc commented Mar 6, 2014

I have the same issue with @kakubei, could it be mysql2postgres looking up the column name in lowercase caused this issue?

@maxlapshin
Copy link
Owner

Maybe.

I haven't used mysql for 6 years, so I cannot help you with this bug. But I'll accept patch.

@warlck
Copy link

warlck commented Mar 15, 2014

I had similar problem. In my case when mysql2psql was executed, it could not recreate 'enum' type columns from mysql tables in postgresql. In my database all 'enum' type columns had the values of strings , so I changed the type of columns from 'enum' to 'varchar'. After this change mysql2psql executed successfully. I hope this helps to you too.

@paazmaya paazmaya added the bug label Aug 21, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants