.\" Automatically generated by Pod::Man 2.25 (Pod::Simple 3.16) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is turned on, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .ie \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . nr % 0 . rr F .\} .el \{\ . de IX .. .\} .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "PG_TAPGEN 1p" .TH PG_TAPGEN 1p "2012-06-10" "perl v5.14.2" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "Name" .IX Header "Name" pg_tapgen \- Generate schema \s-1TAP\s0 tests from an existing database .SH "Usage" .IX Header "Usage" .Vb 1 \& pg_tapgen \-d template1 > schema_test.sql .Ve .SH "Description" .IX Header "Description" \&\f(CW\*(C`pg_tapgen\*(C'\fR is a command-line utility to generate pgTAP tests to validate a database schema by reading an existing database and generating the tests to match. Its use requires the installation of the \s-1DBI\s0 and DBD::Pg from \&\s-1CPAN\s0 or via a package distribution. .PP \&\fBWarning:\fR These prerequisites are not validated by the pgTAP \f(CW\*(C`Makefile\*(C'\fR, so you'll need to install them yourself. As a result, inclusion of this script in the pgTAP distribution is experimental. It may be moved to its own distribution in the future. .SH "Options" .IX Header "Options" .Vb 9 \& \-d \-\-dbname DBNAME Database to which to connect. \& \-U \-\-username USERNAME Username with which to connect. \& \-h \-\-host HOST Host to which to connect. \& \-p \-\-port PORT Port to which to connect. \& \-v \-\-verbose Display output of test scripts while running them. \& \-N \-\-exclude\-schema Exclude a schema from the generated tests. \& \-H \-\-help Print a usage statement and exit. \& \-m \-\-man Print the complete documentation and exit. \& \-V \-\-version Print the version number and exit. .Ve .SH "Options Details" .IX Header "Options Details" .ie n .IP """\-d""" 4 .el .IP "\f(CW\-d\fR" 4 .IX Item "-d" .PD 0 .ie n .IP """\-\-dbname""" 4 .el .IP "\f(CW\-\-dbname\fR" 4 .IX Item "--dbname" .PD .Vb 2 \& pg_tapgen \-\-dbname try \& pg_tapgen \-d postgres .Ve .Sp The name of database to which to connect. Defaults to the value of the \&\f(CW$PGDATABASE\fR environment variable or to the system username. .ie n .IP """\-U""" 4 .el .IP "\f(CW\-U\fR" 4 .IX Item "-U" .PD 0 .ie n .IP """\-\-username""" 4 .el .IP "\f(CW\-\-username\fR" 4 .IX Item "--username" .PD .Vb 2 \& pg_tapgen \-\-username foo \& pg_tapgen \-U postgres .Ve .Sp PostgreSQL user name to connect as. Defaults to the value of the \f(CW$PGUSER\fR environment variable or to the operating system name of the user running the application. .ie n .IP """\-h""" 4 .el .IP "\f(CW\-h\fR" 4 .IX Item "-h" .PD 0 .ie n .IP """\-\-host""" 4 .el .IP "\f(CW\-\-host\fR" 4 .IX Item "--host" .PD .Vb 2 \& pg_tapgen \-\-host pg.example.com \& pg_tapgen \-h dev.local .Ve .Sp Specifies the host name of the machine on which the server is running. If the value begins with a slash, it is used as the directory for the Unix-domain socket. Defaults to the value of the \f(CW$PGHOST\fR environment variable or localhost. .ie n .IP """\-p""" 4 .el .IP "\f(CW\-p\fR" 4 .IX Item "-p" .PD 0 .ie n .IP """\-\-port""" 4 .el .IP "\f(CW\-\-port\fR" 4 .IX Item "--port" .PD .Vb 2 \& pg_tapgen \-\-port 1234 \& pg_tapgen \-p 666 .Ve .Sp Specifies the \s-1TCP\s0 port or the local Unix-domain socket file extension on which the server is listening for connections. Defaults to the value of the \&\f(CW$PGPORT\fR environment variable or, if not set, to the port specified at compile time, usually 5432. .ie n .IP """\-v""" 4 .el .IP "\f(CW\-v\fR" 4 .IX Item "-v" .PD 0 .ie n .IP """\-\-verbose""" 4 .el .IP "\f(CW\-\-verbose\fR" 4 .IX Item "--verbose" .PD .Vb 2 \& pg_tapgen \-\-verbose \& pg_tapgen \-v .Ve .Sp Display standard output of test scripts while running them. This behavior can also be triggered by setting the \f(CW$TEST_VERBOSE\fR environment variable to a true value. .ie n .IP """\-N""" 4 .el .IP "\f(CW\-N\fR" 4 .IX Item "-N" .PD 0 .ie n .IP """\-\-exclude\-schema""" 4 .el .IP "\f(CW\-\-exclude\-schema\fR" 4 .IX Item "--exclude-schema" .PD .Vb 2 \& pg_tapgen \-\-exclude\-schema contrib \& pg_tapgen \-N testing \-N temporary .Ve .Sp Exclude a schema from the test generation. \f(CW\*(C`pg_tapgen\*(C'\fR always ignores \&\f(CW\*(C`information_schema\*(C'\fR, as it is also ignored by pgTAP. But if there are other schemas in the database that you don't need or want to test for in the database (because you run the tests on another database without those schemas, for example), use \f(CW\*(C`\-\-exclude\-schema\*(C'\fR to omit them. May be used more than once to exclude more than one schema. .ie n .IP """\-H""" 4 .el .IP "\f(CW\-H\fR" 4 .IX Item "-H" .PD 0 .ie n .IP """\-\-help""" 4 .el .IP "\f(CW\-\-help\fR" 4 .IX Item "--help" .PD .Vb 2 \& pg_tapgen \-\-help \& pg_tapgen \-H .Ve .Sp Outputs a brief description of the options supported by \f(CW\*(C`pg_tapgen\*(C'\fR and exits. .ie n .IP """\-m""" 4 .el .IP "\f(CW\-m\fR" 4 .IX Item "-m" .PD 0 .ie n .IP """\-\-man""" 4 .el .IP "\f(CW\-\-man\fR" 4 .IX Item "--man" .PD .Vb 2 \& pg_tapgen \-\-man \& pg_tapgen \-m .Ve .Sp Outputs this documentation and exits. .ie n .IP """\-V""" 4 .el .IP "\f(CW\-V\fR" 4 .IX Item "-V" .PD 0 .ie n .IP """\-\-version""" 4 .el .IP "\f(CW\-\-version\fR" 4 .IX Item "--version" .PD .Vb 2 \& pg_tapgen \-\-version \& pg_tapgen \-V .Ve .Sp Outputs the program name and version and exits. .SH "Author" .IX Header "Author" David E. Wheeler .SH "Copyright" .IX Header "Copyright" Copyright (c) 2009\-2011 David E. Wheeler. Some Rights Reserved.