Re: savepoint problems

From: Linos <info(at)linos(dot)es>
To: David Wilson <david(dot)t(dot)wilson(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: savepoint problems
Date: 2008-08-01 22:36:24
Message-ID: 48938FE8.4080900@linos.es
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

David Wilson escribió:
> On Fri, Aug 1, 2008 at 12:30 PM, Linos <info(at)linos(dot)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.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Linos 2008-08-01 22:38:25 Re: savepoint problems
Previous Message John Meyer 2008-08-01 22:14:54 Is there any reason why "edit PostgreSQL.conf should be on my menu"