Re: Materialized View Patch File

From: Neel Patel <neel(dot)patel(at)enterprisedb(dot)com>
To: Dave Page <dave(dot)page(at)enterprisedb(dot)com>
Cc: pgadmin-hackers <pgadmin-hackers(at)postgresql(dot)org>
Subject: Re: Materialized View Patch File
Date: 2013-07-17 11:23:38
Message-ID: CAMcbDBGOint4z0073cvr4E8bhn8ucCQ0stmZyze_+UphqDVsbg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-hackers

Hi Dave,

Just want to know.

Now we are passing GetName() to qtDbString() and to form the complete query
we need to use qtDbString() to compare the string.

We have added below string.

wxString sql = wxT("SELECT count(*) FROM pg_matviews WHERE matviewname = ")
+ qtDbString(this->GetName()) + wxT(" AND schemaname = ") +
qtDbString(this->GetSchema()->GetName());

Is it correct ?

Thanks,
Neel Patel

On Wed, Jul 17, 2013 at 1:57 PM, Neel Patel <neel(dot)patel(at)enterprisedb(dot)com>wrote:

> Hi Dave,
>
> Yes, you are right.
> I also found one bug because of this fix where information is not correct
> in the SQL Pane.
>
>
> I will check and will send you the updated patch.
>
> Thanks,
> Neel Patel
>
>
> On Wed, Jul 17, 2013 at 1:45 PM, Dave Page <dave(dot)page(at)enterprisedb(dot)com>wrote:
>
>> Hi
>>
>> On Tue, Jul 16, 2013 at 2:58 PM, Neel Patel <neel(dot)patel(at)enterprisedb(dot)com>
>> wrote:
>> > Hi Dave,
>> >
>> > Below is the bug description and find attached patch for fix.
>> >
>> >
>> > "If create any MATERIALIZED VIEW with double quote in SQL pane of
>> > pgAdminIII, the syntax is not displayed properly and it's showing create
>> > view instead of MATERIALIZED View, and user can not drop that and
>> displayed
>> > use MATERIALIZED VIEW"
>> >
>> > Steps:
>> >
>> > 1. Install PostgreSQL 9.3 beta 2
>> > 2. Launch pgAdmin III
>> > 3. and create this view from SQL editor
>> > CREATE MATERIALIZED VIEW public."z a" AS
>> > select * from emp
>> > WITH DATA;
>> > 4. created successfully.
>> > 5. Click on SQL pane
>>
>> Isn't the correct fix more like:
>>
>> wxString sql = wxT("SELECT count(*) FROM pg_matviews WHERE matviewname
>> = ") + this->GetQuotedIdentifier() + wxT(" AND schemaname = ") +
>> this->GetSchema()->GetQuotedIdentifier();
>>
>> The point being that GetQuotedIdentifier() should never need to be
>> passed through qtDbString(), and always knows the proper quoting rules
>> for that particular object class (not an issue in this case, but it
>> can be for things like functions, where the parentheses and arguments
>> should be excluded from the quoting).
>>
>> --
>> Dave Page
>> Chief Architect, Tools & Installers
>> EnterpriseDB: http://www.enterprisedb.com
>> The Enterprise PostgreSQL Company
>>
>> Blog: http://pgsnake.blogspot.com
>> Twitter: @pgsnake
>>
>
>

In response to

Responses

Browse pgadmin-hackers by date

  From Date Subject
Next Message Dave Page 2013-07-17 11:45:34 Re: Materialized View Patch File
Previous Message Neel Patel 2013-07-17 08:27:35 Re: Materialized View Patch File