Re: pgsql: Allow TRUNCATE foo, foo to succeed, per report from Nikhils.

From: Nikhils <nikkhils(at)gmail(dot)com>
To: "Simon Riggs" <simon(at)2ndquadrant(dot)com>
Cc: "Neil Conway" <neilc(at)samurai(dot)com>, "Bruce Momjian" <bruce(at)momjian(dot)us>, pgsql-committers(at)postgresql(dot)org
Subject: Re: pgsql: Allow TRUNCATE foo, foo to succeed, per report from Nikhils.
Date: 2008-07-17 05:46:40
Message-ID: d3c4af540807162246i344eb00fr2319b76665547495@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers

Hi Simon,

On Thu, Jul 17, 2008 at 4:36 AM, Simon Riggs <simon(at)2ndquadrant(dot)com> wrote:

>
> On Wed, 2008-07-16 at 17:59 -0400, Neil Conway wrote:
> > On Wed, 2008-07-16 at 21:39 +0100, Simon Riggs wrote:
> > > TRUNCATE foo;
> > > TRUNCATE foo;
> > >
> > > works well.
> > >
> > > So why do we need
> > >
>

I presented a simple psql version here. I was actually processing multiple
relations in my C library in which truncate was invoked on all the involved
relations. I was passing a list of these rels to ExecuteTruncate which
barfed when the same rel was mentioned twice in that list. Its really an
implementation issue as Tom mentioned.

Regards,
Nikhils

>
> > > TRUNCATE foo, foo;
> >
> > For the sake of completeness? Having "TRUNCATE foo, foo" fail would be
> > rather inconsistent.
>
> Inconsistent with what exactly?
>
> If a proposal to support this was made on hackers, it would be laughed
> away. It is not required for functionality, usability, standards
> compliance, backwards compatibility, robustness, performance, internal
> coding simplicity, portability, marketing or external compatibility. For
> what reason would we do it? Nobody has said.
>
> And as I pointed out, other commands fail in similar circumstances.
>
> Consistency is required, but consistency in making balanced judgements
> about feature additions.
>
> Our users will be surprised to find this was at the top of our list
> ahead of other patches during a commit fest, other agreed TODO items and
> other proposals from users.
>
> --
> Simon Riggs www.2ndQuadrant.com
> PostgreSQL Training, Services and Support
>
>
> --
> Sent via pgsql-committers mailing list (pgsql-committers(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-committers
>

--
EnterpriseDB http://www.enterprisedb.com

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Simon Riggs 2008-07-17 07:48:58 Re: pgsql: Allow TRUNCATE foo, foo to succeed, per report from Nikhils.
Previous Message Tom Lane 2008-07-17 05:35:05 Re: [COMMITTERS] pgsql: Allow TRUNCATE foo, foo to succeed, per report from Nikhils.

Browse pgsql-hackers by date

  From Date Subject
Next Message David Fetter 2008-07-17 05:53:26 Re: Postgres-R source code release
Previous Message Tom Lane 2008-07-17 05:35:05 Re: [COMMITTERS] pgsql: Allow TRUNCATE foo, foo to succeed, per report from Nikhils.