Re: Truncate if exists - Mailing list pgsql-hackers

From Simon Riggs
Subject Re: Truncate if exists
Date
Msg-id CA+U5nMKm4uCypQPBy_bZWQwXH-XjRB2Yp+zjCOs5pzrva1pbUw@mail.gmail.com
Whole thread Raw
In response to Truncate if exists  (Sébastien Lardière <slardiere@hi-media.com>)
Responses Re: Truncate if exists  (Sébastien Lardière <slardiere@hi-media.com>)
Re: Truncate if exists  (Vik Reykja <vikreykja@gmail.com>)
Re: Truncate if exists  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: Truncate if exists  (Peter Eisentraut <peter_e@gmx.net>)
List pgsql-hackers
On 9 October 2012 09:33, Sébastien Lardière <slardiere@hi-media.com> wrote:

> With the help of Cédric, here's a patch changing the TRUNCATE TABLE
> command, adding the IF EXISTS option to allow the presence in the list
> of tables of a missing or invisible table.
>
> This meets the needs of scripts that should be run in different stages,
> and do not always have the same visibility on the tables, as well as
> DROP TABLE. Rather than rollback the entire TRUNCATE or transaction, we
> prefer to ignore the absence of the table.
>
> It is a small patch which changes very little code, but that could be
> quite useful.

Agreed.

Patch looks fine, but please observe the coding standards wrt nested brackets.

Will apply in 48 hours barring objections.

Anyone want to check for any other missing IF EXISTS capability in other DDL?

-- Simon Riggs                   http://www.2ndQuadrant.com/PostgreSQL Development, 24x7 Support, Training & Services



pgsql-hackers by date:

Previous
From: Shigeru HANADA
Date:
Subject: Re: FDW for PostgreSQL
Next
From: Simon Riggs
Date:
Subject: Re: Bugs in CREATE/DROP INDEX CONCURRENTLY