Enum in foreign table: error and correct way to handle.

From: Peter Swartz <peter(dot)goodings(dot)swartz(at)gmail(dot)com>
To: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Enum in foreign table: error and correct way to handle.
Date: 2015-05-20 19:23:09
Message-ID: CAGhmnP2bKk5BbAa0ndRvLyULGWzXnD8U+epu6zJFByKw7q1J1Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I'm creating a foreign table (foo_table) in database_a. foo_table lives in
database_b.foo_table has an enum (bar_type) as one of its columns. Because
this enum is in database_b, the creation of the foreign table fails in
database_a. database_a doesn't understand the column type. Running the
following in database_a

CREATE FOREIGN TABLE foo_table (id integer NOT NULL, bar bar_type) SERVER
database_b

One gets the error:

ERROR: type "bar_type" does not exist

I could just create a copy of bar_type in database_a, but this feels
duplicative and possibly a future cause of inconsistency / trouble. Would
anyone have thoughts on best practices for handling?
Thank you!
Peter

Responses

Browse pgsql-general by date

  From Date Subject
Next Message John R Pierce 2015-05-20 19:28:16 Re: Consistent state for pg_dump and pg_dumpall
Previous Message Steve Midgley 2015-05-20 18:11:45 Fwd: [GENERAL] Does PG support bulk operation in embedded C