小编Dar*_*ard的帖子

是每个提供商唯一的firebase用户ID(facebook,twitter,password)

如果在firebase(twitter,facebook,password)中允许多个auth提供程序,最好以这种方式存储用户:

/users/[auth.id] _ [auth.provider]/...

看起来auth.id可能会基于提供者重叠.

大多数示例的安全文件仅检查auth.id. 我试图避免创建自己的用户ID的复杂性.

思考?

authentication twitter facebook firebase

4
推荐指数
1
解决办法
2125
查看次数

Postgres now()vs'now'in function

遇到在Postgres中的函数中使用now()与'now'不同的问题.

drop table if exists test_date_bug;
CREATE TABLE test_date_bug
(
id serial NOT NULL,
date1 timestamp with time zone NOT NULL DEFAULT current_timestamp,
date2 timestamp with time zone NOT NULL DEFAULT 'infinity'
)
WITH (
OIDS=FALSE
);

drop function if exists test_date_bug_function(id_param bigint); 
CREATE OR REPLACE FUNCTION test_date_bug_function(id_param bigint)
RETURNS void AS
$$ 
BEGIN 
   UPDATE test_date_bug SET date2 = 'now' WHERE id = id_param;  
END;
$$
LANGUAGE 'plpgsql' VOLATILE
SECURITY DEFINER
SET search_path = public, pg_temp;  

insert into test_date_bug DEFAULT …
Run Code Online (Sandbox Code Playgroud)

postgresql datetime function

1
推荐指数
2
解决办法
1564
查看次数