postgresql_16:9.6.12.4.4 Notes
PostgreSQL 16 > Appendixes > Additional Supplied Modules and Extensions > dblink — connect to other PostgreSQL databases > dblink > Notes
A convenient way to use dblink with predetermined queries is to create a view. This allows the column type information to be buried in the view, instead of having to spell it out in every query. For example, CREATE VIEW myremote_pg_proc AS SELECT * FROM dblink('dbname=postgres options=-csearch_path=', 'select proname, prosrc from pg_proc') AS t1(proname name, prosrc text); SELECT * FROM myremote_pg_proc WHERE proname LIKE 'bytea%';