Re: Query execution order

From: Andreas Pflug <pgadmin(at)pse-consulting(dot)de>
To: Miha Radej <miha(dot)radej(at)siix(dot)com>
Cc: pgadmin-hackers(at)postgresql(dot)org
Subject: Re: Query execution order
Date: 2003-12-16 13:05:56
Message-ID: 3FDF0334.8070704@pse-consulting.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-hackers

Miha Radej wrote:

> Hi!
>
> I've been playing a bit with my frinends' tables and I wanted to
> remove an existing unique constraint and add a primary key with the
> same name.
> However, instead of first removing an existing constraint and then
> adding a new one, I added the primary key and then deleted the unique
> constraint. When I hit OK I got a pgsql error, telling me that a
> relation with that name already exists.
>
> The SQL tag had these queries:
> ALTER TABLE uporabniki ADD CONSTRAINT uporabniki_primary_key_key
> PRIMARY KEY (primary_key);
> ALTER TABLE uporabniki DROP CONSTRAINT uporabniki_primary_key_key;
>
> Is it possible for pgAdmin to reorder the queries so that the drop
> queries are first and all the rest follow? Or if it could at least
> check for existing constraint names?

Miha,

you'll probably always be able to construct use cases where pgadmin3's
sql generation lacks support of some weird situations. In your case,
simply split your action into two actions, or copy the table wizard's
sql output into the sql query window, reorder the statements and hit F5.

Regards,
Andreas

In response to

Browse pgadmin-hackers by date

  From Date Subject
Next Message Oleg Romanenko 2003-12-16 14:42:12
Previous Message Miha Radej 2003-12-16 12:33:05 Query execution order