Skip to content

Error importing table that exists in other(s) schema(s) with the same table name #51

@fredericocotrim

Description

@fredericocotrim

Error importing table that exists in other(s) schema(s) with the same table name.

Database: db_test

create table public.item (id int primary key, description varchar(50));
insert into public.item (id, description) values (1, 'AAA'), (2, 'BBB');

create schema backup;
create table backup.item (id int primary key, description varchar(50));
insert into backup.item (id, description) values (1, 'AAA'), (2, 'BBB');

Database: db_test_fdw


CREATE EXTENSION IF NOT EXISTS jdbc_fdw;

DROP SERVER IF EXISTS srv_db_test CASCADE;

CREATE SERVER srv_db_test FOREIGN DATA WRAPPER jdbc_fdw
  OPTIONS(
    drivername 'org.postgresql.Driver',
    url 'jdbc:postgresql://127.0.0.1:5432/db_test',
    querytimeout '1000',
    jarfile '/opt/jdbc_fdw/postgresql-42.7.5.jar'
    --maxheapsize '1 Mb'
);

CREATE USER MAPPING FOR public SERVER srv_db_test
    OPTIONS (username 'postgres', password '123456');

IMPORT FOREIGN SCHEMA public
limit to (item)
  FROM SERVER srv_db_test
  INTO public
  --OPTIONS (recreate 'true')
;

Error:

ERROR:  column "id" specified more than once
CONTEXT:  importing foreign table "item" 

SQL state: 42701

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions