Re: Truncate if exists - Mailing list pgsql-hackers

From Dimitri Fontaine
Subject Re: Truncate if exists
Date
Msg-id m2obk7we6i.fsf@2ndQuadrant.fr
Whole thread Raw
In response to Re: Truncate if exists  (Christopher Browne <cbbrowne@gmail.com>)
Responses Re: Truncate if exists  (Josh Berkus <josh@agliodbs.com>)
Re: Truncate if exists  (Christopher Browne <cbbrowne@gmail.com>)
Re: Truncate if exists  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-hackers
Christopher Browne <cbbrowne@gmail.com> writes:
> I suggest the though of embracing statement modifiers in DDL, with
> some options possible:
>   a) { DDL STATEMENT } IF CONDITION;
>   b) { DDL STATEMENT } UNLESS CONDITION;

Just saying. I hate that. Makes it harder to read, that last bit at the
end of the command changes it all. It's cool for a linguist, I guess,
but we're not typing sentences at the psql prompt…

> where CONDITION has several possible forms:
>   i) {IF|UNLESS} ( SQL expression returning T/F )
>   ii) {IF|UNLESS} {EXISTS|NOT EXISTS}
> {TABLE|SCHEMA|COLUMN|FUNCTION|...} object_name

Now we're talking about T-SQL? Sorry, I suppose you didn't mean to lead
us that way, but I couldn't resist comparing. Soon enough you want a
full programming language there.

Regards,
--
Dimitri Fontaine
http://2ndQuadrant.fr     PostgreSQL : Expertise, Formation et Support



pgsql-hackers by date:

Previous
From: Hannu Krosing
Date:
Subject: Re: Truncate if exists
Next
From: Josh Berkus
Date:
Subject: Re: Truncate if exists