Re: savepoint problems - Mailing list pgsql-general

From Linos
Subject Re: savepoint problems
Date
Msg-id 48938FE8.4080900@linos.es
Whole thread Raw
In response to savepoint problems  (Linos <info@linos.es>)
List pgsql-general
David Wilson escribió:
> On Fri, Aug 1, 2008 at 12:30 PM, Linos <info@linos.es> wrote:
>
>> Well i would like to know if every can help with any other idea or any notes
>> on this problem? Other question i have it is how i could create a function
>> without be sure the number of columns to insert/update. Thanks in advance.
>
> you could do:
>
> begin;
> create temporary table tmp (...);
> [insert (or better yet, COPY) into tmp table]
> [delete from real table where exists in temporary table];
> insert into real_table select * from tmp;
> drop table tmp;
> commit;
>
> Your client <--> server communication should be extremely small.
>

I think this is probably the better solution if i get the jdbc to use the copy command,
but i still dont know how to make a function with a variable column number, maybe i simply
can put all the columns and let the null columns insert/update with null.

Regards,
Miguel Angel.

pgsql-general by date:

Previous
From: John Meyer
Date:
Subject: Is there any reason why "edit PostgreSQL.conf should be on my menu"
Next
From: Linos
Date:
Subject: Re: savepoint problems