Re: Why No WHERE clause for INSERT statements

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Maurice Gittens <mainmanmauricio(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Why No WHERE clause for INSERT statements
Date: 2010-08-17 14:13:19
Message-ID: 10496.1282054399@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Maurice Gittens <mainmanmauricio(at)gmail(dot)com> writes:
> The syntax includes a where clause allowing qualified declarative
> control over what is deleted.

> Why would the same not hold for the insert statement?

All that stuff is buried in the "query" option. You can do something
like

INSERT INTO table SELECT ... WHERE ...

so the full power of SELECT is available already.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Thom Brown 2010-08-17 15:00:22 Re: Postgresql's table & index compared to that of MySQL
Previous Message Michael Glaesemann 2010-08-17 14:12:41 Re: Why No WHERE clause for INSERT statements