microsoft / azuredatastudio-postgresql

azuredatastudio-postgresql is an extension for Azure Data Studio that enables you to work with PostgreSQL databases
Other
193 stars 36 forks source link

Table context menu selection "Script as Create" does not include all table relevant settings (at least description comments) #492

Open FrySlim opened 6 months ago

FrySlim commented 6 months ago

I have a feature request:

When I do a "Script as Create" on a Postgres database table (ADS v1.47 with Postgres plugin v0.6.0), following statements are built:

In case a COMMENT was set on an table and/or a column, the following appropriate statements should additionally be built:

Further more (just guessing that its also missing here):

You can check the comment like this in Postgres:

-- check comment on table myschema."MyTable": SELECT obj_description('myschema."MyTable"'::regclass); -- check comment on column "MyColumn" on table myschema."MyTable": SELECT col_description('myschema."MyTable"'::regclass::oid, (SELECT attnum FROM pg_attribute WHERE attrelid = 'myschema."MyTable"'::regclass AND attname = 'MyColumn'));

GennadNY commented 6 months ago

@FrySlim - what PG version are you working with?

FrySlim commented 6 months ago

At least PG 11 and newer.