Skip to content

adding key -F to pg_dump #32

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

Merged
merged 13 commits into from
May 8, 2018
Merged

Conversation

Fenimorkin
Copy link
Contributor

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 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 commented Feb 6, 2018

Tests should be based on unittest library.

testgres/node.py Outdated
@@ -583,8 +583,8 @@ def cleanup(self, max_attempts=3):
def psql(self,
dbname,
query=None,
filename=None,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Arguments should not be moved around.

testgres/node.py Outdated
@@ -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):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

testgres/node.py Outdated

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

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Russian comments is a big no-no.

@stalkerg
Copy link
Contributor

I think we should drop this PR.

@funbringer
Copy link
Collaborator

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

@stalkerg
Copy link
Contributor

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

@codecov-io
Copy link

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.

@funbringer funbringer merged commit 221df4f into postgrespro:master May 8, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants