Support decoding of catalog tables.

Support decoding of 'name' and 'char' types. Also introduce '~'
pseudo-type which just ignores all data left in current tuple during
decoding. These two types allow easily to decode catalog tables and
restore schema of a database even if it's corrupted and PostgreSQL
instance is not starting.

For instance, pg_attribute can be decoded like this:

pg_filedump -D oid,name,oid,int,smallint,~ path/to/segment/1249

Aleksander Alekseev
This commit is contained in:
Teodor Sigaev
2017-03-01 15:08:09 +03:00
parent 52fa0201f9
commit 5c5ba458fa
3 changed files with 91 additions and 6 deletions

View File

@ -71,8 +71,36 @@ The following options are valid for heap and index files:
off all formatting options)
-d Display formatted block content dump (Option will turn off
all other formatting options)
-D Try to decode tuples using provided list of attribute types.
[attrlist] should be something like int,timestamp,bool,uuid
-D Try to decode tuples using given comma separated list of types.
List of supported types:
* bigint
* bigserial
* bool
* char
* charN -- char(n)
* date
* float
* float4
* float8
* int
* json
* macaddr
* name
* oid
* real
* serial
* smallint
* smallserial
* text
* time
* timestamp
* timetz
* uuid
* varchar
* varcharN -- varchar(n)
* xid
* xml
* ~ -- ignores are attributes left in a tuple
-f Display formatted block content dump along with interpretation
-h Display this information
-i Display interpreted item details