Re: Why No WHERE clause for INSERT statements - Mailing list pgsql-general

From Tom Lane
Subject Re: Why No WHERE clause for INSERT statements
Date
Msg-id 10496.1282054399@sss.pgh.pa.us
Whole thread Raw
In response to Why No WHERE clause for INSERT statements  (Maurice Gittens <mainmanmauricio@gmail.com>)
Responses Re: Why No WHERE clause for INSERT statements
List pgsql-general
Maurice Gittens <mainmanmauricio@gmail.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

pgsql-general by date:

Previous
From: Michael Glaesemann
Date:
Subject: Re: Why No WHERE clause for INSERT statements
Next
From: Thom Brown
Date:
Subject: Re: Postgresql's table & index compared to that of MySQL