| Документация по PostgreSQL 9.4.1 | |||
|---|---|---|---|
| Пред. | Уровень выше | Глава 34. Информационная схема | След. |
34.42. sequences
Представление sequences показывает все последовательности, определённые в текущей базе данных. В нём показываются только те последовательности, к которым имеет доступ текущий пользователь (являясь владельцем или имея некоторые права).
Таблица 34-40. Колонки sequences
| Имя | Тип данных | Описание |
|---|---|---|
| sequence_catalog | sql_identifier | Имя базы данных, содержащей последовательность (всегда текущая база) |
| sequence_schema | sql_identifier | Имя схемы, содержащей последовательность |
| sequence_name | sql_identifier | Имя последовательности |
| data_type | character_data | Тип данных последовательности. В PostgreSQL на данный момент это всегда bigint. |
| numeric_precision | cardinal_number | Эта колонка содержит точность (объявленную или неявную) типа данных последовательности (см. выше). Точность определяет число значащих цифр. Она может выражаться в десятичных (по основанию 10) или двоичных (по основанию 2) цифрах, согласно колонке numeric_precision_radix. |
| numeric_precision_radix | cardinal_number | Эта колонка определяет, по какому основанию задаются значения в колонках numeric_precision и numeric_scale. Возможные варианты: 2 и 10. |
| numeric_scale | cardinal_number | Эта колонка содержит масштаб (объявленный или неявный) типа данных последовательности (см. выше). Масштаб определяет число значащих цифр справа от десятичной точки. Он может выражаться в десятичных (по основанию 10) или двоичных (по основанию 2) цифрах, согласно колонке numeric_precision_radix. |
| start_value | character_data | Начальное значение последовательности |
| minimum_value | character_data | Минимальное значение последовательности |
| maximum_value | character_data | Максимальное значение последовательности |
| increment | character_data | Шаг увеличения последовательности |
| cycle_option | yes_or_no | YES, если последовательность зацикливается, или NO в противном случае |
Заметьте, что, согласно стандарту SQL, начальное, минимальное, максимальное значение и шаг выдаются в виде символьных строк.
| Пред. | Начало | След. |
| schemata | Уровень выше | sql_features |
| PostgreSQL 9.4.1 Documentation | |||
|---|---|---|---|
| Prev | Up | Chapter 34. The Information Schema | Next |
34.42. sequences
The view sequences contains all sequences defined in the current database. Only those sequences are shown that the current user has access to (by way of being the owner or having some privilege).
Table 34-40. sequences Columns
| Name | Data Type | Description |
|---|---|---|
| sequence_catalog | sql_identifier | Name of the database that contains the sequence (always the current database) |
| sequence_schema | sql_identifier | Name of the schema that contains the sequence |
| sequence_name | sql_identifier | Name of the sequence |
| data_type | character_data | The data type of the sequence. In PostgreSQL, this is currently always bigint. |
| numeric_precision | cardinal_number | This column contains the (declared or implicit) precision of the sequence data type (see above). The precision indicates the number of significant digits. It can be expressed in decimal (base 10) or binary (base 2) terms, as specified in the column numeric_precision_radix. |
| numeric_precision_radix | cardinal_number | This column indicates in which base the values in the columns numeric_precision and numeric_scale are expressed. The value is either 2 or 10. |
| numeric_scale | cardinal_number | This column contains the (declared or implicit) scale of the sequence data type (see above). The scale indicates the number of significant digits to the right of the decimal point. It can be expressed in decimal (base 10) or binary (base 2) terms, as specified in the column numeric_precision_radix. |
| start_value | character_data | The start value of the sequence |
| minimum_value | character_data | The minimum value of the sequence |
| maximum_value | character_data | The maximum value of the sequence |
| increment | character_data | The increment of the sequence |
| cycle_option | yes_or_no | YES if the sequence cycles, else NO |
Note that in accordance with the SQL standard, the start, minimum, maximum, and increment values are returned as character strings.