Answer the question
In order to leave comments, you need to log in
Laravel exists validation in PostgreSQL - ERROR - Feature not supported: 7 ERROR: cross-database references are not implemented?
Referral system to check if the user's nickname exists in the database:
'nickname' => 'required|string|unique:pgsql.public.users.nickname',
'referral' => 'nullable|string|exists:pgsql.public.users.nickname',
Illuminate \ Database \ QueryException (0A000)
SQLSTATE[0A000]: Feature not supported: 7 ERROR: cross-database references are not implemented: "public.users.nickname" LINE 1: select count(*) as aggregate from "public"."users"."nickname... ^ (SQL: select count(*) as aggregate from "public"."users"."nickname" where "referral" = BonBonSlick)
'referral' => [
'nullable',
Rule::exists('users')->where(function ($query) {
$query->where('nickname', $this->referral);
}),
],
Illuminate \ Database \ QueryException (42703)
SQLSTATE[42703]: Undefined column: 7 ERROR: column "referral" does not exist LINE 1: select count(*) as aggregate from "users" where "referral" =... ^ (SQL: select count(*) as aggregate from "users" where "referral" = qwe and ("nickname" = qwe))
Answer the question
In order to leave comments, you need to log in
A query in postgresql cannot access other databases using the database_name.object syntax. Only to the one to which the connection was opened.
See where your tables are located, if within the same database, then how your framework builds the query and what needs to be written in order for the resulting query to be correct.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question