이 문서는 지원되지 않는 버전의 PostgreSQL을위한 것입니다.
You may want to view the same page for the
메이저 토토 사이트 : 문서 : 17 : 9.10. 열거적인 지원 기능버전 또는 위에 나열된 다른 지원 버전 중 하나입니다.
토토 결과 유형의 경우 (PostgreSQL : 문서 : 11 : 8.7. 열거 된 롤 토토), there are several functions that allow cleaner programming without hard-coding particular values of an enum type. These are listed inTable 9.32. The examples assume an enum type created as:
Enum ( '빨간색', '오렌지', '노란색', '녹색', '파란색', '보라색')로 유형 무지개를 만듭니다.
Table 9.32. 열거적인 지원 기능
Function |
설명 |
Example |
예제 결과 |
enum_first(anyenum) |
Returns the first value of the input enum type |
enum_first (null :: Rainbow) |
빨간색 |
enum_last(anyenum) |
입력 토토 결과 유형의 마지막 값을 반환 |
enum_last(null::rainbow) |
퍼플 |
enum_range(anyenum) |
주문한 배열에서 입력 토토 결과 유형의 모든 값을 반환 |
enum_range(null::rainbow) |
red,orange,yellow,green,blue,purple |
enum_range(anyenum, anyenum) |
순서 배열로 주어진 두 개의 토토 결과 값 사이의 범위를 반환합니다. 값은 동일한 토토 결과 형 유형에서 가져와야합니다. 첫 번째 매개 변수가 NULL 인 경우 결과는 토토 결과 유형의 첫 번째 값으로 시작됩니다. 두 번째 매개 변수가 null이면 결과는 토토 결과 유형의 마지막 값으로 끝납니다. |
enum_range ( '오렌지':: 레인보우, '그린':: 레인보우) |
오렌지, 노란색, 녹색 |
enum_range(NULL, 'green'::rainbow) |
빨간색, 주황색, 노란색, 녹색 |
enum_range('orange'::rainbow, NULL) |
오렌지, 노란색, 녹색, 파란색, 보라색 |
두정의 두 가지 형태를 제외하고enum_Range
, these functions disregard the specific value passed to them; they care only about its declared data type. Either null or a specific value of the type can be passed, with the same result. It is more common to apply these functions to a table column or function argument than to a hardwired type name as suggested by the examples.