Difference between revisions of "Dblink postgres"
Jump to navigation
Jump to search
(Created page with "https://dbaclass.com/article/how-to-create-database-link-in-postgres/") |
|||
Line 1: | Line 1: | ||
https://dbaclass.com/article/how-to-create-database-link-in-postgres/ | https://dbaclass.com/article/how-to-create-database-link-in-postgres/ | ||
+ | |||
+ | |||
+ | create users in function via dblink | ||
+ | ``` | ||
+ | create role tester1 with superuser login password 'tester1'; | ||
+ | create database tester1 owner tester1; | ||
+ | dblink_connect('hostaddr=127.0.0.1 port=5432 dbname=tester1 user=tester1 password=tester1'); | ||
+ | |||
+ | CREATE USER dblinkuser WITH PASSWORD 'dblinkuser'; | ||
+ | ``` |
Revision as of 16:38, 2 April 2023
https://dbaclass.com/article/how-to-create-database-link-in-postgres/
create users in function via dblink
create role tester1 with superuser login password 'tester1'; create database tester1 owner tester1; dblink_connect('hostaddr=127.0.0.1 port=5432 dbname=tester1 user=tester1 password=tester1'); CREATE USER dblinkuser WITH PASSWORD 'dblinkuser';