0

I am trying to import this sql script to my db on heidiSQL. But I get this error when I run the script

ERROR: type "app_activity_date_index" does not exist LINE 9: INDEX "app_activity_date_index" ("date")

The code:

CREATE TABLE IF NOT EXISTS "app_activity" (
     "id" BIGINT NOT NULL DEFAULT 'nextval(''app_activity_id_seq''::regclass)',
     "date" TIMESTAMP NOT NULL,
     "type" TEXT NOT NULL,
     "area" TEXT NOT NULL,
     "count" INTEGER NOT NULL,
     INDEX "app_activity_date_index" ("date"),
     PRIMARY KEY ("id")
);

INSERT INTO "app_activity" ("id", "date", "type", "area", "count") VALUES
    (1, '2021-08-17 00:00:00', 'picagens', 'Lactogal - Prod. Alimentares', 1),
    (2, '2021-08-17 00:00:00', 'ferias_contingentes', 'Lactogal - Prod. Alimentares', 1),
    (3, '2021-08-17 00:00:00', 'oportunidades', 'Lactogal - Prod. Alimentares', 2),
    (4, '2021-08-17 00:00:00', 'ferias_contingentes', 'Sistemas de Informação', 2);

Any solution please? Thanks in advance

  • 2
    Please post problematic DDL statement as text – Slava Rozhnev May 02 '22 at 12:13
  • 1
    You are trying to run a MySQL script against Postgres - that won't work. And please do **not** post code as images. See here for more details why: http://meta.stackoverflow.com/questions/285551 –  May 02 '22 at 12:23
  • @JoãoTelemovel, I mean you post all statement caused to error like `CREATE TABLE ....` we need it to try to reproduce your error. Also you can try it yourself online on https://SQLize.online – Slava Rozhnev May 02 '22 at 13:10
  • Your SQL is not valid PostgreSQL syntax. You should fix it like https://sqlize.online/sql/psql14/c3284510eb613dc94de6cef6ddadfe86/ before import. Where this dump exported from? – Slava Rozhnev May 02 '22 at 13:29
  • That script works fine @SlavaRozhnev. But It´s a massive sql file with tables and data to insert. What should I do. It comes from a server db – João Telemovel May 02 '22 at 13:40

0 Answers0