Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
51175f36
Commit
51175f36
authored
Apr 18, 2017
by
Simon Riggs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow COMMENT ON COLUMN with partitioned tables
Amit Langote
parent
b2188575
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
1 deletion
+29
-1
src/backend/commands/comment.c
src/backend/commands/comment.c
+2
-1
src/test/regress/expected/create_table.out
src/test/regress/expected/create_table.out
+19
-0
src/test/regress/sql/create_table.sql
src/test/regress/sql/create_table.sql
+8
-0
No files found.
src/backend/commands/comment.c
View file @
51175f36
...
@@ -94,7 +94,8 @@ CommentObject(CommentStmt *stmt)
...
@@ -94,7 +94,8 @@ CommentObject(CommentStmt *stmt)
relation
->
rd_rel
->
relkind
!=
RELKIND_VIEW
&&
relation
->
rd_rel
->
relkind
!=
RELKIND_VIEW
&&
relation
->
rd_rel
->
relkind
!=
RELKIND_MATVIEW
&&
relation
->
rd_rel
->
relkind
!=
RELKIND_MATVIEW
&&
relation
->
rd_rel
->
relkind
!=
RELKIND_COMPOSITE_TYPE
&&
relation
->
rd_rel
->
relkind
!=
RELKIND_COMPOSITE_TYPE
&&
relation
->
rd_rel
->
relkind
!=
RELKIND_FOREIGN_TABLE
)
relation
->
rd_rel
->
relkind
!=
RELKIND_FOREIGN_TABLE
&&
relation
->
rd_rel
->
relkind
!=
RELKIND_PARTITIONED_TABLE
)
ereport
(
ERROR
,
ereport
(
ERROR
,
(
errcode
(
ERRCODE_WRONG_OBJECT_TYPE
),
(
errcode
(
ERRCODE_WRONG_OBJECT_TYPE
),
errmsg
(
"
\"
%s
\"
is not a table, view, materialized view, composite type, or foreign table"
,
errmsg
(
"
\"
%s
\"
is not a table, view, materialized view, composite type, or foreign table"
,
...
...
src/test/regress/expected/create_table.out
View file @
51175f36
...
@@ -669,3 +669,22 @@ Number of partitions: 3 (Use \d+ to list them.)
...
@@ -669,3 +669,22 @@ Number of partitions: 3 (Use \d+ to list them.)
-- cleanup
-- cleanup
DROP TABLE parted, list_parted, range_parted, list_parted2, range_parted2, range_parted3;
DROP TABLE parted, list_parted, range_parted, list_parted2, range_parted2, range_parted3;
-- comments on partitioned tables columns
CREATE TABLE parted_col_comment (a int, b text) PARTITION BY LIST (a);
COMMENT ON TABLE parted_col_comment IS 'Am partitioned table';
COMMENT ON COLUMN parted_col_comment.a IS 'Partition key';
SELECT obj_description('parted_col_comment'::regclass);
obj_description
----------------------
Am partitioned table
(1 row)
\d+ parted_col_comment
Table "public.parted_col_comment"
Column | Type | Collation | Nullable | Default | Storage | Stats target | Description
--------+---------+-----------+----------+---------+----------+--------------+---------------
a | integer | | | | plain | | Partition key
b | text | | | | extended | |
Partition key: LIST (a)
DROP TABLE parted_col_comment;
src/test/regress/sql/create_table.sql
View file @
51175f36
...
@@ -597,3 +597,11 @@ CREATE TABLE part_c_1_10 PARTITION OF part_c FOR VALUES FROM (1) TO (10);
...
@@ -597,3 +597,11 @@ CREATE TABLE part_c_1_10 PARTITION OF part_c FOR VALUES FROM (1) TO (10);
-- cleanup
-- cleanup
DROP
TABLE
parted
,
list_parted
,
range_parted
,
list_parted2
,
range_parted2
,
range_parted3
;
DROP
TABLE
parted
,
list_parted
,
range_parted
,
list_parted2
,
range_parted2
,
range_parted3
;
-- comments on partitioned tables columns
CREATE
TABLE
parted_col_comment
(
a
int
,
b
text
)
PARTITION
BY
LIST
(
a
);
COMMENT
ON
TABLE
parted_col_comment
IS
'Am partitioned table'
;
COMMENT
ON
COLUMN
parted_col_comment
.
a
IS
'Partition key'
;
SELECT
obj_description
(
'parted_col_comment'
::
regclass
);
\
d
+
parted_col_comment
DROP
TABLE
parted_col_comment
;
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment