pg.ddx.io pgsql-admin@postgresql.org mailing list archive
help / color / mirror / Atom feedAccessing dblink without using username and Password
2+ messages / 2 participants
[nested] [flat]
* Accessing dblink without using username and Password
@ 2022-01-11 07:25 Daulat <daulat.dba@gmail.com>
0 siblings, 1 reply; 2+ messages in thread
From: Daulat @ 2022-01-11 07:25 UTC (permalink / raw)
To: pgsql-admin <pgsql-admin@lists.postgresql.org>
Hello Team,
I need to know how we can access table data from a locally or remote
database using dblink and without giving username and password.
In the hba.conf file, md5 is allowed for all connections.
It looks like we can do this approach using superuser but not from the
normal users.
Here, I have tried to access the data of one table from a database created
locally.
[postgres@ip-172-31-32-99 bin]$ ./psql -d Performance_DB_104_28MAR21 -U
trumos
psql (10.2)
Type "help" for help.
Performance_DB_104_28MAR21=> show search_path;
search_path
-----------------
"$user", public
(1 row)
Performance_DB_104_28MAR21=> SELECT * FROM
ucf.dblink('dbname=DemoDB','SELECT processstatusid,createdby FROM
ucf.ucf_processstatus') AS t1 (processstatusid integer, createdby integer);
ERROR: password is required
DETAIL: Non-superusers must provide a password in the connection string.
Performance_DB_104_28MAR21=>
Please suggest !
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: Accessing dblink without using username and Password
@ 2022-01-11 08:07 Holger Jakobs <holger@jakobs.com>
parent: Daulat <daulat.dba@gmail.com>
0 siblings, 0 replies; 2+ messages in thread
From: Holger Jakobs @ 2022-01-11 08:07 UTC (permalink / raw)
To: pgsql-admin@lists.postgresql.org
Am 11.01.22 um 08:25 schrieb Daulat:
> Hello Team,
>
> I need to know how we can access table data from a locally or remote
> database using dblink and without giving username and password.
> In the hba.conf file, md5 is allowed for all connections.
>
> It looks like we can do this approach using superuser but not from the
> normal users.
>
> Here, I have tried to access the data of one table from a database
> created locally.
>
> [postgres@ip-172-31-32-99 bin]$ ./psql -d Performance_DB_104_28MAR21
> -U trumos
> psql (10.2)
> Type "help" for help.
>
> Performance_DB_104_28MAR21=> show search_path;
> search_path
> -----------------
> "$user", public
> (1 row)
>
> Performance_DB_104_28MAR21=> SELECT * FROM
> ucf.dblink('dbname=DemoDB','SELECT processstatusid,createdby FROM
> ucf.ucf_processstatus') AS t1 (processstatusid integer, createdby
> integer);
> ERROR: password is required
> DETAIL: Non-superusers must provide a password in the connection string.
> Performance_DB_104_28MAR21=>
>
> Please suggest !
Hallo Daulat,
What about using certificates? If you already have a PKI infrastructure,
you can use these. Otherwise, you can use OpenSSL to create a
certification authority and the key pairs.
Btw, the dblink module has been superceded by foreign data wrappers.
Regards,
Holger
--
Holger Jakobs, Bergisch Gladbach, Tel. +49-178-9759012
Attachments:
OpenPGP_signature (application/pgp-signature, 202B) download
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2022-01-11 08:07 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2022-01-11 07:25 Accessing dblink without using username and Password Daulat <daulat.dba@gmail.com>
2022-01-11 08:07 ` Holger Jakobs <holger@jakobs.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox