Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
postgres-lambda-diff
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jakob Huber
postgres-lambda-diff
Commits
51175f36
Commit
51175f36
authored
8 years ago
by
Simon Riggs
Browse files
Options
Downloads
Patches
Plain Diff
Allow COMMENT ON COLUMN with partitioned tables
Amit Langote
parent
b2188575
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/backend/commands/comment.c
+2
-1
2 additions, 1 deletion
src/backend/commands/comment.c
src/test/regress/expected/create_table.out
+19
-0
19 additions, 0 deletions
src/test/regress/expected/create_table.out
src/test/regress/sql/create_table.sql
+8
-0
8 additions, 0 deletions
src/test/regress/sql/create_table.sql
with
29 additions
and
1 deletion
src/backend/commands/comment.c
+
2
−
1
View file @
51175f36
...
...
@@ -94,7 +94,8 @@ CommentObject(CommentStmt *stmt)
relation
->
rd_rel
->
relkind
!=
RELKIND_VIEW
&&
relation
->
rd_rel
->
relkind
!=
RELKIND_MATVIEW
&&
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
,
(
errcode
(
ERRCODE_WRONG_OBJECT_TYPE
),
errmsg
(
"
\"
%s
\"
is not a table, view, materialized view, composite type, or foreign table"
,
...
...
This diff is collapsed.
Click to expand it.
src/test/regress/expected/create_table.out
+
19
−
0
View file @
51175f36
...
...
@@ -669,3 +669,22 @@ Number of partitions: 3 (Use \d+ to list them.)
-- cleanup
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;
This diff is collapsed.
Click to expand it.
src/test/regress/sql/create_table.sql
+
8
−
0
View file @
51175f36
...
...
@@ -597,3 +597,11 @@ CREATE TABLE part_c_1_10 PARTITION OF part_c FOR VALUES FROM (1) TO (10);
-- cleanup
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
;
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment