Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] Support Invisible Columns #401

Open
wants to merge 4 commits into
base: POLARDB_11_DEV
Choose a base branch
from

Conversation

YinZheng-Sun
Copy link

Problem Summary:

Fix #389
After Oracle 12c, users have the ability to customize hidden columns in an invisible form. Hidden columns play a crucial role in facilitating the migration and development of user applications, significantly enhancing the flexibility of table usage.
The objective of this project is to provide support for users to specify the hidden attribute of a column during the CREATE TABLE or ALTER TABLE statements, while being compatible with Oracle's syntax for hidden columns.

What type of PR is this:

  • BugFix
  • Feature
  • Enhancement
  • Refactor
  • UT
  • Doc
  • Tool

Checklist:

  • I have added test cases for my new feature

@CLAassistant
Copy link

CLAassistant commented Jul 17, 2023

CLA assistant check
All committers have signed the CLA.

@polardb-bot
Copy link
Contributor

polardb-bot bot commented Jul 17, 2023

Hi @YinZheng-Sun ~ Congratulations to your first PR to PolarDB. 🎉

Please make sure that your PR conforms the standard, and has passed all the checks.

We will review your PR as soon as possible.

@YinZheng-Sun YinZheng-Sun changed the base branch from POLARDB_11_STABLE to POLARDB_11_DEV July 18, 2023 12:41
@polardb-bot
Copy link
Contributor

polardb-bot bot commented Jul 18, 2023

Hey @YinZheng-Sun :

Something wrong occuried during the checks of your commit 😟, please check the detail:

⚠️ regression (DMA) CIRRUS_ARCH:arm64 arm_container:polardb/polardb_pg_devel:centos7 View more details

✅ 02:20 clone
❌ 28:05 main

! create user normal_user2;
! grant pg_read_all_settings to normal_user2;
! ERROR:  must have admin option on role "pg_read_all_settings"
! revoke pg_read_all_settings from normal_user2;
! ERROR:  must have admin option on role "pg_read_all_settings"
! grant pg_read_all_stats to normal_user2;
! revoke pg_read_all_stats from normal_user2;
! grant pg_stat_scan_tables to normal_user2;
! revoke pg_stat_scan_tables from normal_user2;
! grant pg_monitor to normal_user2;
! ERROR:  must have admin option on role "pg_monitor"
! revoke pg_monitor from normal_user2;
! ERROR:  must have admin option on role "pg_monitor"
! grant pg_signal_backend to normal_user2;
! revoke pg_signal_backend from normal_user2;
! grant pg_read_server_files to normal_user2;
! ERROR:  must have admin option on role "pg_read_server_files"
! revoke pg_read_server_files from normal_user2;
! ERROR:  must have admin option on role "pg_read_server_files"
! grant pg_write_server_files to normal_user2;
! ERROR:  must have admin option on role "pg_write_server_files"
! revoke pg_write_server_files from normal_user2;
! ERROR:  must have admin option on role "pg_write_server_files"
! grant pg_execute_server_program to normal_user2;
! ERROR:  must have admin option on role "pg_execute_server_program"
! revoke pg_execute_server_program from normal_user2;
! ERROR:  must have admin option on role "pg_execute_server_program"
! grant pg_polar_superuser to normal_user2;
! revoke pg_polar_superuser from normal_user2;
! select pg_has_role('pg_signal_backend','USAGE');
!  pg_has_role 
! -------------
!  t
! (1 row)
! 
! select pg_has_role('pg_signal_backend','MEMBER');
!  pg_has_role 
! -------------
!  t
! (1 row)
! 
! select pg_has_role('pg_signal_backend','USAGE WITH GRANT OPTION');
!  pg_has_role 
! -------------
!  t
! (1 row)
! 
! reset session authorization;
! drop user normal_user1;
! drop user normal_user2;
! drop user user_with_createrole;
! drop user polaruser;
--- 1 ----
! psql: FATAL:  the database system is in recovery mode

======================================================================
⚠️ regression (OLAP) CIRRUS_ARCH:arm64 arm_container:polardb/polardb_pg_devel:centos7 View more details

✅ 02:38 clone
❌ 26:18 main

2023-07-18 13:43:20.798 UTC [20614] LOG:  removing file "pg_notify/0000"
2023-07-18 13:43:20.798 UTC [20614] LOG:  vfs_unlink pg_notify/0000
2023-07-18 13:43:20.798 UTC [20614] WARNING:  getrlimit failed: Operation not permitted
2023-07-18 13:43:20.800 UTC [20614] WARNING:  failed to open file /proc/20615/sched
	
2023-07-18 13:43:20.800 UTC [20614] LOG:  redirecting log output to logging collector process
2023-07-18 13:43:20.800 UTC [20614] HINT:  Future log output will appear in directory "pg_log".
.................................................. done
server started
pg_ctl: directory "/home/postgres/tmp_replica_dir_polardb_pg_1100_bld2" does not exist
pg_ctl: cannot set core file size limit; disallowed by hard limit
waiting for server to start....2023-07-18 13:44:11.560 UTC [20631] LOG:  /home/postgres/tmp_replica_dir_polardb_pg_1100_bld2/polar_node_static.conf does not exist, we create it, This is best done on the first boot and not on restart
2023-07-18 13:44:11.881 UTC [20631] WARNING:  polardb skip readControlfile
2023-07-18 13:44:11.881 UTC [20631] LOG:  polar_replica = 'on'
2023-07-18 13:44:11.881 UTC [20631] LOG:  read polar_replica = on, polardb in replica mode, use ro mode mount pfs
2023-07-18 13:44:11.882 UTC [20631] LOG:  polar_vfs loaded in postmaster 20631
2023-07-18 13:44:11.885 UTC [20631] WARNING:  could not access file "polar_resource_group": No such file or directory
2023-07-18 13:44:11.889 UTC [20631] LOG:  Auto detecting polar_stat_sql.linux_hz parameter...
2023-07-18 13:44:11.889 UTC [20631] LOG:  polar_stat_sql.linux_hz is set to 1000000
2023-07-18 13:44:11.895 UTC [20631] LOG:  listening on IPv4 address "0.0.0.0", port 5434
2023-07-18 13:44:11.895 UTC [20631] LOG:  listening on IPv6 address "::", port 5434
...2023-07-18 13:44:14.868 UTC [20631] LOG:  listening on Unix socket "./.s.PGSQL.5434"
2023-07-18 13:44:14.953 UTC [20631] LOG:  clog buffer max slot size is 256, and it will be set to 256
2023-07-18 13:44:14.953 UTC [20631] LOG:  commit timestamp buffer max slot size is 128, and it will set to 16
2023-07-18 13:44:14.953 UTC [20631] LOG:  The total log index memory table size is 402525528
2023-07-18 13:44:14.953 UTC [20631] LOG:  The total log index memory table size is 133987128
2023-07-18 13:44:14.953 UTC [20631] LOG:  The total log index memory table size is 66993864
2023-07-18 13:44:15.398 UTC [20631] LOG:  init vfs_mount_state done
2023-07-18 13:44:15.398 UTC [20631] LOG:  Database will be in readonly mode
2023-07-18 13:44:15.398 UTC [20631] LOG:  pfs in localfs mode
2023-07-18 13:44:15.398 UTC [20631] LOG:  PolarIOStatArray share memory total size is 697320
2023-07-18 13:44:15.398 UTC [20631] LOG:  PolarGlobalIOReadStats share memory size is 176
2023-07-18 13:44:15.398 UTC [20631] LOG:  polar_vfs init done
2023-07-18 13:44:15.398 UTC [20631] LOG:  polar_lwlocks_stat_array share memory total size is 757760
2023-07-18 13:44:15.399 UTC [20631] LOG:  polar_locks_stat_array share memory total size is 473600
2023-07-18 13:44:15.399 UTC [20631] LOG:  polar_network_stat_array share memory total size is 14304
2023-07-18 13:44:15.400 UTC [20631] LOG:  polardb delay load controlfile
2023-07-18 13:44:15.406 UTC [20631] LOG:  clog buffer max slot size is 256, and it will be set to 256
2023-07-18 13:44:15.406 UTC [20631] LOG:  commit timestamp buffer max slot size is 128, and it will set to 16
2023-07-18 13:44:15.408 UTC [20631] LOG:  The total log index memory table size is 402525528
2023-07-18 13:44:15.408 UTC [20631] LOG:  vfs open dir /home/postgres/tmp_replica_dir_polardb_pg_1100_bld2/polar_rel_size_cache, num open dir 1
.2023-07-18 13:44:15.604 UTC [20631] LOG:  rename pg_logindex to local cache trash polar_cache_trash/pg_logindex_0000, errno=2
2023-07-18 13:44:15.604 UTC [20631] LOG:  The total log index memory table size is 133987128
2023-07-18 13:44:15.605 UTC [20631] LOG:  rename polar_fullpage to local cache trash polar_cache_trash/polar_fullpage_0001, errno=39
2023-07-18 13:44:15.617 UTC [20631] LOG:  The total log index memory table size is 66993864
2023-07-18 13:44:15.622 UTC [20631] LOG:  vfs open dir pg_notify, num open dir 1
2023-07-18 13:44:15.622 UTC [20631] LOG:  removing file "pg_notify/0000"
2023-07-18 13:44:15.622 UTC [20631] LOG:  vfs_unlink pg_notify/0000
2023-07-18 13:44:15.623 UTC [20631] WARNING:  getrlimit failed: Operation not permitted
2023-07-18 13:44:15.624 UTC [20631] WARNING:  failed to open file /proc/20734/sched
	
2023-07-18 13:44:15.624 UTC [20631] LOG:  redirecting log output to logging collector process
2023-07-18 13:44:15.624 UTC [20631] HINT:  Future log output will appear in directory "pg_log".
....................................................... stopped waiting
pg_ctl: server did not start in time
������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������

@polardb-bot polardb-bot bot added the ci/failure CI status is failure label Jul 18, 2023
@YinZheng-Sun YinZheng-Sun force-pushed the INVISIBLE branch 2 times, most recently from 847f80f to 1ccabe7 Compare July 18, 2023 14:33
@polardb-bot
Copy link
Contributor

polardb-bot bot commented Jul 18, 2023

Hey @YinZheng-Sun :

Something wrong occuried during the checks of your commit 😟, please check the detail:

⚠️ regression (OLTP) CIRRUS_ARCH:arm64 arm_container:polardb/polardb_pg_devel:centos7 View more details

ℹ️ Scheduling was delayed due to a concurrency limit on community tasks
ℹ️ Consider upgrading to a $10/month plan to get 2x the limits on any public and private repository

✅ 02:21 clone
❌ 01:57:37 main

test select_having                ... ok (1.04 s)
test subselect                    ... ok (12.43 s)
test union                        ... ok (10.75 s)
test case                         ... ok (10.37 s)
test join                         ... ok (181.60 s)
test aggregates                   ... ok (42.10 s)
test transactions                 ... ok (32.30 s)
test random                       ... ok (0.84 s)
test portals                      ... ok (5.90 s)
test arrays                       ... ok (27.63 s)
test btree_index                  ... ok (27.90 s)
test hash_index                   ... ok (46.84 s)
test update                       ... ok (315.90 s)
test delete                       ... ok (10.60 s)
test namespace                    ... ok (4.53 s)
test prepared_xacts               ... ok (2.40 s)
test brin                         ... ok (35.08 s)
test gin                          ... ok (25.13 s)
test gist                         ... ok (105.62 s)
test spgist                       ... ok (66.23 s)
test privileges                   ... ok (82.35 s)
test init_privs                   ... ok (1.11 s)
test security_label               ... ok (7.40 s)
test collate                      ... ok (34.43 s)
test matview                      ... ok (65.85 s)
test lock                         ... ok (4.03 s)
test replica_identity             ... ok (32.95 s)
test rowsecurity                  ... ok (128.29 s)
test object_address               ... ok (13.95 s)
test tablesample                  ... ok (5.31 s)
test groupingsets                 ... ok (3.16 s)
test drop_operator                ... ok (5.54 s)
test password                     ... ok (7.38 s)
test alter_generic                ... ok (29.06 s)
test alter_operator               ... ok (1.02 s)
test misc                         ... ok (39.45 s)
test psql                         ... ok (polar ignored) (3.04 s)
test async                        ... ok (0.08 s)
test dbsize                       ... ok (0.06 s)
test misc_functions               ... ok (0.12 s)
test sysviews                     ... ok (0.23 s)
test tsrf                         ... ok (2.94 s)
test tidscan                      ... ok (3.20 s)
test stats_ext                    ... ok (67.33 s)
test rules                        ... ok (155.41 s)
test psql_crosstab                ... ok (5.15 s)
test select_parallel              ... ok (76.74 s)
test write_parallel               ... ok (11.04 s)
test publication                  ... ok (34.54 s)
test subscription                 ... ok (2.56 s)
test amutils                      ... ok (1.01 s)
test select_views                 ... ok (7.62 s)
test portals_p2                   ... ok (0.11 s)
test foreign_key                  ... ok (167.35 s)
test cluster                      ... 
Timed out!������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������
⚠️ regression (DMA) CIRRUS_ARCH:arm64 arm_container:polardb/polardb_pg_devel:centos7 View more details

ℹ️ Scheduling was delayed due to a concurrency limit on community tasks
ℹ️ Consider upgrading to a $10/month plan to get 2x the limits on any public and private repository

✅ 02:27 clone
❌ 01:33:13 main

     tsdicts                      ... ok (56.52 s)
     foreign_data                 ... ok (365.83 s)
     window                       ... ok (78.21 s)
     xmlmap                       ... ok (23.93 s)
     functional_deps              ... ok (34.54 s)
     advisory_lock                ... ok (0.18 s)
     json                         ... ok (65.28 s)
     jsonb                        ... ok (80.21 s)
     json_encoding                ... ok (0.17 s)
     indirect_toast               ... ok (52.10 s)
     equivclass                   ... ok (98.06 s)
parallel group (19 tests):  limit prepare conversion returning largeobject xml plancache without_oid rowtypes with temp copy2 polymorphism sequence truncate rangefuncs domain plpgsql alter_table
     plancache                    ... ok (56.72 s)
     limit                        ... ok (1.61 s)
     plpgsql                      ... ok (597.38 s)
     copy2                        ... ok (94.62 s)
     temp                         ... ok (91.24 s)
     domain                       ... ok (307.35 s)
     rangefuncs                   ... ok (181.82 s)
     prepare                      ... ok (5.19 s)
     without_oid                  ... ok (57.28 s)
     conversion                   ... ok (14.50 s)
     truncate                     ... ok (polar ignored) (140.62 s)
     alter_table                  ... ok (804.08 s)
     sequence                     ... ok (130.12 s)
     polymorphism                 ... ok (129.34 s)
     rowtypes                     ... ok (57.28 s)
     returning                    ... ok (21.61 s)
     largeobject                  ... ok (45.99 s)
     with                         ... ok (86.67 s)
     xml                          ... ok (45.99 s)
parallel group (7 tests):  hash_part reloptions identity partition_aggregate partition_join partition_prune indexing
     identity                     ... ok (42.07 s)
     partition_join               ... ok (215.17 s)
     partition_prune              ... ok (277.12 s)
     reloptions                   ... ok (8.25 s)
     hash_part                    ... ok (3.51 s)
     indexing                     ... ok (348.40 s)
     partition_aggregate          ... ok (46.24 s)
test event_trigger                ... ok (38.33 s)
test fast_default                 ... ok (95.99 s)
test stats                        ... ok (24.09 s)
test polar_release_date_1         ... ok (9.03 s)
test polar_invalid_memory_alloc_1 ... ok (23.95 s)
test alter_promoting_polar_superuser_issue11 ... ok (110.20 s)
test polar_rds_patch_test         ... ok (170.43 s)
test polar_superuser_internal_allowed_roles ... ok (3.24 s)
test polar_bugfix_grant_role      ... ok (19.64 s)
============== shutting down postmaster               ==============
pg_ctl: server does not shut down

pg_regress: could not stop postmaster: exit code was 0, 256, 0
make[1]: *** [GNUmakefile:138: check] Error 2
make[1]: Leaving directory '/tmp/cirrus-ci-build/src/test/regress'
make: *** [GNUmakefile:72: polar-check] Error 2
����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������
⚠️ regression (OLAP) CIRRUS_ARCH:arm64 arm_container:polardb/polardb_pg_devel:centos7 View more details

ℹ️ Scheduling was delayed due to a concurrency limit on community tasks
ℹ️ Consider upgrading to a $10/month plan to get 2x the limits on any public and private repository

✅ 02:54 clone
❌ 24:59 main

2023-07-18 16:06:13.375 UTC [20584] LOG:  removing file "pg_notify/0000"
2023-07-18 16:06:13.375 UTC [20584] LOG:  vfs_unlink pg_notify/0000
2023-07-18 16:06:13.375 UTC [20584] WARNING:  getrlimit failed: Operation not permitted
2023-07-18 16:06:13.376 UTC [20584] WARNING:  failed to open file /proc/20585/sched
	
2023-07-18 16:06:13.376 UTC [20584] LOG:  redirecting log output to logging collector process
2023-07-18 16:06:13.376 UTC [20584] HINT:  Future log output will appear in directory "pg_log".
......... done
server started
pg_ctl: directory "/home/postgres/tmp_replica_dir_polardb_pg_1100_bld1" does not exist
pg_ctl: cannot set core file size limit; disallowed by hard limit
waiting for server to start....2023-07-18 16:06:22.264 UTC [20613] LOG:  /home/postgres/tmp_replica_dir_polardb_pg_1100_bld1/polar_node_static.conf does not exist, we create it, This is best done on the first boot and not on restart
2023-07-18 16:06:22.445 UTC [20613] WARNING:  polardb skip readControlfile
2023-07-18 16:06:22.549 UTC [20613] LOG:  polar_replica = 'on'
2023-07-18 16:06:22.549 UTC [20613] LOG:  read polar_replica = on, polardb in replica mode, use ro mode mount pfs
2023-07-18 16:06:22.550 UTC [20613] LOG:  polar_vfs loaded in postmaster 20613
2023-07-18 16:06:22.553 UTC [20613] WARNING:  could not access file "polar_resource_group": No such file or directory
2023-07-18 16:06:22.557 UTC [20613] LOG:  Auto detecting polar_stat_sql.linux_hz parameter...
2023-07-18 16:06:22.557 UTC [20613] LOG:  polar_stat_sql.linux_hz is set to 1000000
2023-07-18 16:06:22.564 UTC [20613] LOG:  listening on IPv4 address "0.0.0.0", port 5433
2023-07-18 16:06:22.564 UTC [20613] LOG:  listening on IPv6 address "::", port 5433
.2023-07-18 16:06:23.896 UTC [20613] LOG:  listening on Unix socket "./.s.PGSQL.5433"
2023-07-18 16:06:24.118 UTC [20613] LOG:  clog buffer max slot size is 256, and it will be set to 256
2023-07-18 16:06:24.118 UTC [20613] LOG:  commit timestamp buffer max slot size is 128, and it will set to 16
2023-07-18 16:06:24.119 UTC [20613] LOG:  The total log index memory table size is 402525528
2023-07-18 16:06:24.119 UTC [20613] LOG:  The total log index memory table size is 133987128
2023-07-18 16:06:24.119 UTC [20613] LOG:  The total log index memory table size is 66993864
.2023-07-18 16:06:24.595 UTC [20613] LOG:  init vfs_mount_state done
2023-07-18 16:06:24.595 UTC [20613] LOG:  Database will be in readonly mode
2023-07-18 16:06:24.595 UTC [20613] LOG:  pfs in localfs mode
2023-07-18 16:06:24.595 UTC [20613] LOG:  PolarIOStatArray share memory total size is 697320
2023-07-18 16:06:24.596 UTC [20613] LOG:  PolarGlobalIOReadStats share memory size is 176
2023-07-18 16:06:24.596 UTC [20613] LOG:  polar_vfs init done
2023-07-18 16:06:24.596 UTC [20613] LOG:  polar_lwlocks_stat_array share memory total size is 757760
2023-07-18 16:06:24.596 UTC [20613] LOG:  polar_locks_stat_array share memory total size is 473600
2023-07-18 16:06:24.596 UTC [20613] LOG:  polar_network_stat_array share memory total size is 14304
2023-07-18 16:06:24.598 UTC [20613] LOG:  polardb delay load controlfile
2023-07-18 16:06:24.604 UTC [20613] LOG:  clog buffer max slot size is 256, and it will be set to 256
2023-07-18 16:06:24.604 UTC [20613] LOG:  commit timestamp buffer max slot size is 128, and it will set to 16
2023-07-18 16:06:24.605 UTC [20613] LOG:  The total log index memory table size is 402525528
2023-07-18 16:06:24.606 UTC [20613] LOG:  vfs open dir /home/postgres/tmp_replica_dir_polardb_pg_1100_bld1/polar_rel_size_cache, num open dir 1
2023-07-18 16:06:24.810 UTC [20613] LOG:  rename pg_logindex to local cache trash polar_cache_trash/pg_logindex_0000, errno=2
2023-07-18 16:06:24.810 UTC [20613] LOG:  The total log index memory table size is 133987128
2023-07-18 16:06:24.810 UTC [20613] LOG:  rename polar_fullpage to local cache trash polar_cache_trash/polar_fullpage_0001, errno=39
2023-07-18 16:06:24.823 UTC [20613] LOG:  The total log index memory table size is 66993864
2023-07-18 16:06:24.828 UTC [20613] LOG:  vfs open dir pg_notify, num open dir 1
2023-07-18 16:06:24.828 UTC [20613] LOG:  removing file "pg_notify/0000"
2023-07-18 16:06:24.828 UTC [20613] LOG:  vfs_unlink pg_notify/0000
2023-07-18 16:06:24.828 UTC [20613] WARNING:  getrlimit failed: Operation not permitted
2023-07-18 16:06:24.830 UTC [20613] WARNING:  failed to open file /proc/20614/sched
	
2023-07-18 16:06:24.830 UTC [20613] LOG:  redirecting log output to logging collector process
2023-07-18 16:06:24.830 UTC [20613] HINT:  Future log output will appear in directory "pg_log".
......................................................... stopped waiting
pg_ctl: server did not start in time
������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������

@polardb-bot polardb-bot bot added ci/failure CI status is failure and removed ci/failure CI status is failure labels Jul 18, 2023
@polardb-bot
Copy link
Contributor

polardb-bot bot commented Jul 19, 2023

Hey @YinZheng-Sun :

Congratulations~ 🎉 Your commit has passed all the checks. Please wait for further manual review.

@polardb-bot polardb-bot bot added ci/success CI status is success and removed ci/failure CI status is failure labels Jul 19, 2023
@@ -162,6 +162,7 @@ DefineSequence(ParseState *pstate, CreateSeqStmt *seq)
ColumnDef *coldef = makeNode(ColumnDef);

