pgdump-metadata-extractor

command module
v1.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 4, 2021 License: MIT Imports: 5 Imported by: 0

README

pgdump-metadata-extractor

lint test

What is this?

This is a small tool to extract some metadata from pg_dump generated dumps of PostgreSQL databases, and present it as JSON.

It does not include the TOC.

Why is this needed?

Sometimes it's handy to have a structured representation of them metadata of a dump.

How can I use it?

This works best as a static binary:

$ make build
$ ./bin/pgdump-metadata-extractor --help
Usage of bin/pgdump-metadata-extractor:
  -filename string
    	dump to read metadata of
  -stdin
    	configure to read from stdin

Then you run it with:

$ ./bin/pgdump-metadata-extractor --filename latest.dump
{"magic":"PGDMP","vmain":1,"vmin":13,"vrev":0,"intsize":4,"offsize":8,"format":"CUSTOM","compression":-1,"timeSec":21,"timeMin":21,"timeHour":17,"timeDay":3,"timeMonth":6,"timeYear":2021,"timeIsDst":1,"database":"bigdb","remoteVersion":"10.11","pgDumpVersion":"10.11","toccount":15}

or

$ ./bin/pgdump-metadata-extractor --stdin < latest.dump
{"magic":"PGDMP","vmain":1,"vmin":13,"vrev":0,"intsize":4,"offsize":8,"format":"CUSTOM","compression":-1,"timeSec":21,"timeMin":21,"timeHour":17,"timeDay":3,"timeMonth":6,"timeYear":2021,"timeIsDst":1,"database":"bigdb","remoteVersion":"10.11","pgDumpVersion":"10.11","toccount":15}

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL