Re: CREATE TABLE IF NOT EXISTS AS

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Craig Ringer <craig(at)2ndquadrant(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "David E(dot) Wheeler" <david(at)justatheory(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>, Steve Rehfuss <steve(dot)rehfuss(at)iovation(dot)com>
Subject: Re: CREATE TABLE IF NOT EXISTS AS
Date: 2013-11-20 07:41:25
Message-ID: CAFj8pRAcV0jbY46gxk-6SKYRpeECWFM0XR8Ju7sTysMKcTB9OA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

2013/11/20 Craig Ringer <craig(at)2ndquadrant(dot)com>

> On 11/17/2013 08:40 AM, Tom Lane wrote:
> > That's an even worse idea than plain CREATE IF NOT EXISTS (which was
> > put in over vocal objections from me and some other people).
>
> I'm pretty uncomfortable with CREATE TABLE IF NOT EXISTS too - but it
> doesn't hurt someone who doesn't use it and it does have uses.
>
> We have plenty of other features that can be horribly abused too. That
> doesn't mean new ones should be added casually, just that it's sometimes
> appropriate to accept something that's imperfect when it meets a need
> and we don't have a better way to do it.
>
> It'd be great if there was a sane way to implement "CREATE OR REPLACE
> TABLE" - since that's what people really want a lot of the time. "Ensure
> that at the end of this command the table looks like this". There's just
> no sane way to do that for a non-empty table.
>

I disagree - CREATE OR REPLACE FUNCTION has sense, because new function can
has same interface (and will be overwriten) or different (and there will be
two functions). So with CREATE OR REPLACE TABLE there are two new questions
- has to new table respect original interface and what about content? I
don't think so CREATE OR REPLACE TABLE is good idea.

Regards

Pavel

>
> --
> Craig Ringer http://www.2ndQuadrant.com/
> PostgreSQL Development, 24x7 Support, Training & Services
>
>
> --
> Sent via pgsql-hackers mailing list (pgsql-hackers(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-hackers
>

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Craig Ringer 2013-11-20 07:58:22 Re: Compile and test in netbeans
Previous Message Ashutosh Bapat 2013-11-20 07:39:47 Re: Compile and test in netbeans