Search Postgresql Archives

Re: insert multiple rows

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 2005-10-31 at 17:13, David Fetter wrote:
> On Mon, Oct 31, 2005 at 06:06:14PM -0500, blackwater dev wrote:
> > In MySQL, I can insert multiple rows like this:
> > 
> > insert into cars values(5, "toyota"),(5,"ford"), etc.
> > 
> > How can I do something similiar in PostgreSQL?
> 
> The similar thing in PostgreSQL is the COPY command (man 8 copy).

Note that for complex schemas, prepared queries may also be a good
choice.

Symantically, the closest thing to this for postgresql is doing:

begin;
insert ...
insert ...
insert ...
commit;


---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

               http://archives.postgresql.org

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux