Linux
4
Вклад в тег
CREATE TABLE users (
steamid BIGINT PRIMARY KEY,
balance DECIMAL NOT NULL,
name VARCHAR(24) NOT NULL,
avatar VARCHAR(2038) NOT NULL
);
INSERT INTO users (balance, steamid, name, avatar)
VALUES (0, :steamid, :secondname, :avatar)
ON CONFLICT (steamid) DO UPDATE
SET name = excluded.name, avatar = excluded.avatar
RETURNING (steamid);
CREATE TABLE IF NOT EXISTS users (
id SERIAL PRIMARY KEY,
steamid BIGINT UNIQUE NOT NULL ,
balance DECIMAL NOT NULL,
name VARCHAR(24) NOT NULL,
avatar VARCHAR(2038) NOT NULL
);
INSERT INTO users (balance, steamid, name, avatar)
VALUES (0, :steamid, :secondname, :avatar)
ON CONFLICT (steamid) DO UPDATE
SET id = excluded.id, name = excluded.name, avatar = excluded.avatar
RETURNING (steamid);