Re: Possible to stop pgAdmin4 from re-formatting my SQL statements in Views and such?

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Aditya Toshniwal <aditya(dot)toshniwal(at)enterprisedb(dot)com>
Cc: Ni Ne <nineoften(at)hotmail(dot)com>, "pgadmin-support(at)lists(dot)postgresql(dot)org" <pgadmin-support(at)lists(dot)postgresql(dot)org>
Subject: Re: Possible to stop pgAdmin4 from re-formatting my SQL statements in Views and such?
Date: 2022-02-21 06:53:55
Message-ID: CAFj8pRBMp7qtYZ7cgn+GA4xc91wMbwFiOE3Qkk+ZfGyORH+wTA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-support

Hi

po 21. 2. 2022 v 7:21 odesílatel Aditya Toshniwal <
aditya(dot)toshniwal(at)enterprisedb(dot)com> napsal:

> Hi Ni Ne,
>
> pgAdmin reverse engineers the SQL based on the available catalog and
> schema information. I don't think PostgreSQL saves the exact formatting
> when creating objects (except function/procedure body).
>

Yes, Postgres doesn't store the original form of DDL query.

Regards

Pavel

> On Fri, Feb 18, 2022 at 11:41 PM Ni Ne <nineoften(at)hotmail(dot)com> wrote:
>
>> I have a syntax format for SQL that I prefer, so when I craft new Views
>> or what-not I write them out a certain way.
>>
>> When I save that SQL into a View, pgAdmin4 will re-format it. If I later
>> need to debug that View, it adds some complexity for me because first I
>> have to re-format the layout in a text file in the format I understand best.
>>
>> Is it possible to turn this off, so that pgAdmin4 saves exactly what I
>> enter?
>>
>> I guess there are two parts to what pgAdmin is doing.
>>
>> 1. It will change spacing/indentation, and line-breaks. This is what
>> I am hoping to stop.
>> 2. It does some optimization apparently. It will adjust statements to
>> be more efficient I guess, as well as do things like change "SELECT *" into
>> "SELECT c1,c2,c3" or add explicit type-casting. This stuff is fine for me.
>>
>> Thanks!
>>
>
>
> --
> Thanks,
> Aditya Toshniwal
> pgAdmin Hacker | Software Architect | *edbpostgres.com*
> <http://edbpostgres.com>
> "Don't Complain about Heat, Plant a TREE"
>

In response to

Browse pgadmin-support by date

  From Date Subject
Next Message Thomas Kaliakos 2022-02-21 14:10:53 Programmatic access to the SQL tab of pgadmin
Previous Message Aditya Toshniwal 2022-02-21 06:20:53 Re: Possible to stop pgAdmin4 from re-formatting my SQL statements in Views and such?