SPI_getnspname
SPI_getnspname — возвращает пространство имён указанного отношения
Синтаксис
char * SPI_getnspname(Relation rel
)
Описание
SPI_getnspname
возвращает копию имени пространства имён, к которому принадлежит указанное отношение (Relation
). Пространство имён по-другому называется схемой отношения. Когда значение, возвращённое этой функцией, будет не нужно, освободите его с помощью pfree
.
Аргументы
Relation
rel
целевое отношение
Возвращаемое значение
Имя пространства имён указанного отношения.
11.6. Unique Indexes
Indexes can also be used to enforce uniqueness of a column's value, or the uniqueness of the combined values of more than one column.
CREATE UNIQUE INDEXname
ONtable
(column
[, ...]);
Currently, only B-tree indexes can be declared unique.
When an index is declared unique, multiple table rows with equal indexed values are not allowed. Null values are not considered equal. A multicolumn unique index will only reject cases where all indexed columns are equal in multiple rows.
PostgreSQL automatically creates a unique index when a unique constraint or primary key is defined for a table. The index covers the columns that make up the primary key or unique constraint (a multicolumn index, if appropriate), and is the mechanism that enforces the constraint.
Note
There's no need to manually create indexes on unique columns; doing so would just duplicate the automatically-created index.