pdf viewer dll for c# : Add jpg to pdf online SDK application API .net azure web page sharepoint postgresql-9.4-A4147-part2776

CREATE TABLE
Name
CREATE TABLE—defineanewtable
Synopsis
CREATE [ [ GLOBAL | LOCAL ] { TEMPORARY | TEMP } | UNLOGGED ] TABLE [ IF NOT EXISTS ]
table_name
{
column_name data_type
[ COLLATE
collation
] [
column_constraint
[ ... ] ]
|
table_constraint
| LIKE
source_table
[
like_option
... ] }
[, ... ]
] )
[ INHERITS (
parent_table
[, ... ] ) ]
[ WITH (
storage_parameter
[=
value
] [, ... ] ) | WITH OIDS | WITHOUT OIDS ]
[ ON COMMIT { PRESERVE ROWS | DELETE ROWS | DROP } ]
[ TABLESPACE
tablespace_name
]
CREATE [ [ GLOBAL | LOCAL ] { TEMPORARY | TEMP } | UNLOGGED ] TABLE [ IF NOT EXISTS ]
table_name
OF
type_name
[ (
{
column_name
WITH OPTIONS [
column_constraint
[ ... ] ]
|
table_constraint
}
[, ... ]
) ]
[ WITH (
storage_parameter
[=
value
] [, ... ] ) | WITH OIDS | WITHOUT OIDS ]
[ ON COMMIT { PRESERVE ROWS | DELETE ROWS | DROP } ]
[ TABLESPACE
tablespace_name
]
where
column_constraint
is:
[ CONSTRAINT
constraint_name
]
{ NOT NULL |
NULL |
CHECK (
expression
) [ NO INHERIT ] |
DEFAULT
default_expr
|
UNIQUE
index_parameters
|
PRIMARY KEY
index_parameters
|
REFERENCES
reftable
[ (
refcolumn
) ] [ MATCH FULL | MATCH PARTIAL | MATCH SIMPLE ]
[ ON DELETE
action
] [ ON UPDATE
action
] }
[ DEFERRABLE | NOT DEFERRABLE ] [ INITIALLY DEFERRED | INITIALLY IMMEDIATE ]
and
table_constraint
is:
[ CONSTRAINT
constraint_name
]
{ CHECK (
expression
) [ NO INHERIT ] |
UNIQUE (
column_name
[, ... ] )
index_parameters
|
PRIMARY KEY (
column_name
[, ... ] )
index_parameters
|
EXCLUDE [ USING
index_method
] (
exclude_element
WITH
operator
[, ... ] )
index_parameters
FOREIGN KEY (
column_name
[, ... ] ) REFERENCES
reftable
[ (
refcolumn
[, ... ] ) ]
[ MATCH FULL | MATCH PARTIAL | MATCH SIMPLE ] [ ON DELETE
action
] [ ON UPDATE
action
[ DEFERRABLE | NOT DEFERRABLE ] [ INITIALLY DEFERRED | INITIALLY IMMEDIATE ]
and
like_option
is:
1398
Add jpg to pdf online - 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
add image field to pdf form; add image to pdf in preview
Add jpg to pdf online - 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 reader; how to add image to pdf document
CREATETABLE
{ INCLUDING | EXCLUDING } { DEFAULTS | CONSTRAINTS | INDEXES | STORAGE | COMMENTS | ALL }
index_parameters
in
UNIQUE
,
PRIMARY KEY
, and
EXCLUDE
constraints are:
[ WITH (
storage_parameter
[=
value
] [, ... ] ) ]
[ USING INDEX TABLESPACE
tablespace_name
]
exclude_element
in an
EXCLUDE
constraint is:
{
column_name
| (
expression
) } [
opclass
] [ ASC | DESC ] [ NULLS { FIRST | LAST } ]
Description
CREATE TABLE
will create anew, initially empty table in the current database. The table will be
ownedbytheuserissuingthecommand.
Ifaschemanameisgiven(forexample,
CREATE TABLE myschema.mytable ...
)thenthetable
is createdinthe specifiedschema.Otherwiseitis createdinthecurrentschema.Temporarytables
existinaspecialschema,soaschemanamecannotbegivenwhencreatingatemporarytable.The
nameofthetablemustbedistinctfromthenameofanyothertable,sequence,index,view,orforeign
tableinthesameschema.
CREATE TABLE
alsoautomaticallycreatesadatatypethatrepresentsthecompositetypecorrespond-
ingtoonerowofthetable.Therefore,tablescannothavethesamenameasanyexistingdatatypein
thesameschema.
Theoptionalconstraintclausesspecifyconstraints(tests)thatneworupdatedrowsmustsatisfyforan
insertorupdateoperationtosucceed.AconstraintisanSQLobjectthathelpsdefinethesetofvalid
valuesinthetableinvariousways.
There aretwo ways todefine constraints:tableconstraintsandcolumnconstraints.Acolumncon-
straintisdefinedaspartofacolumndefinition.Atableconstraintdefinitionisnottiedtoaparticular
column,anditcanencompassmorethanonecolumn.Everycolumnconstraintcanalsobewrittenas
atableconstraint;acolumnconstraintisonlyanotationalconvenienceforusewhentheconstraint
onlyaffectsonecolumn.
Tobeabletocreateatable,youmusthave
USAGE
privilegeonallcolumntypesorthetypeinthe
OF
clause,respectively.
Parameters
TEMPORARY
or
TEMP
Ifspecified,thetableiscreatedasatemporarytable.Temporarytablesareautomaticallydropped
attheendofasession,oroptionallyattheendofthecurrenttransaction(see
ON COMMIT
below).
Existingpermanenttableswiththesamename arenotvisibletothecurrentsessionwhilethe
temporarytable exists,unless they are referencedwith schema-qualifiednames.Any indexes
createdonatemporarytableareautomaticallytemporaryaswell.
Theautovacuumdaemoncannotaccessandthereforecannotvacuumoranalyzetemporaryta-
bles.Forthisreason,appropriatevacuumandanalyzeoperationsshouldbeperformedviasession
SQLcommands.Forexample,ifatemporarytableisgoingtobeusedincomplexqueries,itis
wisetorun
ANALYZE
onthetemporarytableafteritispopulated.
1399
VB.NET PDF Convert to Jpeg SDK: Convert PDF to JPEG images in vb.
Add necessary references page As PDFPage = doc.GetPage(0) ' Convert the first PDF page to page.ConvertToImage(ImageType.JPEG, Program.RootPath + "\\Output.jpg").
adding image to pdf in preview; add picture to pdf preview
C# PDF Convert to Jpeg SDK: Convert PDF to JPEG images in C#.net
example, this C#.NET PDF to JPEG converter library will name the converted JPEG image file Output.jpg. Convert PDF to JPEG Using C#.NET. Add necessary references
how to add a picture to a pdf document; adding an image to a pdf file
CREATETABLE
Optionally,
GLOBAL
or
LOCAL
canbewrittenbefore
TEMPORARY
or
TEMP
.Thispresentlymakes
nodifferenceinPostgreSQLandisdeprecated;seeCompatibility.
UNLOGGED
If specified,thetable is createdas an unloggedtable.Data written to unloggedtables is not
written tothe write-ahead log (see Chapter 29),which makes them considerably fasterthan
ordinarytables.However,theyarenotcrash-safe:anunloggedtableisautomaticallytruncated
afteracrashoruncleanshutdown.Thecontents ofanunloggedtablearealsonotreplicatedto
standbyservers.Anyindexescreatedonanunloggedtableareautomaticallyunloggedaswell.
IF NOT EXISTS
Donotthrowanerrorifarelationwiththesamenamealreadyexists.Anoticeisissuedinthis
case.Notethatthereisnoguaranteethattheexistingrelationisanythingliketheonethatwould
havebeencreated.
table_name
Thename(optionallyschema-qualified)ofthetabletobecreated.
OF
type_name
Createsatypedtable,whichtakesitsstructurefromthespecifiedcompositetype(nameoption-
allyschema-qualified).Atypedtableistiedtoitstype;forexamplethetablewillbedroppedif
thetypeisdropped(with
DROP TYPE ... CASCADE
).
Whenatypedtableiscreated,thenthedatatypesofthecolumnsaredeterminedbytheunder-
lyingcompositetypeandarenotspecifiedbythe
CREATE TABLE
command.Butthe
CREATE
TABLE
commandcanadddefaultsandconstraintstothetableandcanspecifystorageparameters.
column_name
Thenameofacolumntobecreatedinthenewtable.
data_type
Thedatatypeofthecolumn.Thiscanincludearrayspecifiers.Formoreinformationonthedata
typessupportedbyPostgreSQL,refertoChapter8.
COLLATE
collation
The
COLLATE
clauseassignsacollationtothecolumn(whichmustbeofacollatabledatatype).
Ifnotspecified,thecolumndatatype’sdefaultcollationisused.
INHERITS (
parent_table
[, ... ] )
Theoptional
INHERITS
clausespecifiesalistoftablesfromwhichthenewtableautomatically
inheritsallcolumns.
Useof
INHERITS
creates a persistentrelationshipbetweenthenewchild tableandits parent
table(s).Schemamodificationstotheparent(s)normallypropagatetochildrenaswell,andby
defaultthedataofthechildtableisincludedinscansoftheparent(s).
Ifthesamecolumnnameexistsinmorethanoneparenttable,anerrorisreportedunlessthedata
typesofthecolumnsmatchineachoftheparenttables.Ifthereisnoconflict,thentheduplicate
columnsaremergedtoformasingle columninthenewtable.Ifthecolumnname listofthe
newtablecontains acolumnnamethatisalsoinherited,thedatatypemustlikewisematchthe
inheritedcolumn(s),andthecolumndefinitionsaremergedintoone.Ifthenewtableexplicitly
specifiesadefaultvalueforthecolumn,thisdefaultoverridesanydefaultsfrominheriteddecla-
rationsofthecolumn.Otherwise,anyparentsthatspecifydefaultvaluesforthecolumnmustall
specifythesamedefault,oranerrorwillbereported.
1400
C# Image Convert: How to Convert Adobe PDF to Jpeg, Png, Bmp, &
Add necessary references to your C# project: String inputFilePath = @"C:\input.pdf"; String outputFilePath = @"C:\output.jpg"; // Convert PDF to jpg.
how to add jpg to pdf file; adding images to pdf files
C# Image Convert: How to Convert Tiff Image to Jpeg, Png, Bmp, &
Add necessary references to your C# project: RasterEdge.XDoc.PDF.dll. inputFilePath = @"C:\input.tif"; String outputFilePath = @"C:\output.jpg"; // Convert tiff
add image to pdf acrobat; add image to pdf in preview
CREATETABLE
CHECK
constraintsaremergedinessentiallythesamewayascolumns:ifmultipleparenttables
and/orthenewtabledefinitioncontainidentically-named
CHECK
constraints,these constraints
mustallhavethesame checkexpression,oran errorwillbereported.Constraintshavingthe
samenameandexpressionwillbemergedintoonecopy.Aconstraintmarked
NO INHERIT
in
aparentwillnotbeconsidered.Noticethatanunnamed
CHECK
constraintinthenewtablewill
neverbemerged,sinceauniquenamewillalwaysbechosenforit.
Column
STORAGE
settingsarealsocopiedfromparenttables.
LIKE
source_table
[
like_option
... ]
The
LIKE
clause specifies atable from which the new table automaticallycopies allcolumn
names,theirdatatypes,andtheirnot-nullconstraints.
Unlike
INHERITS
,thenewtableandoriginaltable arecompletelydecoupledaftercreationis
complete.Changestotheoriginaltablewillnotbeappliedtothenewtable,anditisnotpossible
toincludedataofthenewtableinscansoftheoriginaltable.
Default expressions for the copied column definitions will only be copied if
INCLUDING
DEFAULTS
is specified. Defaults that call database-modification functions, like
nextval
,
createalinkagebetweentheoriginalandnewtables.Thedefaultbehavioristoexcludedefault
expressions,resultinginthecopiedcolumnsinthenewtablehavingnulldefaults.
Not-nullconstraintsarealwayscopiedtothenewtable.
CHECK
constraintswillbecopiedonly
if
INCLUDING CONSTRAINTS
isspecified.Indexes,
PRIMARY KEY
,and
UNIQUE
constraintson
the originaltablewillbecreatedonthenewtableonlyifthe
INCLUDING INDEXES
clauseis
specified.Nodistinctionismadebetweencolumnconstraintsandtableconstraints.
STORAGE
settingsforthecopiedcolumndefinitionswillonlybecopiedif
INCLUDING STORAGE
isspecified.Thedefaultbehavioristoexclude
STORAGE
settings,resultinginthecopiedcolumns
inthenewtablehavingtype-specificdefaultsettings.Formoreon
STORAGE
settings,seeSection
59.2.
Commentsforthecopiedcolumns,constraints,andindexeswillonlybecopiedif
INCLUDING
COMMENTS
is specified.Thedefaultbehavioris to exclude comments,resulting in the copied
columnsandconstraintsinthenewtablehavingnocomments.
INCLUDING ALL
is an abbreviated form
of
INCLUDING DEFAULTS INCLUDING
CONSTRAINTS INCLUDING INDEXES INCLUDING STORAGE INCLUDING COMMENTS
.
Notealsothatunlike
INHERITS
,columnsandconstraintscopiedby
LIKE
arenotmergedwith
similarlynamedcolumnsandconstraints.Ifthesamenameisspecifiedexplicitlyorinanother
LIKE
clause,anerrorissignaled.
The
LIKE
clause can alsobeusedtocopy columnsfromviews,foreign tables,orcomposite
types.Inapplicableoptions(e.g.,
INCLUDING INDEXES
fromaview)areignored.
CONSTRAINT
constraint_name
Anoptionalname foracolumnortable constraint.Ifthe constraintis violated,the constraint
nameispresentinerrormessages,soconstraintnameslike
col must be positive
canbe
usedtocommunicatehelpfulconstraintinformationtoclientapplications.(Double-quotes are
neededtospecifyconstraintnamesthatcontainspaces.)Ifaconstraintnameisnotspecified,the
systemgeneratesaname.
NOT NULL
Thecolumnisnotallowedtocontainnullvalues.
NULL
Thecolumnisallowedtocontainnullvalues.Thisisthedefault.
1401
C# Create PDF from images Library to convert Jpeg, png images to
1.bmp")); images.Add(new Bitmap(Program.RootPath + "\\" 1.jpg")); images.Add(new Bitmap(Program.RootPath + "\\" 1.png")); / Build a PDF document with
add picture to pdf; how to add a picture to a pdf document
VB.NET Create PDF from images Library to convert Jpeg, png images
1.bmp")) images.Add(New REImage(Program.RootPath + "\\" 1.jpg")) images.Add(New REImage(Program.RootPath + "\\" 1.png")) ' Build a PDF document with
how to add picture to pdf; add image to pdf java
CREATETABLE
Thisclauseisonlyprovidedforcompatibilitywithnon-standardSQLdatabases.Itsuseisdis-
couragedinnewapplications.
CHECK (
expression
) [ NO INHERIT ]
The
CHECK
clausespecifies anexpression producing aBoolean result whichneworupdated
rowsmustsatisfyforaninsertorupdateoperationtosucceed.ExpressionsevaluatingtoTRUE
orUNKNOWNsucceed. Shouldany rowofaninsert or update operationproduce aFALSE
resultanerrorexceptionisraisedandtheinsertorupdatedoesnotalterthedatabase.Acheck
constraintspecifiedasacolumnconstraintshouldreferencethatcolumn’svalueonly,whilean
expressionappearinginatableconstraintcanreferencemultiplecolumns.
Currently,
CHECK
expressionscannotcontainsubqueriesnorrefertovariablesotherthancolumns
ofthecurrentrow.Thesystemcolumn
tableoid
maybereferenced,butnotanyothersystem
column.
Aconstraintmarkedwith
NO INHERIT
willnotpropagatetochildtables.
DEFAULT
default_expr
The
DEFAULT
clause assigns a default data value forthe column whose column definition it
appears within.The valueis any variable-free expression (subqueries and cross-references to
othercolumnsinthecurrenttablearenotallowed).Thedatatypeofthedefaultexpressionmust
matchthedatatypeofthecolumn.
Thedefaultexpressionwillbeusedinanyinsertoperationthatdoesnotspecifyavalueforthe
column.Ifthereisnodefaultforacolumn,thenthedefaultisnull.
UNIQUE
(columnconstraint)
UNIQUE (
column_name
[, ... ] )
(tableconstraint)
The
UNIQUE
constraintspecifies that agroupofone ormore columns ofa table cancontain
onlyuniquevalues.Thebehavioroftheuniquetableconstraintisthesameas thatforcolumn
constraints,withtheadditionalcapabilitytospanmultiplecolumns.
Forthepurposeofauniqueconstraint,nullvaluesarenotconsideredequal.
Eachuniquetableconstraintmustnameasetofcolumnsthatisdifferentfromthesetofcolumns
namedbyanyotheruniqueorprimarykeyconstraintdefinedforthetable.(Otherwiseitwould
justbethesameconstraintlistedtwice.)
PRIMARY KEY
(columnconstraint)
PRIMARY KEY (
column_name
[, ... ] )
(tableconstraint)
The
PRIMARY KEY
constraintspecifiesthata columnorcolumns ofa table can containonly
unique (non-duplicate), nonnull values. Only one primary key can be specified for a table,
whetherasacolumnconstraintoratableconstraint.
Theprimarykeyconstraintshouldnameasetofcolumnsthatisdifferentfromthesetofcolumns
namedbyanyuniqueconstraintdefinedforthesametable.(Otherwise,theuniqueconstraintis
redundantandwillbediscarded.)
PRIMARY KEY
enforcesthesamedataconstraintsasacombinationof
UNIQUE
and
NOT NULL
,
butidentifyingasetofcolumnsastheprimarykeyalsoprovidesmetadataaboutthedesignof
the schema,sinceaprimarykeyimpliesthatothertables canrely onthis setofcolumns asa
uniqueidentifierforrows.
EXCLUDE [ USING
index_method
] (
exclude_element
WITH
operator
[, ... ] )
index_parameters
[ WHERE (
predicate
) ]
The
EXCLUDE
clausedefinesanexclusionconstraint,whichguaranteesthatifanytworowsare
comparedon the specifiedcolumn(s)orexpression(s) using the specifiedoperator(s), not all
1402
VB.NET PDF - Convert PDF with VB.NET WPF PDF Viewer
Highlight Text. Add Text. Add Text Box. Drawing Markups. PDF Print. Work PDF to image file formats with high quality, support converting PDF to PNG, JPG, BMP and
add png to pdf acrobat; add a picture to a pdf document
VB.NET PDF Convert to Images SDK: Convert PDF to png, gif images
Convert PDF to Jpg, Png, Bmp, Gif, Tiff and Bitmap in ASP.NET. VB.NET Project: Necessary DLLs for Conversion of PDF to Images. Add necessary references:
add photo to pdf; adding an image to a pdf in acrobat
CREATETABLE
ofthesecomparisonswillreturn
TRUE
.Ifallofthespecifiedoperatorstestforequality,thisis
equivalenttoa
UNIQUE
constraint,althoughanordinaryuniqueconstraintwillbefaster.How-
ever,exclusionconstraintscanspecifyconstraintsthataremoregeneralthansimpleequality.For
example,youcanspecifyaconstraintthatnotworowsinthetablecontainoverlappingcircles
(seeSection8.8)byusingthe
&&
operator.
Exclusion constraintsareimplementedusinganindex,soeachspecifiedoperatormustbe as-
sociated with an appropriate operator class (see Section 11.9) for the index access method
index_method
.Theoperatorsarerequiredtobecommutative.Each
exclude_element
can
optionally specify anoperator class and/or orderingoptions; these are described fully under
CREATEINDEX.
The access method must support
amgettuple
(see Chapter 55); at present this means GIN
cannotbeused.Althoughit’sallowed,thereislittlepointinusingB-treeorhashindexeswith
anexclusionconstraint,becausethisdoesnothingthatanordinaryuniqueconstraintdoesn’tdo
better.SoinpracticetheaccessmethodwillalwaysbeGiSTorSP-GiST.
The
predicate
allowsyoutospecifyanexclusionconstraintonasubsetofthetable;internally
thiscreatesapartialindex.Notethatparenthesesarerequiredaroundthepredicate.
REFERENCES
reftable
[ (
refcolumn
) ] [ MATCH
matchtype
] [ ON DELETE
action
] [ ON UPDATE
action
]
(columnconstraint)
FOREIGN KEY (
column_name
[, ... ] ) REFERENCES
reftable
[ (
refcolumn
[,
... ] ) ] [ MATCH
matchtype
] [ ON DELETE
action
] [ ON UPDATE
action
]
(table
constraint)
These clauses specify a foreign key constraint, which requires that a group of one or more
columns ofthe new table must only contain values that matchvalues in the referencedcol-
umn(s)ofsomerowofthereferencedtable.Ifthe
refcolumn
listisomitted,theprimarykeyof
the
reftable
isused.Thereferencedcolumnsmustbethecolumnsofanon-deferrableunique
orprimarykeyconstraint in the referencedtable.Notethatforeignkeyconstraints cannot be
definedbetweentemporarytablesandpermanenttables.
Avalueinsertedintothereferencingcolumn(s)ismatchedagainstthevaluesofthereferenced
tableandreferencedcolumnsusingthegivenmatchtype.Therearethreematchtypes:
MATCH
FULL
,
MATCH PARTIAL
,and
MATCH SIMPLE
(whichisthedefault).
MATCH FULL
willnotallow
onecolumnofamulticolumnforeignkeytobenullunlessallforeignkeycolumns arenull;if
theyareallnull,therowisnotrequiredtohaveamatchinthereferencedtable.
MATCH SIMPLE
allowsanyoftheforeignkeycolumnstobenull;ifanyofthemarenull,therowisnotrequired
tohavea matchinthereferencedtable.
MATCH PARTIAL
is notyetimplemented.(Ofcourse,
NOT NULL
constraintscanbeappliedtothereferencingcolumn(s)topreventthesecasesfrom
arising.)
Inaddition,whenthedatainthereferencedcolumnsischanged,certainactionsareperformed
onthedatainthistable’scolumns.The
ON DELETE
clausespecifiestheactiontoperformwhena
referencedrowinthereferencedtableisbeingdeleted.Likewise,the
ON UPDATE
clausespecifies
theactiontoperformwhenareferencedcolumninthereferencedtableisbeingupdatedtoanew
value.Iftherowisupdated,butthereferencedcolumnisnotactuallychanged,noactionisdone.
Referentialactionsotherthanthe
NO ACTION
checkcannotbedeferred,eveniftheconstraintis
declareddeferrable.Therearethefollowingpossibleactionsforeachclause:
NO ACTION
Produceanerrorindicatingthatthedeletionorupdatewouldcreateaforeignkeyconstraint
violation.Iftheconstraintisdeferred,thiserrorwillbeproducedatconstraintchecktime
iftherestillexistanyreferencingrows.Thisisthedefaultaction.
1403
CREATETABLE
RESTRICT
Produceanerrorindicatingthatthedeletionorupdatewouldcreateaforeignkeyconstraint
violation.Thisisthesameas
NO ACTION
exceptthatthecheckisnotdeferrable.
CASCADE
Delete anyrows referencingthedeletedrow,orupdatethe values ofthe referencingcol-
umn(s)tothenewvaluesofthereferencedcolumns,respectively.
SET NULL
Setthereferencingcolumn(s)tonull.
SET DEFAULT
Setthereferencingcolumn(s)totheirdefaultvalues.(Theremustbearowinthereferenced
tablematchingthedefaultvalues,iftheyarenotnull,ortheoperationwillfail.)
If the referenced column(s) are changed frequently, it might be wise to add an index to the
referencingcolumn(s)sothatreferentialactionsassociatedwiththeforeignkeyconstraintcan
beperformedmoreefficiently.
DEFERRABLE
NOT DEFERRABLE
Thiscontrolswhethertheconstraintcanbedeferred.Aconstraintthatisnotdeferrablewillbe
checked immediately after every command. Checking of constraints that are deferrable can
be postponed until the end of the transaction (using the SET CONSTRAINTS command).
NOT DEFERRABLE
is the default. Currently, only
UNIQUE
,
PRIMARY KEY
,
EXCLUDE
, and
REFERENCES
(foreignkey)constraintsacceptthisclause.
NOT NULL
and
CHECK
constraintsare
notdeferrable.
INITIALLY IMMEDIATE
INITIALLY DEFERRED
Ifaconstraintisdeferrable,thisclausespecifiesthedefaulttimetochecktheconstraint.Ifthe
constraintis
INITIALLY IMMEDIATE
,itischeckedaftereachstatement.Thisisthedefault.If
the constraintis
INITIALLY DEFERRED
,itischeckedonlyattheendofthetransaction.The
constraintchecktimecanbealteredwiththeSETCONSTRAINTScommand.
WITH (
storage_parameter
[=
value
] [, ... ] )
This clause specifies optional storageparameters foratableorindex;seeStorage Parameters
formoreinformation.The
WITH
clauseforatablecanalsoinclude
OIDS=TRUE
(orjust
OIDS
)
tospecifythat rows ofthe newtable shouldhaveOIDs (objectidentifiers)assignedtothem,
or
OIDS=FALSE
tospecify thattherows should not have OIDs.If
OIDS
is not specified,the
defaultsettingdepends uponthe default_with_oids configuration parameter.(Ifthe newtable
inheritsfromanytablesthathaveOIDs,then
OIDS=TRUE
isforcedevenifthecommandsays
OIDS=FALSE
.)
If
OIDS=FALSE
is specified orimplied,the new table does notstore OIDs andno OIDwill
be assigned fora row inserted into it. This is generally considered worthwhile,since itwill
reduceOIDconsumptionandtherebypostponethewraparoundofthe32-bitOIDcounter.Once
the counter wraps around,OIDs canno longerbe assumedto be unique,which makes them
considerablylessuseful.Inaddition,excludingOIDsfromatablereducesthespacerequiredto
storethetableondiskby4bytesperrow(onmostmachines),slightlyimprovingperformance.
ToremoveOIDsfromatableafterithasbeencreated,useALTERTABLE.
1404
CREATETABLE
WITH OIDS
WITHOUT OIDS
Theseareobsolescentsyntaxesequivalentto
WITH (OIDS)
and
WITH (OIDS=FALSE)
,respec-
tively.Ifyouwishtogivebothan
OIDS
settingandstorageparameters,youmustusethe
WITH
( ... )
syntax;seeabove.
ON COMMIT
Thebehavioroftemporarytables attheendofatransactionblockcanbe controlledusing
ON
COMMIT
.Thethreeoptionsare:
PRESERVE ROWS
Nospecialactionistakenattheendsoftransactions.Thisisthedefaultbehavior.
DELETE ROWS
Allrowsinthetemporarytablewillbedeletedattheendofeachtransactionblock.Essen-
tially,anautomaticTRUNCATEisdoneateachcommit.
DROP
Thetemporarytablewillbedroppedattheendofthecurrenttransactionblock.
TABLESPACE
tablespace_name
The
tablespace_name
isthenameofthetablespaceinwhichthenewtableistobecreated.If
notspecified,default_tablespaceisconsulted,ortemp_tablespacesifthetableistemporary.
USING INDEX TABLESPACE
tablespace_name
This clause allows selectionofthetablespace in whichthe index associatedwith a
UNIQUE
,
PRIMARY KEY
,or
EXCLUDE
constraint willbe created.Ifnot specified, default_tablespace is
consulted,ortemp_tablespacesifthetableistemporary.
StorageParameters
The
WITH
clausecanspecifystorageparametersfortables,andforindexesassociatedwitha
UNIQUE
,
PRIMARY KEY
,or
EXCLUDE
constraint.StorageparametersforindexesaredocumentedinCREATE
INDEX.Thestorageparameterscurrentlyavailable fortablesarelistedbelow.Foreachparameter,
unlessnoted,thereisanadditionalparameterwiththesamenameprefixedwith
toast.
,whichcanbe
usedtocontrolthebehaviorofthetable’ssecondaryTOASTtable,ifany(seeSection59.2formore
informationaboutTOAST).NotethattheTOASTtableinheritsthe
autovacuum_
*
valuesfromits
parenttable,ifthereareno
toast.autovacuum_
*
settingsset.
fillfactor
(
integer
)
The fillfactorfor atable is a percentage between10 and 100.100 (complete packing)is the
default.Whenasmallerfillfactorisspecified,
INSERT
operationspacktablepages onlytothe
indicatedpercentage;the remainingspace on eachpageisreserved forupdatingrowsonthat
page.Thisgives
UPDATE
achancetoplacetheupdatedcopyofarowonthesamepageasthe
original,whichismoreefficient thanplacingitonadifferentpage.Foratablewhose entries
are neverupdated,complete packing is the bestchoice,butinheavily updatedtables smaller
fillfactorsareappropriate.ThisparametercannotbesetforTOASTtables.
autovacuum_enabled
,
toast.autovacuum_enabled
(
boolean
)
Enablesordisablestheautovacuumdaemononaparticulartable.Iftrue,theautovacuumdaemon
willinitiatea
VACUUM
operationonaparticulartablewhenthenumberofupdatedordeletedtu-
1405
CREATETABLE
plesexceeds
autovacuum_vacuum_threshold
plus
autovacuum_vacuum_scale_factor
timesthenumberoflivetuplescurrentlyestimatedtobe intherelation.Similarly,it willini-
tiate an
ANALYZE
operation when the numberofinserted, updated or deletedtuples exceeds
autovacuum_analyze_threshold
plus
autovacuum_analyze_scale_factor
times the
numberoflivetuples currently estimatedto be inthe relation.If false,this tablewill not be
autovacuumed,excepttopreventtransactionIdwraparound.SeeSection23.1.5formoreabout
wraparoundprevention.Observethatthisvariableinheritsitsvaluefromtheautovacuumsetting.
autovacuum_vacuum_threshold
,
toast.autovacuum_vacuum_threshold
(
integer
)
Minimumnumberofupdatedordeletedtuplesbeforeinitiatea
VACUUM
operationonaparticular
table.
autovacuum_vacuum_scale_factor
,
toast.autovacuum_vacuum_scale_factor
(
float4
)
Multiplierfor
reltuples
toaddto
autovacuum_vacuum_threshold
.
autovacuum_analyze_threshold
(
integer
)
Minimumnumberofinserted,updated,ordeletedtuplesbeforeinitiatean
ANALYZE
operation
onaparticulartable.
autovacuum_analyze_scale_factor
(
float4
)
Multiplierfor
reltuples
toaddto
autovacuum_analyze_threshold
.
autovacuum_vacuum_cost_delay
,
toast.autovacuum_vacuum_cost_delay
(
integer
)
Customautovacuum_vacuum_cost_delayparameter.
autovacuum_vacuum_cost_limit
,
toast.autovacuum_vacuum_cost_limit
(
integer
)
Customautovacuum_vacuum_cost_limitparameter.
autovacuum_freeze_min_age
,
toast.autovacuum_freeze_min_age
(
integer
)
Custom vacuum_freeze_min_age parameter. Note that autovacuum will ignore attempts
to set a per-table
autovacuum_freeze_min_age
larger than half the system-wide
autovacuum_freeze_max_agesetting.
autovacuum_freeze_max_age
,
toast.autovacuum_freeze_max_age
(
integer
)
Customautovacuum_freeze_max_ageparameter.Notethatautovacuumwillignoreattemptsto
setaper-table
autovacuum_freeze_max_age
largerthanthesystem-widesetting(itcanonly
besetsmaller).
autovacuum_freeze_table_age
,
toast.autovacuum_freeze_table_age
(
integer
)
Customvacuum_freeze_table_ageparameter.
autovacuum_multixact_freeze_min_age
,
toast.autovacuum_multixact_freeze_min_age
(
integer
)
Custom vacuum_multixact_freeze_min_age parameter. Note that autovacuum will ignore
attempts toset a per-table
autovacuum_multixact_freeze_min_age
largerthanhalf the
system-wideautovacuum_multixact_freeze_max_agesetting.
autovacuum_multixact_freeze_max_age
,
toast.autovacuum_multixact_freeze_max_age
(
integer
)
Customautovacuum_multixact_freeze_max_ageparameter.Notethat autovacuumwillignore
attemptstosetaper-table
autovacuum_multixact_freeze_max_age
largerthanthesystem-
widesetting(itcanonlybesetsmaller).
1406
CREATETABLE
autovacuum_multixact_freeze_table_age
,
toast.autovacuum_multixact_freeze_table_age
(
integer
)
Customvacuum_multixact_freeze_table_ageparameter.
user_catalog_table
(
boolean
)
Declare a tableas an additional catalog table,e.g.forthe purpose oflogical replication.See
Section46.6.2fordetails.
Notes
UsingOIDsinnewapplicationsisnotrecommended:wherepossible,usinga
SERIAL
orotherse-
quencegeneratorasthetable’sprimarykeyispreferred.However,ifyourapplicationdoesmakeuse
ofOIDstoidentifyspecificrowsofatable,itisrecommendedtocreateauniqueconstraintonthe
oid
columnofthattable,toensure thatOIDs inthetablewillindeeduniquelyidentifyrowsevenafter
counterwraparound.AvoidassumingthatOIDsareuniqueacrosstables;ifyouneedadatabase-wide
uniqueidentifier,usethecombinationof
tableoid
androwOIDforthepurpose.
Tip:Theuseof
OIDS=FALSE
isnotrecommendedfor tableswithnoprimarykey,sincewithout
eitheranOIDorauniquedatakey,itisdifficulttoidentifyspecificrows.
PostgreSQLautomaticallycreatesanindexforeachuniqueconstraintandprimarykeyconstraintto
enforceuniqueness.Thus,itisnotnecessarytocreateanindexexplicitlyforprimarykeycolumns.
(SeeCREATEINDEXformoreinformation.)
Uniqueconstraintsandprimarykeysarenotinheritedinthecurrentimplementation.Thismakesthe
combinationofinheritanceanduniqueconstraintsratherdysfunctional.
Atablecannothavemorethan1600columns.(Inpractice,theeffectivelimitisusuallylowerbecause
oftuple-lengthconstraints.)
Examples
Createtable
films
andtable
distributors
:
CREATE TABLE films (
code
char(5) CONSTRAINT firstkey PRIMARY KEY,
title
varchar(40) NOT NULL,
did
integer NOT NULL,
date_prod
date,
kind
varchar(10),
len
interval hour to minute
);
CREATE TABLE distributors (
did
integer PRIMARY KEY DEFAULT nextval(’serial’),
name
varchar(40) NOT NULL CHECK (name <> ”)
);
Createatablewitha2-dimensionalarray:
1407
Documents you may be interested
Documents you may be interested