pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Shavonne Marietta Wijesinghe <shavonne.marietta@studioform.it>
To: pgsql-sql@postgresql.org
Subject: Update problem.
Date: Mon, 2 Apr 2007 16:52:46 +0200
Message-ID: <00c301c77536$938a32e0$1102a8c0@dream> (raw)


Hello

I have a table created as the following

CREATE TABLE mod48_00_2007
(
  id text,
  n_gen serial NOT NULL,
  formstore text,
  te_cognome text,
  te_paternita text,
  te_nome text,
  te_sesso text,
  te_dtnasc text,
  te_attnasc text,
  te_luonasc text,
  te_provstato text,
  te_indi text,
  te_prov text,
  te_richiesta text,
  atto_forma text,
  rev_test text,
  atto_dt text,
  atto_num text,
  dt_olog text,
  cod_notaio text,
  pa_cognome text,
  pa_nome text,
  pa_qual text,
  pa_indirizzo text,
  pa_civ text,
  pa_cap text,
  pa_pro text,
  pa_sede text,
  pa_estero text,
  pa_data text,
  f_olo text,
  f_pub text,
  f_rev text,
  f_seg text,
  f_spe text,
  atto_riferimento text,
  ratto_dt text,
  ratto_num text,
  rdt_olog text,
  r_cognome text,
  r_nome text,
  r_qual text,
  r_sede text,
  r_estero text,
  dt_oggi text,
  n_pub_aut text,
  dt_tr_rgt text,
  sche_singola text,
  sche_multipla text,
  n_fog text,
  tot_n_fog text,
  reg_anno text,
  username text,
  date_inserted text,
  time_inserted text,
  deleted text,
  date_deleted text,
  time_deleted text,
  f_tes text,
  CONSTRAINT mod48_00_2007_pkey PRIMARY KEY (n_gen)
) 

At a surtain point i need to replace a record with another

For example i have inserted 4 records. (1, 2 ,  3 , 4) I need to replace all the values from the record 4 to the record 2 but keeping the n_gen serial key. And then delete the record 4. So that the next record i insert will take the n_gen 4

How can i do this?

Shavonne Wijesinghe

view thread (7+ messages)  latest in thread

Message-ID: <00c301c77536$938a32e0$1102a8c0@dream>
Permalink:  ../00c301c77536$938a32e0$1102a8c0@dream/
Also on:    postgresql.org/message-id/00c301c77536$938a32e0$1102a8c0@dream

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: shavonne.marietta@studioform.it
  Subject: Re: Update problem.
  In-Reply-To: <00c301c77536$938a32e0$1102a8c0@dream>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox