pgCreatePrimaryKey: Create Primary Keys for Postgres Table

pgCreatePrimaryKeyR Documentation

Create Primary Keys for Postgres Table

Description

Description

Usage

pgCreatePrimaryKey(pg_conn, schema_name, table_name, primary_keys = "NA")

Arguments

pg_conn

connection string Postgres connection pointer/string (PqConnection) created from RPostgres::Postgres(). JDBC connections will break this function.

schema_name

character Posgres schema name.

table_name

character Postgres table name.

primary_keys

character list of primary keys.

Details

The table name needs to include the schema in the Postgres server. The list of primary keys can simply be "var1,var2,var3" because this will be inserted into an SQL statement that will be sent to the server.

Value

The results will look like the print out below. It is a generic print out from RPostgres. Check the table metadata in Postgres server to check primary key build.


Fredo-XVII/RToolShed documentation built on March 17, 2024, 12:15 p.m.