Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
postgresql on conflict-cannot affect row a second time
Language:
Ada
Assembly
Bash
C#
C++ (gcc)
C++ (clang)
C++ (vc++)
C (gcc)
C (clang)
C (vc)
Client Side
Clojure
Common Lisp
D
Elixir
Erlang
F#
Fortran
Go
Haskell
Java
Javascript
Kotlin
Lua
MySql
Node.js
Ocaml
Octave
Objective-C
Oracle
Pascal
Perl
Php
PostgreSQL
Prolog
Python
Python 3
R
Rust
Ruby
Scala
Scheme
Sql Server
Swift
Tcl
Visual Basic
Layout:
Vertical
Horizontal
--PostgreSQL 9.5 --'\\' is a delimiter create table tabledata ( data_id serial primary key, data_code text not null unique, data_desc text ); insert into tabledata(data_code,data_desc) values('Z01','red') on conflict (data_code) do update set data_desc=excluded.data_desc; insert into tabledata(data_code,data_desc) values('Z01','blue') on conflict (data_code) do update set data_desc=excluded.data_desc; select * from tabledata;
absolute service time: 0,39 sec
edit mode
|
history
data_id
data_code
data_desc
1
1
Z01
blue