postgresql sql create table

前端之家收集整理的这篇文章主要介绍了postgresql sql create table前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。


postgresql create table:

BEGIN;

CREATE TABLE t1 (
	id		BIGSERIAL PRIMARY KEY,address	INTERGER DEFAULT '',name	VARCHAR UNIQUE NOT NULL,did		VARCHAR,count	INTERGER NOT NULL,money	DOUBLE PRECISION NOT NULL DEFAULT 0,CONSTRAINT money_check (money >= 0),ratio	REAL NOT NULL DEFAULT 0,tm		TIMESTAMP,pass	BOOLEAN NOT NULL DEFAULT FALSE,);
CREATE TABLE t2 (
	p_id		BITINT NOT NULL,ticket_id	BITINT NOT NULL,"type"		VARCHAR NOT NULL,PRIMARY KEY (p_id,ticket_id)
);
CREATE INDEX ticket_player ON t2(p_id);

COMMIT;

猜你在找的Postgre SQL相关文章