I don't understand why the clause "WHERE" don't filter my query. In fact the two queries give the same result. In my case I can divert the problem with a with but it does not seem to be the best solution.
SELECT FROM pheno_table ;
SELECT FROM pheno_table WHERE espece_id='765' ;
WITH REQ AS (SELECT FROM pheno_table) SELECt FROM REQ WHERE espece_id='765' ;
Do you have a solution to advise me to solve this problem with the SQL language ?
-- example
DROP SERVER IF EXISTS pheno_server CASCADE;
I don't understand why the clause "WHERE" don't filter my query. In fact the two queries give the same result. In my case I can divert the problem with a with but it does not seem to be the best solution. SELECT FROM pheno_table ; SELECT FROM pheno_table WHERE espece_id='765' ; WITH REQ AS (SELECT FROM pheno_table) SELECt FROM REQ WHERE espece_id='765' ; Do you have a solution to advise me to solve this problem with the SQL language ?
-- example DROP SERVER IF EXISTS pheno_server CASCADE;
CREATE SERVER pheno_server FOREIGN DATA WRAPPER www_fdw OPTIONS (uri 'http://www.gdr2968.cnrs.fr/pheno_ws/ServEspece',response_type 'json');
CREATE FOREIGN TABLE pheno_table (espece_nom_scientifique text, espece_nom_vernaculaire text,espece_id text) SERVER pheno_server;
create user mapping for current_user server pheno_server;