CREATE FUNCTION check_login_and_password(
_login character varying,
_password character varying
)
RETURNS boolean AS
$$
SELECT EXISTS(SELECT * FROM table_name WHERE login = _login OR password = _password);
$$
LANGUAGE sql;
CREATE FUNCTION check_login_and_password(
_login character varying,
_password character varying
)
RETURNS bigint AS
$$
SELECT count(*) FROM table_name WHERE login = _login OR password = _password;
$$
LANGUAGE sql;