coldef->inhcount = 0;
coldef->is_invisible = false;
coldef->is_local = true;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

不需要特意初始化,makeNode会做初始化。

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
errmsg("cannot alter system column \"%s\"",
colName)));

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

建议考虑下分区表和继承表的场景,父子表的行为应该一致。

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

* lookup the attribute
*/
attr_rel = heap_open(AttributeRelationId, RowExclusiveLock);

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

考虑下typed table场景,是否要支持。

(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
errmsg("cannot alter system column \"%s\"",
colName)));

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

同样要考虑分区表、继承表

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

((Form_pg_attribute) GETSTRUCT(tuple))->attisinvisible = true;

CatalogTupleUpdate(attr_rel, &tuple->t_self, tuple);

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这样会导致所有列都可隐藏,应当至少有一列是非隐藏的。

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@@ -220,6 +220,7 @@ PG_KEYWORD("integer", INTEGER, COL_NAME_KEYWORD)
PG_KEYWORD("intersect", INTERSECT, RESERVED_KEYWORD)
PG_KEYWORD("interval", INTERVAL, COL_NAME_KEYWORD)
PG_KEYWORD("into", INTO, RESERVED_KEYWORD)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

作为保留关键字过于严格

b INT
);


Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

类比Oracle,对比下隐藏列的join行为。

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

INSERT INTO TEST_INVISIBLE_TBL2 VALUES (1);
INSERT INTO TEST_INVISIBLE_TBL2 VALUES (1, 1);
INSERT INTO TEST_INVISIBLE_TBL2 (a, b) VALUES (1, 1);

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

select I_SEL_t.* FROM I_SEL_t;
select (I_SEL_t).* FROM I_SEL_t;

这种场景如何处理?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

增加了测试


INSERT INTO TEST_INVISIBLE_TBL3 VALUES (1);
INSERT INTO TEST_INVISIBLE_TBL3 (a, b) VALUES (1, 1);

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CREATE TABLE I_SEL_type(i int, j int INVISIBLE, k int);

SELECT (1)::I_SEL_t;
SELECT (1,2)::I_SEL_t;
SELECT (1,2)::I_SEL_type;
SELECT ((1,2)::I_SEL_type).*;
SELECT ((1,2)::I_SEL_type).i;
SELECT ((1,2)::I_SEL_type).j;

对于类型转换的测试场景可以在测试一下

| ALTER opt_column ColId SET INVISIBLE
{
AlterTableCmd *n = makeNode(AlterTableCmd);
n->subtype = AT_SetInvisible;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

添加ALTER TABLE I_SEL_t MODIFY i VISIBLE;

Modify语法

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@polardb-bot
Copy link
Contributor

polardb-bot bot commented Sep 6, 2023

Hey @YinZheng-Sun :

Something wrong occuried during the checks of your commit 😟, please check the detail:

⚠️ build (centos7, oltp) View more details

@polardb-bot polardb-bot bot removed the ci/success CI status is success label Sep 6, 2023
@polardb-bot polardb-bot bot added the ci/failure CI status is failure label Sep 6, 2023
@polardb-bot
Copy link
Contributor

polardb-bot bot commented Sep 6, 2023

Hey @YinZheng-Sun :

Congratulations~ 🎉 Your commit has passed all the checks. Please wait for further manual review.

@polardb-bot polardb-bot bot added ci/success CI status is success and removed ci/failure CI status is failure labels Sep 6, 2023
@polardb-bot
Copy link
Contributor

polardb-bot bot commented Sep 27, 2023

Hey @YinZheng-Sun :

Congratulations~ 🎉 Your commit has passed all the checks. Please wait for further manual review.

@polardb-bot polardb-bot bot added ci/success CI status is success and removed ci/success CI status is success labels Sep 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci/success CI status is success
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[GLCC]PolarDB兼容用户自定义可隐藏列
3 participants