SELECT * FROM pg_database

SELECT * FROM pg_catalog.pg_tables 
WHERE schemaname NOT IN ('pg_catalog', 'information_schema', 'pg_toast') 
ORDER BY schemaname, tablename 

create table logclient
(
	id serial primary key,
	usuario integer,
	acao varchar(200),
	tipo varchar(50),
	msg varchar(200),
	dataExt varchar(200),
	dataEhora timestamp
);

create table tokens
(
	id serial primary key not null,
	token varchar(255) not null unique,
	expire boolean not null,
	status smallint not null,
	expiredate timestamp
);

create table tokens
(
	id serial primary key not null,
	token varchar(255) not null unique,
	expiredate timestamp not null
);

INSERT INTO public.tokens (token, expire, status) VALUES ('$2a$10$MTE1MzA0NzgwMTU1M2E2NuK5l8BbSeABM5GOvJ6.ukMd2.XN2Uqfm', false, 1);
INSERT INTO public.tokens (token, expire, status,expiredate) VALUES ('$2a$10$MTgwODQxNjg0NTU1M2E2OOpOyRBAqP41zPrh6.cgYxePqEyjx38bC', True, 1, '2015-04-24T15:02:00-03:00');

DROP TABLE public.logclient ;
DROP TABLE public.tokens;

select * from public.logclient;

select * from public.tokens;

INSERT INTO public.logclient VALUES (1,1,null,null,null, null,'2015-03-23T12:51:59-03:00');

CREATE DATABASE isael;

CREATE SCHEMA dev;

SHOW DATABASES;

CREATE TABLE dev.pessoas
(
	id serial NOT NULL PRIMARY KEY,
	nome VARCHAR (50) NOT NULL,
	snome VARCHAR (50) NOT NULL,
	email VARCHAR (50) NOT NULL UNIQUE --DEFAULT 'email@email.com'--
);

CREATE TABLE dev.client
(
	id serial NOT NULL PRIMARY KEY,
	nome VARCHAR (50) NOT NULL,
	snome VARCHAR (50) NOT NULL,
	email VARCHAR (50) NOT NULL DEFAULT 'email@email.com'
);

CREATE TABLE dev.clientVendedor
(
	id serial NOT NULL PRIMARY KEY,
	client_id INTEGER NOT NULL REFERENCES dev.client (id),
	snome VARCHAR (50) NOT NULL,
	email VARCHAR (50) NOT NULL DEFAULT 'email@email.com'
);

INSERT INTO dev.pessoas(nome,snome,email) VALUES 
(
	'jessica',
	'dos santos macedo',
	'faelp21@hotmail.com'
);

INSERT INTO dev.client(nome,snome) VALUES 
(
	'Isael',
	'Sousa Santos'
);

INSERT INTO dev.clientVendedor(client_id,snome) VALUES 
(
	1,
	'Santos'
);


SELECT * FROM dev.pessoas ;

SELECT * FROM dev.client ;

SELECT * FROM dev.clientVendedor ;