Skip site navigation (1) Skip section navigation (2)

Re: Ticket 269: Add support for 9.1 ALTER TYPE new syntax for enum

From: Guillaume Lelarge <guillaume(at)lelarge(dot)info>
To: Dave Page <dpage(at)pgadmin(dot)org>
Cc: pgadmin-hackers(at)postgresql(dot)org
Subject: Re: Ticket 269: Add support for 9.1 ALTER TYPE new syntax for enum
Date: 2010-11-01 21:51:30
Message-ID: 4CCF3662.6020005@lelarge.info (view raw or flat)
Thread:
Lists: pgadmin-hackers
Le 31/10/2010 09:44, Guillaume Lelarge a écrit :
> Le 31/10/2010 00:39, Dave Page a écrit :
>> On Sun, Oct 31, 2010 at 1:56 AM, Guillaume Lelarge
>> <guillaume(at)lelarge(dot)info> wrote:
>>> Le 30/10/2010 10:25, Dave Page a écrit :
>>>
>>>> Yeah, that's really nasty. I guess we need split the commands at ;.
>>>
>>> Yeah. If it's not between quotes. I don't like it at all, but I don't
>>> see another way of doing it.
>>>
>>>> I guess we should pass a flag down somehow to tell the function that
>>>> executes the query to do that and then we could also potentially get
>>>> rid of the double SQL boxes.  I'm not looking at the code, but I
>>>> suspect that'll be nasty.
>>>>
>>>
>>> We actually aren't required to add such a flag. We can check if the
>>> query contains "ALTER TYPE", and "ADD AFTER" or "ADD BEFORE".
>>
>> That's knowledge I'd rather avoid hardwiring into the lower level
>> machinery here.
>>
> 
> So do I. I tried a few things yesterday. Changing the apply() and
> GetSql() parameters imply to change all GetSql for all dlg* source code.
> That will be quite an invasive patch.
> 

I've done the "split-the-queries" function. Seems to work great, but
still doesn't cover dollar quoting. Anyway, it's less ugly than I
thought. The interesting part is dlgProperty::SplitQueries(). Would love
to get comments :)


-- 
Guillaume
 http://www.postgresql.fr
 http://dalibo.com

Attachment: splitit.patch
Description: text/x-diff (6.1 KB)

In response to

Responses

pgadmin-hackers by date

Next:From: Dave PageDate: 2010-11-02 12:49:44
Subject: Re: Ticket 269: Add support for 9.1 ALTER TYPE new syntax for enum
Previous:From: pgAdmin TracDate: 2010-11-01 16:08:37
Subject: Re: [pgAdmin III] #242: Add support for new ALTER TYPE clauses

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group