Description Usage Arguments Value
Create an index
1 2 3 4 5 6 7 | pg_add_index(
con,
table_name,
indexed_col,
unique_index = FALSE,
drop_existing = FALSE
)
|
con |
A DBI connection to a postgresql database |
table_name |
The name of a table in the postgresql database |
indexed_col |
Columns or an expression on columns to index |
unique_index |
Force index to be unique? |
drop_existing |
Drop index if it already exists? |
The name of the created index
Note, postgres is smart enough that you don't need to index a column that's already unique, but if you want to ALTER TABLE to make a primary key, you have to start with a unique index.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.