From: PG Bug reporting form <noreply@postgresql.org>
To: pgsql-bugs@lists.postgresql.org
Cc: boatcoder@gmail.com
Subject: BUG #17328: import foreign schema never reports errors
Date: Wed, 08 Dec 2021 17:19:45 +0000
Message-ID: <17328-a6eb5e7fc1e1abad@postgresql.org> (raw)
The following bug has been logged on the website:
Bug reference: 17328
Logged by: Mark Jones
Email address: boatcoder@gmail.com
PostgreSQL version: 14.0
Operating system: MacOS (but not important)
Description:
With a statement like:
`import foreign schema "public" limit to (public.segment_over_1) from
server metrics into public;`
You never get an error, even if that table does not exist on the FDW server.
This makes it a multi-step process to find out if what you told Postgres to
do was actually done. You have to import the schema, then check for the
existence of the table. Seems like this should create an error if the
remote table does not exist.
In my case it was during unit test where Django was creating the server
during a migration and then changing the db name to start with test_. Then
my code internal to the application was trying to import the schema from the
wrong server. I'm a bit embarrassed how long it took me figure out what was
going on, but a simple error during the import would have made it very
obvious.
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-bugs@postgresql.org
Cc: noreply@postgresql.org, pgsql-bugs@lists.postgresql.org, boatcoder@gmail.com
Subject: Re: BUG #17328: import foreign schema never reports errors
In-Reply-To: <17328-a6eb5e7fc1e1abad@postgresql.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox