createSequence {pgUtils}R Documentation

Creating a PgSQL SEQUENCE

Description

createSequence creates a PostgreSQL SEQUENCE. SEQUENCEs allow the creation of autoincrementing sequences.

Usage

createSequence(con, name=NULL, increment=1, start=100)

Arguments

con A connection object (create it with the dbConnect.PgSQL.conn function from the package RdbiPgSQL)
name The name for the sequence
increment the value to increment the sequence by each call, by default 1.
start the starting value of the sequence, by default 100.

Details

creates a PostgreSQL SEQUENCE table. Such a sequence table can be used to get unique numbers and are therefore ideal for Primary keys (by creating a table with the default call createDBTable also a sequence will be created, to get unique Primary keys for the rows). To get the next value from the sequece only call nextval('<sequence name>'). For more details look in the PostgreSQL reference manual.

Author(s)

Johannes Rainer

See Also

createDBTable


[Package pgUtils version 1.14.1 Index]