Re: INSERT before UPDATE? - Mailing list pgsql-general

From A. Kretschmer
Subject Re: INSERT before UPDATE?
Date
Msg-id 20070816091629.GA13550@a-kretschmer.de
Whole thread Raw
In response to INSERT before UPDATE?  (Jiří Němec <konference@menea.cz>)
List pgsql-general
am  Thu, dem 16.08.2007, um 10:30:01 +0200 mailte Ji?í N?mec folgendes:
> Hello,
>
> I would like to ask you for an advice.
>
> There are two tables in my PostgreSQL database - main table with datas and
> second with translations for all languages of these records.
>
> When I try to UPDATE a record in the language table and this record
> doesn't exists there I need to INSERT into the language table (from
> default language version) and execute UPDATE statement again.
>
> Could you tell me if is this possible and if so - how to do it?

Okay, i try to ask our doc-bot on IRC:

11:15 < akretschmer> ??upsert
11:15 < rtfm_please> For information about upsert
11:15 < rtfm_please> see
http://www.postgresql.org/docs/current/static/plpgsql-control-structures.html#PLPGSQL-UPSERT-EXAMPLE

Andreas
--
Andreas Kretschmer
Kontakt:  Heynitz: 035242/47150,   D1: 0160/7141639 (mehr: -> Header)
GnuPG-ID:   0x3FFF606C, privat 0x7F4584DA   http://wwwkeys.de.pgp.net

pgsql-general by date:

Previous
From: Jiří Němec
Date:
Subject: INSERT before UPDATE?
Next
From: "Sergey Moroz"
Date:
Subject: array for cstring type