forked from yugabyte/yugabyte-db
-
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.
Docs: Fix formatting in a
CREATE TABLE
,ENUM example (yugabyte#13681)
Fix formatting in `ENUM` data type examples
- Loading branch information
Showing
10 changed files
with
39 additions
and
27 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
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 |
---|---|---|
|
@@ -307,7 +307,7 @@ The output should be as follows: | |
e_contact_method | Phone | ||
``` | ||
|
||
### 2. Create a table with an ENUM column | ||
### 3. Create a table with an ENUM column | ||
|
||
```sql | ||
CREATE TABLE contact_method_info ( | ||
|
@@ -317,18 +317,18 @@ CREATE TABLE contact_method_info ( | |
); | ||
``` | ||
|
||
### 3. Insert a row with ENUM | ||
### 4. Insert a row with ENUM | ||
|
||
The `ENUM` should have a valid value, as follows: | ||
|
||
```sql | ||
INSERT INTO contact_method_info VALUES ('Jeff', 'Email', '[email protected]') | ||
INSERT INTO contact_method_info VALUES ('Jeff', 'Email', '[email protected]'); | ||
``` | ||
|
||
Execute the following to verify: | ||
|
||
```sql | ||
yugabyte=# select * from contact_method_info; | ||
select * from contact_method_info; | ||
``` | ||
|
||
```output | ||
|
@@ -341,7 +341,7 @@ yugabyte=# select * from contact_method_info; | |
Inserting an invalid `ENUM` value would fail, as shown in the following example: | ||
|
||
```sql | ||
yugabyte=# INSERT INTO contact_method_info VALUES ('Jeff', 'Fax', '4563456'); | ||
INSERT INTO contact_method_info VALUES ('Jeff', 'Fax', '4563456'); | ||
``` | ||
|
||
You should see the following error (which is compatible with that of PostgreSQL): | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -307,7 +307,7 @@ The output should be as follows: | |
e_contact_method | Phone | ||
``` | ||
|
||
### 2. Create a table with an `ENUM` column | ||
### 3. Create a table with an `ENUM` column | ||
|
||
```sql | ||
CREATE TABLE contact_method_info ( | ||
|
@@ -317,18 +317,18 @@ CREATE TABLE contact_method_info ( | |
); | ||
``` | ||
|
||
### 3. Insert a row with `ENUM` | ||
### 4. Insert a row with `ENUM` | ||
|
||
The `ENUM` should have a valid value, as follows: | ||
|
||
```sql | ||
INSERT INTO contact_method_info VALUES ('Jeff', 'Email', '[email protected]') | ||
INSERT INTO contact_method_info VALUES ('Jeff', 'Email', '[email protected]'); | ||
``` | ||
|
||
Execute the following to verify: | ||
|
||
```sql | ||
yugabyte=# select * from contact_method_info; | ||
select * from contact_method_info; | ||
``` | ||
|
||
```output | ||
|
@@ -341,7 +341,7 @@ yugabyte=# select * from contact_method_info; | |
Inserting an invalid `ENUM` value would fail, as shown in the following example: | ||
|
||
```sql | ||
yugabyte=# INSERT INTO contact_method_info VALUES ('Jeff', 'Fax', '4563456'); | ||
INSERT INTO contact_method_info VALUES ('Jeff', 'Fax', '4563456'); | ||
``` | ||
|
||
You should see the following error (which is compatible with that of PostgreSQL): | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -307,7 +307,7 @@ The output should be as follows: | |
e_contact_method | Phone | ||
``` | ||
|
||
### 2. Create a table with an `ENUM` column | ||
### 3. Create a table with an `ENUM` column | ||
|
||
```sql | ||
CREATE TABLE contact_method_info ( | ||
|
@@ -317,18 +317,18 @@ CREATE TABLE contact_method_info ( | |
); | ||
``` | ||
|
||
### 3. Insert a row with `ENUM` | ||
### 4. Insert a row with `ENUM` | ||
|
||
The `ENUM` should have a valid value, as follows: | ||
|
||
```sql | ||
INSERT INTO contact_method_info VALUES ('Jeff', 'Email', '[email protected]') | ||
INSERT INTO contact_method_info VALUES ('Jeff', 'Email', '[email protected]'); | ||
``` | ||
|
||
Execute the following to verify: | ||
|
||
```sql | ||
yugabyte=# select * from contact_method_info; | ||
select * from contact_method_info; | ||
``` | ||
|
||
```output | ||
|
@@ -341,7 +341,7 @@ yugabyte=# select * from contact_method_info; | |
Inserting an invalid `ENUM` value would fail, as shown in the following example: | ||
|
||
```sql | ||
yugabyte=# INSERT INTO contact_method_info VALUES ('Jeff', 'Fax', '4563456'); | ||
INSERT INTO contact_method_info VALUES ('Jeff', 'Fax', '4563456'); | ||
``` | ||
|
||
You should see the following error (which is compatible with that of PostgreSQL): | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -289,7 +289,7 @@ The output should be as follows: | |
e_contact_method | Phone | ||
``` | ||
|
||
### 2. Create a table with an `ENUM` column | ||
### 3. Create a table with an `ENUM` column | ||
|
||
```sql | ||
CREATE TABLE contact_method_info ( | ||
|
@@ -299,17 +299,20 @@ CREATE TABLE contact_method_info ( | |
); | ||
``` | ||
|
||
### 3. Insert a row with `ENUM` | ||
### 4. Insert a row with `ENUM` | ||
|
||
The `ENUM` should have a valid value, as follows: | ||
|
||
```sql | ||
INSERT INTO contact_method_info VALUES ('Jeff', 'Email', '[email protected]') | ||
INSERT INTO contact_method_info VALUES ('Jeff', 'Email', '[email protected]'); | ||
``` | ||
|
||
Execute the following to verify: | ||
```sql | ||
select * from contact_method_info; | ||
``` | ||
yugabyte=# select * from contact_method_info; | ||
|
||
```output | ||
contact_name | contact_method | value | ||
--------------+----------------+--------------- | ||
Jeff | Email | [email protected] | ||
|
@@ -319,10 +322,10 @@ yugabyte=# select * from contact_method_info; | |
Inserting an invalid `ENUM` value would fail, as shown in the following example: | ||
|
||
```sql | ||
yugabyte=# INSERT INTO contact_method_info VALUES ('Jeff', 'Fax', '4563456'); | ||
INSERT INTO contact_method_info VALUES ('Jeff', 'Fax', '4563456'); | ||
``` | ||
You should see the following error (which is compatible with that of PostgreSQL): | ||
``` | ||
```output | ||
ERROR: 22P02: invalid input value for enum e_contact_method: "Fax" | ||
LINE 1: INSERT INTO contact_method_info VALUES ('Jeff', 'Fax', '4563... | ||
``` | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -308,7 +308,7 @@ The output should be as follows: | |
e_contact_method | Phone | ||
``` | ||
|
||
### 2. Create a table with an `ENUM` column | ||
### 3. Create a table with an `ENUM` column | ||
|
||
```sql | ||
CREATE TABLE contact_method_info ( | ||
|
@@ -318,18 +318,18 @@ CREATE TABLE contact_method_info ( | |
); | ||
``` | ||
|
||
### 3. Insert a row with `ENUM` | ||
### 4. Insert a row with `ENUM` | ||
|
||
The `ENUM` should have a valid value, as follows: | ||
|
||
```sql | ||
INSERT INTO contact_method_info VALUES ('Jeff', 'Email', '[email protected]') | ||
INSERT INTO contact_method_info VALUES ('Jeff', 'Email', '[email protected]'); | ||
``` | ||
|
||
Execute the following to verify: | ||
|
||
```sql | ||
yugabyte=# select * from contact_method_info; | ||
select * from contact_method_info; | ||
``` | ||
|
||
```output | ||
|
@@ -342,7 +342,7 @@ yugabyte=# select * from contact_method_info; | |
Inserting an invalid `ENUM` value would fail, as shown in the following example: | ||
|
||
```sql | ||
yugabyte=# INSERT INTO contact_method_info VALUES ('Jeff', 'Fax', '4563456'); | ||
INSERT INTO contact_method_info VALUES ('Jeff', 'Fax', '4563456'); | ||
``` | ||
|
||
You should see the following error (which is compatible with that of PostgreSQL): | ||
|