pdf viewer dll for c# : Add picture to pdf reader control Library utility azure .net windows visual studio postgresql-9.4-A4174-part2806

pg_dump
Name
pg_dump—extractaPostgreSQLdatabaseintoascriptfileorotherarchivefile
Synopsis
pg_dump
[
connection-option
...][
option
...][
dbname
]
Description
pg_dump is a utility forbackingup a PostgreSQL database.Itmakes consistent backups even if
thedatabaseisbeingusedconcurrently.pg_dumpdoesnotblockotherusersaccessingthedatabase
(readersorwriters).
Dumpscanbeoutputinscriptorarchivefileformats.Scriptdumpsareplain-textfilescontainingthe
SQL commands requiredtoreconstructthedatabasetothestateit wasinatthetimeitwas saved.
Torestorefromsuchascript,feedittopsql.Scriptfilescanbeusedtoreconstructthedatabaseeven
on other machines and otherarchitectures; withsome modifications, even onotherSQL database
products.
Thealternativearchivefileformatsmustbeusedwithpg_restoretorebuildthedatabase.Theyallow
pg_restoretobeselectiveaboutwhatisrestored,oreventoreordertheitemspriortobeingrestored.
Thearchivefileformatsaredesignedtobeportableacrossarchitectures.
Whenusedwithoneofthearchivefileformatsandcombinedwithpg_restore,pg_dumpprovidesa
flexiblearchivaland transfermechanism.pg_dumpcanbeusedtobackupanentire database,then
pg_restorecanbe used to examine the archiveand/orselect whichparts ofthedatabase are to be
restored.Themostflexibleoutputfileformatsarethe“custom”format(
-Fc
)andthe“directory”for-
mat(
-Fd
).Theyallowforselectionandreorderingofallarchiveditems,supportparallelrestoration,
andarecompressedbydefault.The“directory”formatistheonlyformatthatsupportsparalleldumps.
Whilerunningpg_dump,oneshouldexaminetheoutputforanywarnings(printedonstandarderror),
especiallyinlightofthelimitationslistedbelow.
Options
Thefollowingcommand-lineoptionscontrolthecontentandformatoftheoutput.
dbname
Specifiesthenameofthedatabasetobedumped.Ifthisisnotspecified,theenvironmentvariable
PGDATABASE
isused.Ifthatisnotset,theusernamespecifiedfortheconnectionisused.
-a
--data-only
Dumponlythedata,nottheschema(datadefinitions).Tabledata,largeobjects,andsequence
valuesaredumped.
Thisoptionissimilarto,butforhistoricalreasonsnotidenticalto,specifying
--section=data
.
1668
Add picture to pdf reader - insert images into PDF in C#.net, ASP.NET, MVC, Ajax, WinForms, WPF
Sample C# code to add image, picture, logo or digital photo into PDF document page using PDF page editor control
how to add picture to pdf; add jpg to pdf document
Add picture to pdf reader - VB.NET PDF insert image library: insert images into PDF in vb.net, ASP.NET, MVC, Ajax, WinForms, WPF
Guide VB.NET Programmers How to Add Images in PDF Document
add picture to pdf document; how to add an image to a pdf file in acrobat
pg_dump
-b
--blobs
Includelargeobjectsinthedump.Thisisthedefaultbehaviorexceptwhen
--schema
,
--table
,
or
--schema-only
isspecified,sothe
-b
switchisonlyusefultoaddlargeobjectstoselective
dumps.
-c
--clean
Outputcommandstoclean(drop)databaseobjectspriortooutputtingthecommandsforcreat-
ingthem.(Unless
--if-exists
isalsospecified,restoremightgeneratesomeharmlesserror
messages,ifanyobjectswerenotpresentinthedestinationdatabase.)
Thisoptionisonlymeaningfulfortheplain-textformat.Forthearchiveformats,youcanspecify
theoptionwhenyoucall
pg_restore
.
-C
--create
Begin the output with a command to create the database itselfand reconnect to the created
database.(Withascriptofthisform,itdoesn’tmatterwhichdatabaseinthedestinationinstalla-
tionyouconnecttobeforerunningthescript.)If
--clean
isalsospecified,thescriptdropsand
recreatesthetargetdatabasebeforereconnectingtoit.
Thisoptionisonlymeaningfulfortheplain-textformat.Forthearchiveformats,youcanspecify
theoptionwhenyoucall
pg_restore
.
-E
encoding
--encoding=
encoding
Create the dump in the specified character set encoding. By default, the dump is created in
the database encoding.(Anotherwaytogetthesameresultistosetthe
PGCLIENTENCODING
environmentvariabletothedesireddumpencoding.)
-f
file
--file=
file
Sendoutputtothespecifiedfile.Thisparametercanbeomittedforfilebasedoutputformats,in
whichcasethestandardoutputisused.Itmustbegivenforthedirectoryoutputformathowever,
whereitspecifies the targetdirectoryinsteadofafile.Inthis casethedirectory is createdby
pg_dump
andmustnotexistbefore.
-F
format
--format=
format
Selectstheformatoftheoutput.
format
canbeoneofthefollowing:
p
plain
Outputaplain-textSQLscriptfile(thedefault).
c
custom
Outputacustom-formatarchivesuitableforinputintopg_restore.Togetherwiththedirec-
toryoutputformat,thisisthemostflexibleoutputformatinthatitallowsmanualselection
andreorderingofarchiveditemsduringrestore.Thisformatisalsocompressedbydefault.
1669
C# TIFF: How to Insert & Burn Picture/Image into TIFF Document
Support adding image or picture to an existing or new new REImage(@"c:\ logo.png"); // add the image powerful & profession imaging controls, PDF document, tiff
add an image to a pdf with acrobat; add picture to pdf form
VB.NET Image: Image Cropping SDK to Cut Out Image, Picture and
VB.NET image cropper control SDK; VB.NET image cropping method to crop picture / photo; you can adjust the size of created cropped image file, add antique effect
add jpg to pdf acrobat; add a jpeg to a pdf
pg_dump
d
directory
Outputadirectory-formatarchivesuitableforinputintopg_restore.Thiswillcreateadirec-
torywithonefileforeachtableandblobbeingdumped,plusaso-calledTableofContents
filedescribingthedumpedobjectsinamachine-readableformatthatpg_restorecanread.A
directoryformatarchivecanbemanipulatedwithstandardUnixtools;forexample,filesin
anuncompressedarchivecanbecompressedwiththegziptool.Thisformatiscompressed
bydefaultandalsosupportsparalleldumps.
t
tar
Outputa
tar
-formatarchivesuitableforinputintopg_restore.Thetarformatiscompatible
withthedirectoryformat:extractingatar-formatarchiveproducesavaliddirectory-format
archive.However,thetarformatdoesnotsupportcompression.Also,whenusingtarformat
therelativeorderoftabledataitemscannotbechangedduringrestore.
-i
--ignore-version
Adeprecatedoptionthatisnowignored.
-j
njobs
--jobs=
njobs
Runthedumpinparallelbydumping
njobs
tablessimultaneously.Thisoptionreducesthetime
ofthedumpbutitalsoincreasestheloadonthedatabaseserver.Youcanonlyusethisoption
withthedirectoryoutputformatbecausethisistheonlyoutputformatwheremultipleprocesses
canwritetheirdataatthesametime.
pg_dumpwillopen
njobs
+1connectionstothedatabase,somakesureyourmax_connections
settingishighenoughtoaccommodateallconnections.
Requestingexclusivelocksondatabaseobjectswhilerunningaparalleldumpcouldcausethe
dumptofail.Thereasonisthatthepg_dumpmasterprocessrequestssharedlocksontheobjects
that the workerprocesses are goingtodumplaterinordertomake sure thatnobodydeletes
themandmakes themgoawaywhile the dumpis running.Ifanother client thenrequests an
exclusivelockonatable,thatlockwillnotbegrantedbutwillbequeuedwaitingfortheshared
lockofthemasterprocesstobereleased.Consequentlyanyotheraccesstothetablewillnotbe
grantedeitherandwillqueueaftertheexclusivelockrequest.Thisincludestheworkerprocess
tryingtodumpthetable.Withoutanyprecautionsthiswouldbeaclassicdeadlocksituation.To
detectthisconflict,thepg_dumpworkerprocessrequestsanothersharedlockusingthe
NOWAIT
option.Iftheworkerprocessisnotgrantedthissharedlock,somebodyelsemusthaverequested
anexclusivelockinthemeantimeandthereisnowaytocontinuewiththedump,sopg_dump
hasnochoicebuttoabortthedump.
Foraconsistentbackup,thedatabaseserverneedstosupportsynchronizedsnapshots,afeature
thatwasintroducedinPostgreSQL9.2.Withthisfeature,databaseclientscanensuretheyseethe
samedataseteventhoughtheyusedifferentconnections.
pg_dump -j
usesmultipledatabase
connections;itconnects tothedatabaseoncewiththemasterprocess andonceagainforeach
workerjob.Without thesynchronizedsnapshot feature,thedifferentworkerjobswouldn’t be
guaranteedtoseethesamedataineachconnection,whichcouldleadtoaninconsistentbackup.
Ifyouwanttorunaparalleldumpofapre-9.2server,youneedtomakesurethatthedatabase
contentdoesn’tchangefrombetweenthetimethemasterconnectstothedatabaseuntilthelast
workerjobhasconnectedtothedatabase.Theeasiestwaytodothisistohaltanydatamodifying
1670
VB.NET Image: VB.NET Codes to Add Antique Effect to Image with .
mature technology to replace a picture's original colors add the glow and noise, and add a little powerful & profession imaging controls, PDF document, image
how to add an image to a pdf file; how to add an image to a pdf
VB.NET TIFF: How to Draw Picture & Write Text on TIFF Document in
drawing As RaterEdgeDrawing = New RaterEdgeDrawing() drawing.Picture = "RasterEdge" drawing provide powerful & profession imaging controls, PDF document, tiff
add image to pdf java; add picture to pdf reader
pg_dump
processes(DDLandDML)accessingthedatabasebeforestartingthebackup.Youalsoneedto
specifythe
--no-synchronized-snapshots
parameterwhenrunning
pg_dump -j
against
apre-9.2PostgreSQLserver.
-n
schema
--schema=
schema
Dumponlyschemasmatching
schema
;thisselectsboththeschemaitself,andallitscontained
objects.Whenthisoptionisnotspecified,allnon-systemschemasinthetargetdatabasewillbe
dumped.Multipleschemascanbeselectedbywritingmultiple
-n
switches.Also,the
schema
parameterisinterpretedasapatternaccordingtothesamerules usedbypsql’s
\d
commands
(see Patterns),somultiple schemas canalsobe selectedbywritingwildcardcharactersinthe
pattern.Whenusingwildcards,becarefultoquotethepatternifneededtopreventtheshellfrom
expandingthewildcards;seeExamples.
Note:When
-n
isspecified,pg_dumpmakesnoattempttodumpanyotherdatabaseobjects
thattheselectedschema(s)mightdependupon.Therefore,thereisnoguaranteethatthe
resultsofaspecific-schemadumpcanbesuccessfullyrestoredbythemselvesintoaclean
database.
Note:Non-schemaobjectssuchasblobsarenotdumpedwhen
-n
isspecified.Youcanadd
blobsbacktothedumpwiththe
--blobs
switch.
-N
schema
--exclude-schema=
schema
Donotdumpanyschemasmatchingthe
schema
pattern.Thepatternisinterpretedaccordingto
thesamerulesasfor
-n
.
-N
canbegivenmorethanoncetoexcludeschemasmatchinganyof
severalpatterns.
Whenboth
-n
and
-N
aregiven,thebehavioristodumpjusttheschemasthatmatchatleastone
-n
switchbutno
-N
switches.If
-N
appearswithout
-n
,thenschemasmatching
-N
areexcluded
fromwhatisotherwiseanormaldump.
-o
--oids
Dumpobjectidentifiers(OIDs)aspartofthedataforeverytable.Usethisoptionifyourappli-
cationreferencestheOIDcolumns insomeway(e.g.,inaforeignkeyconstraint).Otherwise,
thisoptionshouldnotbeused.
-O
--no-owner
Donotoutputcommandstosetownershipofobjectstomatchtheoriginaldatabase.Bydefault,
pg_dumpissues
ALTER OWNER
or
SET SESSION AUTHORIZATION
statementstosetownership
ofcreateddatabaseobjects.Thesestatementswillfailwhenthescriptisrununlessitisstarted
byasuperuser(orthesameuserthatownsalloftheobjectsinthescript).Tomakeascriptthat
canberestoredbyanyuser,butwillgivethatuserownershipofalltheobjects,specify
-O
.
Thisoptionisonlymeaningfulfortheplain-textformat.Forthearchiveformats,youcanspecify
theoptionwhenyoucall
pg_restore
.
1671
VB.NET Image: Image Scaling SDK to Scale Picture / Photo
Framework application; VB.NET sample code for how to scale image / picture; Frequently asked questions about RasterEdge VB.NET image scaling control SDK add-on.
add image in pdf using java; add image to pdf acrobat reader
VB.NET Image: Image Resizer Control SDK to Resize Picture & Photo
NET Method to Resize Image & Picture. Here we this VB.NET image resizer control add-on, can provide powerful & profession imaging controls, PDF document, image
add image to pdf reader; adding an image to a pdf file
pg_dump
-R
--no-reconnect
Thisoptionisobsoletebutstillacceptedforbackwardscompatibility.
-s
--schema-only
Dumponlytheobjectdefinitions(schema),notdata.
Thisoptionistheinverseof
--data-only
.Itissimilarto,butforhistoricalreasonsnotidentical
to,specifying
--section=pre-data --section=post-data
.
(Donotconfusethiswiththe
--schema
option,whichuses theword“schema”ina different
meaning.)
Toexcludetabledataforonlyasubsetoftablesinthedatabase,see
--exclude-table-data
.
-S
username
--superuser=
username
Specify the superuser user name to use when disabling triggers. This is relevant only if
--disable-triggers
is used. (Usually, it’s better to leave this out, and instead start the
resultingscriptassuperuser.)
-t
table
--table=
table
Dumponlytables (orviews orsequences orforeigntables)matching
table
.Multipletables
canbeselected by writing multiple
-t
switches.Also,the
table
parameteris interpretedas
apatternaccordingtothesamerules usedbypsql’s
\d
commands(see Patterns),somultiple
tablescanalsobeselectedbywritingwildcardcharactersinthepattern.Whenusingwildcards,
becarefultoquotethepatternifneededtopreventtheshellfromexpandingthewildcards;see
Examples.
The
-n
and
-N
switcheshavenoeffectwhen
-t
isused,becausetablesselectedby
-t
willbe
dumpedregardlessofthoseswitches,andnon-tableobjectswillnotbedumped.
Note:When
-t
isspecified,pg_dumpmakesnoattempttodumpanyotherdatabaseobjects
that the selectedtable(s) might depend upon.Therefore,there is no guarantee thatthe
results ofa specific-tabledumpcanbe successfully restored by themselves into a clean
database.
Note: Thebehavior ofthe
-t
switchisnotentirely upward compatiblewithpre-8.2 Post-
greSQLversions.Formerly,writing
-t tab
woulddumpalltablesnamed
tab
,butnowitjust
dumpswhicheveroneisvisibleinyourdefaultsearchpath.Togettheoldbehavioryoucan
write
-t ’
*
.tab’
.Also,you mustwritesomethinglike
-t sch.tab
to selectatableina
particularschema,ratherthantheoldlocutionof
-n sch -t tab
.
-T
table
--exclude-table=
table
Donotdumpanytablesmatchingthe
table
pattern.Thepatternisinterpretedaccordingtothe
samerulesasfor
-t
.
-T
canbegivenmorethanoncetoexcludetablesmatchinganyofseveral
patterns.
1672
VB.NET Image: Create Code 11 Barcode on Picture & Document Using
file, apart from above mentioned .NET core imaging SDK and .NET barcode creator add-on, you also need to buy .NET PDF document editor add-on, namely, RasterEdge
add png to pdf preview; how to add image to pdf in preview
C# Word - Paragraph Processing in C#.NET
Add references: C# users can set paragraph properties and create content such as run, footnote, endnote and picture in a paragraph.
add picture to pdf file; adding image to pdf file
pg_dump
Whenboth
-t
and
-T
aregiven,thebehavioristodumpjustthetablesthatmatchatleastone
-t
switchbutno
-T
switches.If
-T
appearswithout
-t
,thentables matching
-T
areexcluded
fromwhatisotherwiseanormaldump.
-v
--verbose
Specifies verbose mode. This will cause pg_dump to output detailed object comments and
start/stoptimestothedumpfile,andprogressmessagestostandarderror.
-V
--version
Printthepg_dumpversionandexit.
-x
--no-privileges
--no-acl
Preventdumpingofaccessprivileges(grant/revokecommands).
-Z
0..9
--compress=
0..9
Specifythecompressionleveltouse.Zeromeansnocompression.Forthecustomarchiveformat,
thisspecifiescompressionofindividualtable-datasegments,andthedefaultistocompressata
moderatelevel.Forplaintextoutput,settinganonzerocompressionlevelcausestheentireoutput
filetobecompressed,asthoughithadbeenfedthroughgzip;butthedefaultisnottocompress.
Thetararchiveformatcurrentlydoesnotsupportcompressionatall.
--binary-upgrade
Thisoptionisforusebyin-placeupgradeutilities.Itsuseforotherpurposesisnotrecommended
orsupported.Thebehavioroftheoptionmaychangeinfuturereleaseswithoutnotice.
--column-inserts
--attribute-inserts
Dump data as
INSERT
commands with explicit column names (
INSERT INTO
table
(
column
, ...) VALUES ...
).Thiswill make restorationveryslow; it is mainly useful for
makingdumps thatcanbeloadedintonon-PostgreSQLdatabases.However,since thisoption
generatesaseparatecommandforeachrow,anerrorinreloadingarowcausesonlythatrowto
belostratherthantheentiretablecontents.
--disable-dollar-quoting
Thisoptiondisablestheuseofdollarquotingforfunctionbodies,andforcesthemtobequoted
usingSQLstandardstringsyntax.
--disable-triggers
This option is relevant only whencreatinga data-onlydump.Itinstructspg_dumptoinclude
commandstotemporarilydisabletriggersonthetargettableswhilethedataisreloaded.Usethis
ifyouhavereferentialintegritychecks orothertriggers onthetables thatyou donotwantto
invokeduringdatareload.
Presently,the commands emitted for
--disable-triggers
must be done as superuser.So,
youshouldalsospecifyasuperusernamewith
-S
,orpreferablybecarefultostarttheresulting
scriptasasuperuser.
Thisoptionisonlymeaningfulfortheplain-textformat.Forthearchiveformats,youcanspecify
theoptionwhenyoucall
pg_restore
.
1673
pg_dump
--exclude-table-data=
table
Donotdumpdataforanytablesmatchingthe
table
pattern.Thepatternisinterpretedaccording
tothesamerulesasfor
-t
.
--exclude-table-data
canbegivenmorethanoncetoexclude
tablesmatchinganyofseveralpatterns.Thisoptionisusefulwhenyouneedthedefinitionofa
particulartableeventhoughyoudonotneedthedatainit.
Toexcludedataforalltablesinthedatabase,see
--schema-only
.
--if-exists
Useconditionalcommands(i.e.addan
IF EXISTS
clause)whencleaningdatabaseobjects.This
optionisnotvalidunless
--clean
isalsospecified.
--inserts
Dumpdataas
INSERT
commands(ratherthan
COPY
).Thiswillmakerestorationveryslow;itis
mainlyusefulformakingdumpsthatcanbeloadedintonon-PostgreSQLdatabases.However,
sincethisoptiongeneratesaseparatecommandforeachrow,anerrorinreloadingarowcauses
onlythatrowto be lostratherthan the entire table contents.Note that the restore might fail
altogetherifyouhaverearrangedcolumnorder.The
--column-inserts
optionissafeagainst
columnorderchanges,thoughevenslower.
--lock-wait-timeout=
timeout
Donotwaitforevertoacquiresharedtablelocks atthebeginningofthedump.Insteadfailif
unabletolockatablewithinthespecified
timeout
.Thetimeoutmaybespecifiedinanyofthe
formatsacceptedby
SET statement_timeout
.(Allowedvaluesvarydependingontheserver
versionyouaredumpingfrom,butanintegernumberofmillisecondsisacceptedbyallversions
since7.3.Thisoptionisignoredwhendumpingfromapre-7.3server.)
--no-security-labels
Donotdumpsecuritylabels.
--no-synchronized-snapshots
Thisoptionallowsrunning
pg_dump -j
againstapre-9.2server,seethedocumentationofthe
-j
parameterformoredetails.
--no-tablespaces
Donotoutputcommands toselecttablespaces.Withthisoption,allobjectswillbecreatedin
whichevertablespaceisthedefaultduringrestore.
Thisoptionisonlymeaningfulfortheplain-textformat.Forthearchiveformats,youcanspecify
theoptionwhenyoucall
pg_restore
.
--no-unlogged-table-data
Donotdumpthecontentsofunloggedtables.Thisoptionhasnoeffectonwhetherornotthetable
definitions(schema)aredumped;itonlysuppressesdumpingthetabledata.Datainunlogged
tablesisalwaysexcludedwhendumpingfromastandbyserver.
--quote-all-identifiers
Forcequotingofallidentifiers.Thismaybeusefulwhendumpingadatabaseformigrationtoa
futureversionthatmayhaveintroducedadditionalkeywords.
--section=
sectionname
Onlydumpthenamedsection.Thesectionnamecanbe
pre-data
,
data
,or
post-data
.This
optioncanbespecifiedmorethanoncetoselectmultiplesections.Thedefaultistodumpall
sections.
1674
pg_dump
Thedatasectioncontainsactualtabledata,large-objectcontents,andsequencevalues.Post-data
itemsincludedefinitions ofindexes,triggers,rules,andconstraints otherthanvalidatedcheck
constraints.Pre-dataitemsincludeallotherdatadefinitionitems.
--serializable-deferrable
Usea
serializable
transactionforthedump,toensurethatthesnapshotusedisconsistent
withlaterdatabasestates;butdothisbywaitingforapointinthetransactionstreamatwhich
noanomaliescanbepresent,sothatthereisn’tariskofthedumpfailingorcausingothertrans-
actions torollback with a
serialization_failure
.SeeChapter13 formoreinformation
abouttransactionisolationandconcurrencycontrol.
This optionisnotbeneficialforadumpwhichisintendedonlyfordisasterrecovery.Itcould
beusefulforadumpusedtoloadacopyofthedatabaseforreportingorotherread-onlyload
sharingwhiletheoriginaldatabasecontinuestobeupdated.Withoutitthedumpmayreflecta
statewhichisnotconsistentwithanyserialexecutionofthetransactionseventuallycommitted.
Forexample,ifbatchprocessingtechniquesareused,abatchmayshowasclosedinthedump
withoutalloftheitemswhichareinthebatchappearing.
Thisoptionwillmakenodifferenceiftherearenoread-writetransactionsactivewhenpg_dump
is started. If read-write transactions are active,the start of the dump may be delayed for an
indeterminatelengthoftime.Oncerunning,performancewithorwithouttheswitchisthesame.
--use-set-session-authorization
Output SQL-standard
SET SESSION AUTHORIZATION
commands instead of
ALTER OWNER
commands to determine object ownership.This makes the dump more standards-compatible,
but depending onthehistoryofthe objects in the dump,mightnotrestore properly.Also,a
dumpusing
SET SESSION AUTHORIZATION
willcertainlyrequire superuserprivileges tore-
storecorrectly,whereas
ALTER OWNER
requireslesserprivileges.
-?
--help
Showhelpaboutpg_dumpcommandlinearguments,andexit.
Thefollowingcommand-lineoptionscontrolthedatabaseconnectionparameters.
-d
dbname
--dbname=
dbname
Specifiesthenameofthedatabasetoconnectto.Thisisequivalenttospecifying
dbname
asthe
firstnon-optionargumentonthecommandline.
If this parameter contains an
=
sign or starts with a valid URI prefix (
postgresql://
or
postgres://
),itistreatedasa
conninfo
string.SeeSection31.1formoreinformation.
-h
host
--host=
host
Specifiesthehostnameofthemachineonwhichtheserverisrunning.Ifthevaluebeginswith
aslash,itis usedas the directoryforthe Unixdomain socket.The defaultis takenfromthe
PGHOST
environmentvariable,ifset,elseaUnixdomainsocketconnectionisattempted.
-p
port
--port=
port
SpecifiestheTCPportorlocalUnixdomainsocketfileextensiononwhichtheserverislistening
forconnections.Defaultstothe
PGPORT
environmentvariable,ifset,oracompiled-indefault.
1675
pg_dump
-U
username
--username=
username
Usernametoconnectas.
-w
--no-password
Neverissueapasswordprompt.Iftheserverrequires passwordauthenticationandapassword
isnot availablebyothermeans suchasa
.pgpass
file,theconnectionattemptwillfail.This
optioncanbeusefulinbatchjobsandscriptswherenouserispresenttoenterapassword.
-W
--password
Forcepg_dumptopromptforapasswordbeforeconnectingtoadatabase.
This optionisneveressential,sincepg_dumpwillautomaticallypromptforapasswordifthe
serverdemands passwordauthentication.However,pg_dumpwillwasteaconnectionattempt
findingoutthattheserverwants apassword.Insomecases itis worthtyping
-W
toavoidthe
extraconnectionattempt.
--role=
rolename
Specifiesarolenametobeusedtocreatethedump.Thisoptioncausespg_dumptoissuea
SET
ROLErolename
commandafterconnectingtothedatabase.Itisusefulwhentheauthenticated
user(specifiedby
-U
)lacks privilegesneeded bypg_dump,butcanswitchtoarole withthe
requiredrights.Someinstallationshaveapolicyagainstloggingindirectlyas asuperuser,and
useofthisoptionallowsdumpstobemadewithoutviolatingthepolicy.
Environment
PGDATABASE
PGHOST
PGOPTIONS
PGPORT
PGUSER
Defaultconnectionparameters.
Thisutility,likemostotherPostgreSQLutilities,alsouses theenvironmentvariablessupportedby
libpq(seeSection31.14).
Diagnostics
pg_dumpinternallyexecutes
SELECT
statements.Ifyouhaveproblemsrunningpg_dump,makesure
youareabletoselectinformationfromthedatabaseusing,forexample,psql.Also,anydefaultcon-
nectionsettingsandenvironmentvariablesusedbythelibpqfront-endlibrarywillapply.
Thedatabaseactivityofpg_dumpisnormallycollectedbythestatisticscollector.Ifthisisundesirable,
youcansetparameter
track_counts
tofalsevia
PGOPTIONS
orthe
ALTER USER
command.
1676
pg_dump
Notes
Ifyourdatabaseclusterhasanylocaladditionstothe
template1
database,becarefultorestorethe
outputofpg_dumpintoatrulyemptydatabase;otherwiseyouarelikelytogeterrorsduetoduplicate
definitionsoftheaddedobjects.Tomakeanemptydatabasewithoutanylocaladditions,copyfrom
template0
not
template1
,forexample:
CREATE DATABASE foo WITH TEMPLATE template0;
When adata-only dumpis chosenand theoption
--disable-triggers
is used,pg_dumpemits
commandstodisabletriggersonusertablesbeforeinsertingthedata,andthencommandstore-enable
themafterthedatahasbeeninserted.Iftherestoreisstoppedinthemiddle,thesystemcatalogsmight
beleftinthewrongstate.
Thedumpfileproducedbypg_dumpdoes notcontainthestatistics usedbythe optimizertomake
queryplanningdecisions.Therefore,itiswisetorun
ANALYZE
afterrestoringfroma dumpfile to
ensureoptimalperformance;seeSection23.1.3andSection23.1.6formoreinformation.Thedump
filealsodoesnotcontainany
ALTER DATABASE ... SET
commands;thesesettingsaredumpedby
pg_dumpall,alongwithdatabaseusersandotherinstallation-widesettings.
Becausepg_dumpisusedtotransferdatatonewerversionsofPostgreSQL,theoutputofpg_dump
canbeexpectedtoloadintoPostgreSQLserverversionsnewerthanpg_dump’sversion.pg_dumpcan
alsodumpfromPostgreSQLserversolderthanitsownversion.(Currently,serversbacktoversion7.0
aresupported.)However,pg_dumpcannotdumpfromPostgreSQLserversnewerthanitsownmajor
version;itwillrefusetoeventry,ratherthanriskmakinganinvaliddump.Also,itisnotguaranteed
thatpg_dump’soutputcanbeloadedintoaserverofanoldermajorversion—notevenifthedump
wastakenfromaserverofthatversion.Loadingadumpfileintoanolderservermayrequiremanual
editingofthedumpfiletoremovesyntaxnotunderstoodbytheolderserver.
Examples
Todumpadatabasecalled
mydb
intoaSQL-scriptfile:
$ pg_dump mydb > db.sql
Toreloadsuchascriptintoa(freshlycreated)databasenamed
newdb
:
$ psql -d newdb -f db.sql
Todumpadatabaseintoacustom-formatarchivefile:
$ pg_dump -Fc mydb > db.dump
Todumpadatabaseintoadirectory-formatarchive:
$ pg_dump -Fd mydb -f dumpdir
Todumpadatabaseintoadirectory-formatarchiveinparallelwith5workerjobs:
1677
Documents you may be interested
Documents you may be interested