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

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Simon Riggs <simon(at)2ndquadrant(dot)com>
Cc: pgsql-committers(at)postgresql(dot)org
Subject: Re: pgsql: Allow TRUNCATE foo, foo to succeed, per report from Nikhils.
Date: 2008-07-16 20:24:00
Message-ID: 200807162024.m6GKO0118971@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers


Logically, you should be able to truncate a table twice.

---------------------------------------------------------------------------

Simon Riggs wrote:
>
> On Wed, 2008-07-16 at 16:54 +0000, Bruce Momjian wrote:
> > Log Message:
> > -----------
> > Allow TRUNCATE foo, foo to succeed, per report from Nikhils.
>
> What's the use case for this?
>
> It's not compatibility, is it? Why would you ever do that? If you did,
> why would you expect it to work? Seems more likely to be a user error
> than a real request.
>
> Should it throw one trigger call, or two?
>
> BTW, create index foo_idx on foo (col1, col1) fails also with a strange
> error message. Should we silently merge columns and ignore that also?
>
> ERROR: duplicate key value violates unique constraint
> "pg_attribute_relid_attnam_index"
>
> Seems easier to throw errors for weird DDL like this.
>
> e.g. create index concurrently on foo (col1); creates an index called
> "concurrently" on foo, while holding locks...
>
> --
> Simon Riggs www.2ndQuadrant.com
> PostgreSQL Training, Services and Support

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Simon Riggs 2008-07-16 20:39:38 Re: pgsql: Allow TRUNCATE foo, foo to succeed, per report from Nikhils.
Previous Message Simon Riggs 2008-07-16 20:13:24 Re: pgsql: Allow TRUNCATE foo, foo to succeed, per report from Nikhils.

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2008-07-16 20:35:45 Re: Message-ID should surely not be shown as a mailto: URL
Previous Message Simon Riggs 2008-07-16 20:13:24 Re: pgsql: Allow TRUNCATE foo, foo to succeed, per report from Nikhils.