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

adding key -F to pg_dump #32

Merged
merged 13 commits into from May 8, 2018
Merged

adding key -F to pg_dump #32

merged 13 commits into from May 8, 2018

Conversation

@Fenimorkin
Copy link
Contributor

@Fenimorkin Fenimorkin commented Feb 4, 2018

Added key unnecessary formate for dump()

-F format
--format=format
Selects the format of the output. format can be one of the following:
p
plain
Output a plain-text SQL script file (the default).
c
custom
Output a custom-format archive suitable for input into pg_restore. Together with the directory output format, this is the most flexible output format in that it allows manual selection and reordering of archived items during restore. This format is also compressed by default.
d
directory

    Output a directory-format archive suitable for input into pg_restore. This will create a directory with one file for each table and blob being dumped, plus a so-called Table of Contents file describing the dumped objects in a machine-readable format that pg_restore can read. A directory format archive can be manipulated with standard Unix tools; for example, files in an uncompressed archive can be compressed with the gzip tool. This format is compressed by default and also supports parallel dumps. 
t
tar
    Output a tar-format archive suitable for input into pg_restore. The tar format is compatible with the directory format: extracting a tar-format archive produces a valid directory-format archive. However, the tar format does not support compression. Also, when using tar format the relative order of table data items cannot be changed during restore. 
@stalkerg
Copy link
Contributor

@stalkerg stalkerg commented Feb 5, 2018

You should fix code style for this pull request. Major problems from pep8 checker but also will be good if you remove comments lines.

@ildus
Copy link
Collaborator

@ildus ildus commented Feb 6, 2018

Tests should be based on unittest library.

@@ -583,8 +583,8 @@ def cleanup(self, max_attempts=3):
def psql(self,
dbname,
query=None,
filename=None,

This comment has been minimized.

@funbringer

funbringer Feb 6, 2018
Collaborator

Arguments should not be moved around.

@@ -658,7 +658,7 @@ def safe_psql(self, dbname, query, username=None, input=None):

return out

def dump(self, dbname, username=None, filename=None):
def dump(self, dbname, username=None, filename=None, formate=None):

This comment has been minimized.

@funbringer

funbringer Feb 6, 2018
Collaborator

Probably should replace formate with format (I know, it's a function name, but who cares).

This comment has been minimized.

@Fenimorkin

Fenimorkin Apr 28, 2018
Author Contributor

done

Returns:
Path to a file containing dump.
"""

# Set default arguments
username = username or _default_username()
formate = formate or "p"

This comment has been minimized.

@funbringer

funbringer Feb 6, 2018
Collaborator

"p" should be replaced with a const defined in consts.py

This comment has been minimized.

@Fenimorkin

Fenimorkin Apr 28, 2018
Author Contributor

done

# 1) make dump to new place
# pg_dump mydb > db.sql
# 2) make dump to non default formate
# 2.5) Чтобы сформировать выгрузку в формате plain:

This comment has been minimized.

@funbringer

funbringer Feb 6, 2018
Collaborator

Russian comments is a big no-no.

@stalkerg
Copy link
Contributor

@stalkerg stalkerg commented Apr 11, 2018

I think we should drop this PR.

@funbringer
Copy link
Collaborator

@funbringer funbringer commented Apr 11, 2018

@stalkerg I believe we should give @Fenimorkin a chance to finish his work.

@stalkerg
Copy link
Contributor

@stalkerg stalkerg commented Apr 20, 2018

Can you ask him directly? Maybe he has no plans to finish that.

@codecov-io
Copy link

@codecov-io codecov-io commented Apr 28, 2018

Codecov Report

Merging #32 into master will decrease coverage by 0.16%.
The diff coverage is 91.42%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #32      +/-   ##
==========================================
- Coverage   97.17%   97.01%   -0.17%     
==========================================
  Files          16       16              
  Lines        1381     1405      +24     
==========================================
+ Hits         1342     1363      +21     
- Misses         39       42       +3
Impacted Files Coverage Δ
setup.py 0% <ø> (ø) ⬆️
testgres/enums.py 100% <100%> (ø) ⬆️
tests/test_simple.py 99.78% <100%> (ø) ⬆️
testgres/node.py 96.87% <84.21%> (-0.7%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e9d2a40...bb88d6e. Read the comment docs.

Fenimorkin added 6 commits Apr 29, 2018
@funbringer funbringer merged commit 221df4f into postgrespro:master May 8, 2018
0 of 3 checks passed
0 of 3 checks passed
codecov/patch 91.42% of diff hit (target 97.17%)
Details
codecov/project 97.01% (-0.17%) compared to e9d2a40
Details
continuous-integration/travis-ci/pr The Travis CI build is in progress
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

5 participants
You can’t perform that action at this time.