Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions binimporter/importer.go
Original file line number Diff line number Diff line change
Expand Up @@ -175,9 +175,9 @@ func (p *BinImporter) Close(ctx context.Context) error {
p.conn.Cleanup()
return nil
}
func (p *BinImporter) Root() string { return "/" }
func (p *BinImporter) Origin() string { return p.conn.Host }
func (p *BinImporter) Type() string { return "postgres+bin" }
func (p *BinImporter) Root() string { return "/" }
func (p *BinImporter) Origin() string { return p.conn.Host }
func (p *BinImporter) Type() string { return "postgres+bin" }

func (p *BinImporter) Flags() location.Flags {
// FLAG_STREAM: the tar stream is non-seekable and must be read sequentially.
Expand Down
26 changes: 13 additions & 13 deletions exporter/exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,19 @@ func init() {
}

type Exporter struct {
conn pgconn.ConnConfig
database string // target database; if empty, inferred from dump filename
databases map[string]struct{} // if non-empty, only restore dumps for these databases
noOwner bool // pass --no-owner to pg_restore
exitOnError bool // pass -e to pg_restore / ON_ERROR_STOP=1 to psql
clean bool // pass --clean --if-exists to pg_restore: drop objects before recreating
recreate bool // pass -C --clean --if-exists: drop the database and recreate it from archive metadata
schemaOnly bool // pass -s to pg_restore
dataOnly bool // pass -a to pg_restore
noGlobals bool // skip feeding 00000-globals.sql to psql
pgBinDir string // directory containing pg_restore, psql; empty means use $PATH
connType string // returned by Type()
TokenProvider func(context.Context) (string, error) // optional; refreshes conn.Password before each subprocess
conn pgconn.ConnConfig
database string // target database; if empty, inferred from dump filename
databases map[string]struct{} // if non-empty, only restore dumps for these databases
noOwner bool // pass --no-owner to pg_restore
exitOnError bool // pass -e to pg_restore / ON_ERROR_STOP=1 to psql
clean bool // pass --clean --if-exists to pg_restore: drop objects before recreating
recreate bool // pass -C --clean --if-exists: drop the database and recreate it from archive metadata
schemaOnly bool // pass -s to pg_restore
dataOnly bool // pass -a to pg_restore
noGlobals bool // skip feeding 00000-globals.sql to psql
pgBinDir string // directory containing pg_restore, psql; empty means use $PATH
connType string // returned by Type()
TokenProvider func(context.Context) (string, error) // optional; refreshes conn.Password before each subprocess
}

// bin returns the full path to a PostgreSQL binary.
Expand Down
20 changes: 10 additions & 10 deletions importer/importer.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ func init() {

type Importer struct {
conn pgconn.ConnConfig
database string // empty means back up all databases
excludeDatabases map[string]struct{} // databases to skip in a full backup
compress bool // enable pg_dump compression; off by default to avoid degrading Plakar's compression
schemaOnly bool // pass -s: dump schema only
dataOnly bool // pass -a: dump data only
pgBinDir string // directory containing pg_dump, pg_dumpall, psql; empty means use $PATH
connType string // returned by Type(); if empty, "postgresql" is used
database string // empty means back up all databases
excludeDatabases map[string]struct{} // databases to skip in a full backup
compress bool // enable pg_dump compression; off by default to avoid degrading Plakar's compression
schemaOnly bool // pass -s: dump schema only
dataOnly bool // pass -a: dump data only
pgBinDir string // directory containing pg_dump, pg_dumpall, psql; empty means use $PATH
connType string // returned by Type(); if empty, "postgresql" is used
TokenProvider func(context.Context) (string, error) // optional; refreshes conn.Password before each subprocess
}

Expand Down Expand Up @@ -353,9 +353,9 @@ func (p *Importer) Close(ctx context.Context) error {
p.conn.Cleanup()
return nil
}
func (p *Importer) Root() string { return "/" }
func (p *Importer) Origin() string { return p.conn.Host }
func (p *Importer) Type() string { return p.connType }
func (p *Importer) Root() string { return "/" }
func (p *Importer) Origin() string { return p.conn.Host }
func (p *Importer) Type() string { return p.connType }

// Flags returns FLAG_STREAM to signal that Import produces a single streaming
// pass. Without it, the framework calls Import twice — once to enumerate
Expand Down
14 changes: 7 additions & 7 deletions manifest/metadata.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,8 @@ type RelationInfo struct {
Schema string `json:"schema"`
Name string `json:"name"`
Owner string `json:"owner"`
Persistence string `json:"persistence"` // p=permanent, u=unlogged, t=temp
Kind string `json:"kind"` // see above
Persistence string `json:"persistence"` // p=permanent, u=unlogged, t=temp
Kind string `json:"kind"` // see above
Tablespace string `json:"tablespace,omitempty"`
RowEstimate int64 `json:"row_estimate"` // reltuples (fast, may be stale)
LiveRowEstimate int64 `json:"live_row_estimate"` // n_live_tup from autovacuum
Expand Down Expand Up @@ -505,12 +505,12 @@ ORDER BY n.nspname, c.relname`)
relIdx := make(map[string]int) // "schema.name" → position in info.Relations
for relRows.Next() {
var (
schema, name, owner, persistence, kind string
rowEst, liveRowEst int64
hasPK, hasTriggers, rlsEnabled, rlsForced bool
isPartition bool
schema, name, owner, persistence, kind string
rowEst, liveRowEst int64
hasPK, hasTriggers, rlsEnabled, rlsForced bool
isPartition bool
storageOpts, partParent, partStrategy, tablespace string
lastVacuumEpoch, lastAnalyzeEpoch int64
lastVacuumEpoch, lastAnalyzeEpoch int64
)
if err := relRows.Scan(
&schema, &name, &owner, &persistence, &kind,
Expand Down
1 change: 0 additions & 1 deletion pgconn/conn.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ func writeTempFile(label, content string) (string, error) {
return f.Name(), nil
}


// ConnConfig holds the connection parameters shared by all PostgreSQL connectors.
type ConnConfig struct {
Host string
Expand Down
Loading