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

Extra objects of `pg_dump -s -t` #4909

Closed
adam8157 opened this issue Apr 28, 2018 · 9 comments

Comments

Projects
None yet
4 participants
@adam8157
Copy link
Member

commented Apr 28, 2018

testdb=# CREATE FUNCTION myread() RETURNS integer
as '$libdir/gpextprotocol.so', 'demoprot_import'
LANGUAGE C STABLE;
CREATE FUNCTION
testdb=# CREATE FUNCTION mywrite() RETURNS integer
as '$libdir/gpextprotocol.so', 'demoprot_export'
LANGUAGE C STABLE;
CREATE FUNCTION
testdb=# CREATE TRUSTED PROTOCOL myprot ( readfunc = 'myread', writefunc = 'mywrite');
CREATE PROTOCOL
$ pg_dump -s -x -O --no-gp-syntax  -t schema2.foo2 testdb
--
-- Greenplum Database database dump
--

SET statement_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SET check_function_bodies = false;
SET client_min_messages = warning;

SET search_path = schema2, pg_catalog;

SET default_tablespace = '';

SET default_with_oids = false;

--
-- Name: foo2; Type: TABLE; Schema: schema2; Owner: -; Tablespace:
--

CREATE TABLE foo2 (
    i integer
);


--
-- Name: myprot; Type: PROTOCOL; Schema: -; Owner: -
--

-- Set the search_path required to look up the functions
SET search_path = public;

CREATE TRUSTED PROTOCOL myprot ( readfunc = 'myread', writefunc = 'mywrite');


--
-- Greenplum Database database dump complete
--

Why the protocol is dumped also? How could I get the dump of table's schema only?

@adam8157

This comment has been minimized.

Copy link
Member Author

commented May 7, 2018

@khuddlefish could you please take a look?

@khuddlefish

This comment has been minimized.

Copy link
Member

commented May 7, 2018

It looks like pg_dump is using the wrong method to determine if PROTOCOLS should be dumped. You are correct that they shouldn't be included with -t. We can put a story in our backlog to fix this.

@Eulerizeit

This comment has been minimized.

Copy link

commented May 7, 2018

@jchampio @danielgustafsson I'm not sure if this is on your radar.

@khuddlefish

This comment has been minimized.

Copy link
Member

commented May 9, 2018

@adam8157 Can we get an idea of how urgently you need this to be fixed? Is it blocking your team, or do you have a way to workaround it? Just helps to know when we are prioritizing the fix.

@adam8157

This comment has been minimized.

Copy link
Member Author

commented May 10, 2018

@khuddlefish this would make a major functionality of our utility not working. For that functionality we don't have a workaround right now, we recommend users to pg_dumpall the whole schema but not tables' as a temporary solution.

Not only protocols, what pg_dump users want is "executing multiple dumped table schemas should not conflict".

@chrishajas

This comment has been minimized.

Copy link
Member

commented May 10, 2018

@adam8157 Are there other issues you've seen beside protocols? pg_dump does make an effort to not dump objects such as procedural languages and other metadata during a table-only dump.

@adam8157

This comment has been minimized.

Copy link
Member Author

commented May 11, 2018

@chrishajas I roughly checked the code, thought it would dump lots of other objects, turns out I was wrong. Have tested a table on the database left by ICW today, only protocols are unnecessary as my result.

@khuddlefish

This comment has been minimized.

Copy link
Member

commented May 11, 2018

@khuddlefish

This comment has been minimized.

Copy link
Member

commented May 12, 2018

PR for the fix is up #4979

@adam8157 adam8157 closed this Jun 5, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.