-
Notifications
You must be signed in to change notification settings - Fork 870
Fixed View/Edit Data not handling generated columns properly. #9672 #9761
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
Open
RohitBhati8269
wants to merge
2
commits into
pgadmin-org:master
Choose a base branch
from
RohitBhati8269:GH-9672
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
40 changes: 40 additions & 0 deletions
40
...er/server_groups/servers/databases/schemas/tables/templates/columns/sql/12_plus/nodes.sql
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| SELECT DISTINCT att.attname as name, att.attnum as OID, pg_catalog.format_type(ty.oid,NULL) AS datatype, | ||
| pg_catalog.format_type(ty.oid,att.atttypmod) AS displaytypname, | ||
| att.attnotnull as not_null, | ||
| CASE WHEN att.atthasdef OR att.attidentity != '' OR ty.typdefault IS NOT NULL THEN True | ||
| ELSE False END as has_default_val, des.description, seq.seqtypid, | ||
| {# Detect generated columns to exclude from INSERT/UPDATE in View/Edit Data #} | ||
| CASE WHEN att.attgenerated = 's' THEN true ELSE false END as is_generated | ||
| FROM pg_catalog.pg_attribute att | ||
| JOIN pg_catalog.pg_type ty ON ty.oid=atttypid | ||
| JOIN pg_catalog.pg_namespace tn ON tn.oid=ty.typnamespace | ||
| JOIN pg_catalog.pg_class cl ON cl.oid=att.attrelid | ||
| JOIN pg_catalog.pg_namespace na ON na.oid=cl.relnamespace | ||
| LEFT OUTER JOIN pg_catalog.pg_type et ON et.oid=ty.typelem | ||
| LEFT OUTER JOIN pg_catalog.pg_attrdef def ON adrelid=att.attrelid AND adnum=att.attnum | ||
| LEFT OUTER JOIN (pg_catalog.pg_depend JOIN pg_catalog.pg_class cs ON classid='pg_class'::regclass AND objid=cs.oid AND cs.relkind='S') ON refobjid=att.attrelid AND refobjsubid=att.attnum | ||
| LEFT OUTER JOIN pg_catalog.pg_namespace ns ON ns.oid=cs.relnamespace | ||
| LEFT OUTER JOIN pg_catalog.pg_index pi ON pi.indrelid=att.attrelid AND indisprimary | ||
| LEFT OUTER JOIN pg_catalog.pg_description des ON (des.objoid=att.attrelid AND des.objsubid=att.attnum AND des.classoid='pg_class'::regclass) | ||
| LEFT OUTER JOIN pg_catalog.pg_sequence seq ON cs.oid=seq.seqrelid | ||
| WHERE | ||
|
|
||
| {% if tid %} | ||
| att.attrelid = {{ tid|qtLiteral(conn) }}::oid | ||
| {% endif %} | ||
| {% if table_name and table_nspname %} | ||
| cl.relname= {{table_name |qtLiteral(conn)}} and na.nspname={{table_nspname|qtLiteral(conn)}} | ||
| {% endif %} | ||
| {% if clid %} | ||
| AND att.attnum = {{ clid|qtLiteral(conn) }} | ||
| {% endif %} | ||
| {### To show system objects ###} | ||
| {% if not show_sys_objects and not has_oids %} | ||
| AND att.attnum > 0 | ||
| {% endif %} | ||
| {### To show oids in view data ###} | ||
| {% if has_oids %} | ||
| AND (att.attnum > 0 OR (att.attname = 'oid' AND att.attnum < 0)) | ||
| {% endif %} | ||
| AND att.attisdropped IS FALSE | ||
| ORDER BY att.attnum |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.