Re: [SQL] optimal insert

2006-10-11 Thread Markus Schaber
Hi, Dirk, Dirk Jagdmann wrote: > So for a batch of inserts the value of a stays the same, while for by > arbitrary values are inserted. Now I have wondered if PostreSQL offers > a smarter way to insert those values? A solution can contains usage of > some plpgsql code. [local]:postgres=# insert

Re: [SQL] optimal insert

2006-10-10 Thread Dirk Jagdmann
Hello George, And don't forget that \COPY and especially COPY are usually much faster (and, IMHO, easier to compose/maintain) than gobs of INSERTs. I did not forget, but my application uses embedded SQL (with the epcg preprocessor) and I don't think it can handle COPYs :( -- ---> Dirk Jagdman

Re: [SQL] optimal insert

2006-10-10 Thread Dirk Jagdmann
Hello Aaron, thank you for your suggestion. I will have to think if something similar would be of any benefit for my data. -- ---> Dirk Jagdmann > http://cubic.org/~doj -> http://llg.cubic.org ---(end of broadcast)--- TIP 1: if posting/rea

Re: [SQL] optimal insert

2006-10-10 Thread George Pavlov
:46 PM > To: Dirk Jagdmann > Cc: pgsql-sql@postgresql.org > Subject: Re: [SQL] optimal insert > > On 10/8/06, Dirk Jagdmann <[EMAIL PROTECTED]> wrote: > > Hello experts, > > I have a database that contains three tables: > &

Re: [SQL] optimal insert

2006-10-10 Thread Aaron Bono
On 10/8/06, Dirk Jagdmann <[EMAIL PROTECTED]> wrote: Hello experts,I have a database that contains three tables:create table a (id serial primary key, ... -- some more fields not relevant for my question);create table b (id serial primary key,... -- some more fields not relevant for my question);cr

Re: [SQL] optimal insert

2006-10-08 Thread Bruno Wolff III
On Sun, Oct 08, 2006 at 23:04:02 +0200, Dirk Jagdmann <[EMAIL PROTECTED]> wrote: > > insert into a_b(a,b) values(1,100); > insert into a_b(a,b) values(1,200); > insert into a_b(a,b) values(1,54); > insert into a_b(a,b) values(1,4577); > > So for a batch of inserts the value of a stays the same,

[SQL] optimal insert

2006-10-08 Thread Dirk Jagdmann
Hello experts, I have a database that contains three tables: create table a ( id serial primary key, ... -- some more fields not relevant for my question ); create table b ( id serial primary key, ... -- some more fields not relevant for my question ); create table a_b ( a int not null refe