forked from risingwavelabs/risingwave
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(frontend): introduce system catalog table pg_enum (risingwavelab…
…s#7706) Introduce system catalog table `pg_enum`. Approved-By: neverchanje
- Loading branch information
1 parent
7e565a7
commit 77b4607
Showing
4 changed files
with
38 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
query IIIT | ||
SELECT * FROM pg_catalog.pg_enum; | ||
---- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
src/frontend/src/catalog/system_catalog/pg_catalog/pg_enum.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
// Copyright 2023 RisingWave Labs | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
use risingwave_common::types::DataType; | ||
|
||
use crate::catalog::system_catalog::SystemCatalogColumnsDef; | ||
|
||
/// The `pg_enum` catalog contains entries showing the values and labels for each enum type. | ||
/// The internal representation of a given enum value is actually the OID of its associated row in | ||
/// `pg_enum`. Reference: [`https://www.postgresql.org/docs/current/catalog-pg-enum.html`] | ||
pub const PG_ENUM_TABLE_NAME: &str = "pg_enum"; | ||
pub const PG_ENUM_COLUMNS: &[SystemCatalogColumnsDef<'_>] = &[ | ||
(DataType::Int32, "oid"), | ||
(DataType::Int32, "enumtypid"), | ||
(DataType::Float32, "enumsortorder"), | ||
(DataType::Varchar, "enumlabel"), | ||
]; |