public inbox for [email protected]  
help / color / mirror / Atom feed
[pgAdmin][RM-6925]: [SQL] Syntax Error display if select "Custom auto-vacuum" option and not set Autovaccuum option as Yes or No
2+ messages / 2 participants
[nested] [flat]

* [pgAdmin][RM-6925]: [SQL] Syntax Error display if select "Custom auto-vacuum" option and not set Autovaccuum option as Yes or No
@ 2021-11-11 04:20 Nikhil Mohite <[email protected]>
  2021-11-11 07:26 ` Re: [pgAdmin][RM-6925]: [SQL] Syntax Error display if select "Custom auto-vacuum" option and not set Autovaccuum option as Yes or No Akshay Joshi <[email protected]>
  0 siblings, 1 reply; 2+ messages in thread

From: Nikhil Mohite @ 2021-11-11 04:20 UTC (permalink / raw)
  To: pgadmin-hackers

Hi Hackers,

Please find the attached patch for RM-6925:
<https://redmine.postgresql.org/issues/6925;  [SQL] Syntax Error display if
select "Custom auto-vacuum" option and not set Autovaccuum option as Yes or
No.


-- 
*Thanks & Regards,*
*Nikhil Mohite*
*Senior Software Engineer.*
*EDB Postgres* <https://www.enterprisedb.com/;
*Mob.No: +91-7798364578.*


Attachments:

  [application/octet-stream] RM-6925.patch (2.5K, 3-RM-6925.patch)
  download | inline diff:
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/tables/sql/12_plus/create.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/tables/sql/12_plus/create.sql
index 39ecfe04..c43de881 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/tables/sql/12_plus/create.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/tables/sql/12_plus/create.sql
@@ -17,7 +17,7 @@
 {% set empty_bracket = "\n(\n)"%}
 {% endif %}
 {% set with_clause = false%}
-{% if data.fillfactor or data.parallel_workers or data.toast_tuple_target or data.autovacuum_custom or data.autovacuum_enabled in ('t', 'f') or data.toast_autovacuum or data.toast_autovacuum_enabled in ('t', 'f') %}
+{% if data.fillfactor or data.parallel_workers or data.toast_tuple_target or (data.autovacuum_custom and data.add_vacuum_settings_in_sql) or data.autovacuum_enabled in ('t', 'f') or (data.toast_autovacuum and data.add_vacuum_settings_in_sql) or data.toast_autovacuum_enabled in ('t', 'f') %}
 {% set with_clause = true%}
 {% endif %}
 CREATE {% if data.relpersistence %}UNLOGGED {% endif %}TABLE{% if add_not_exists_clause %} IF NOT EXISTS{% endif %} {{conn|qtIdent(data.schema, data.name)}}{{empty_bracket}}
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/utils.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/utils.py
index aca27fd0..549febd3 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/utils.py
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/utils.py
@@ -2096,8 +2096,16 @@ class BaseTableView(PGChildNodeView, BasePartitionTable, VacuumSettings):
         if data is None:
             if vacuum_key in old_data:
                 for opt in old_data[vacuum_key]:
-                    if 'value' in opt and opt['value'] is None:
+                    if 'add_vacuum_settings_in_sql' not in old_data:
+                        old_data['add_vacuum_settings_in_sql'] = False
+
+                    if ('value' in opt and opt['value'] is None) or ('value' in opt and opt['value'] == ''):
                         opt.pop('value')
+
+                    if 'value' in opt and 'add_vacuum_settings_in_sql' in old_data and not old_data['add_vacuum_settings_in_sql']:
+                        old_data['add_vacuum_settings_in_sql'] = True
+
+
         # Iterate vacuum table
         elif vacuum_key in data and 'changed' in data[vacuum_key] \
                 and vacuum_key in old_data:


^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: [pgAdmin][RM-6925]: [SQL] Syntax Error display if select "Custom auto-vacuum" option and not set Autovaccuum option as Yes or No
  2021-11-11 04:20 [pgAdmin][RM-6925]: [SQL] Syntax Error display if select "Custom auto-vacuum" option and not set Autovaccuum option as Yes or No Nikhil Mohite <[email protected]>
@ 2021-11-11 07:26 ` Akshay Joshi <[email protected]>
  0 siblings, 0 replies; 2+ messages in thread

From: Akshay Joshi @ 2021-11-11 07:26 UTC (permalink / raw)
  To: Nikhil Mohite <[email protected]>; +Cc: pgadmin-hackers

Thanks, the patch applied.

On Thu, Nov 11, 2021 at 9:51 AM Nikhil Mohite <
[email protected]> wrote:

> Hi Hackers,
>
> Please find the attached patch for RM-6925:
> <https://redmine.postgresql.org/issues/6925;  [SQL] Syntax Error display
> if select "Custom auto-vacuum" option and not set Autovaccuum option as Yes
> or No.
>
>
> --
> *Thanks & Regards,*
> *Nikhil Mohite*
> *Senior Software Engineer.*
> *EDB Postgres* <https://www.enterprisedb.com/;
> *Mob.No: +91-7798364578.*
>


-- 
*Thanks & Regards*
*Akshay Joshi*
*pgAdmin Hacker | Principal Software Architect*
*EDB Postgres <http://edbpostgres.com>*

*Mobile: +91 976-788-8246*


^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2021-11-11 07:26 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2021-11-11 04:20 [pgAdmin][RM-6925]: [SQL] Syntax Error display if select "Custom auto-vacuum" option and not set Autovaccuum option as Yes or No Nikhil Mohite <[email protected]>
2021-11-11 07:26 ` Akshay Joshi <[email protected]>

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox