public inbox for pgsql-general@postgresql.org  
help / color / mirror / Atom feed
Suggestion for Easier Cross-Database Query Handling in PostgreSQL
6+ messages / 5 participants
[nested] [flat]

* Suggestion for Easier Cross-Database Query Handling in PostgreSQL
@ 2026-05-15 19:00 Shivam Pandey <shivampandey91199@gmail.com>
  2026-05-15 22:17 ` Re: Suggestion for Easier Cross-Database Query Handling in PostgreSQL Frank Heikens <frank@elevarq.com>
  2026-05-16 02:15 ` Re: Suggestion for Easier Cross-Database Query Handling in PostgreSQL Isaac Morland <isaac.morland@gmail.com>
  0 siblings, 2 replies; 6+ messages in thread

From: Shivam Pandey @ 2026-05-15 19:00 UTC (permalink / raw)
  To: pgsql-general

Hello PostgreSQL Team,

I would like to share feedback from a developer perspective regarding
cross-database querying in PostgreSQL.

One feature that many developers appreciate in MySQL is the ability to
directly query and join tables across multiple databases within the same
server instance. This approach becomes very useful in real-world situations
where applications need to access shared or distributed data quickly and
efficiently.

In PostgreSQL, achieving similar functionality often requires additional
setup using extensions such as postgres_fdw or dblink. While these
solutions are powerful and architecturally clean, they can feel complex for
developers who are building applications rapidly or migrating from systems
like MySQL.

It would be valuable if PostgreSQL could provide a more developer-friendly
and simplified native approach for cross-database querying while still
maintaining PostgreSQL’s strong isolation and security principles.

Possible improvements could include:

1)Simpler syntax for cross-database joins
2) Easier configuration for trusted local databases
3) Built-in lightweight federation support
4) Better onboarding documentation for multi-database use cases

PostgreSQL is already one of the most powerful and respected databases in
the industry. Enhancing developer convenience in this area could make
adoption even smoother for many teams.

Thank you for your incredible work and continuous innovation.

Best Regards,
Shivam Pandey


^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: Suggestion for Easier Cross-Database Query Handling in PostgreSQL
  2026-05-15 19:00 Suggestion for Easier Cross-Database Query Handling in PostgreSQL Shivam Pandey <shivampandey91199@gmail.com>
@ 2026-05-15 22:17 ` Frank Heikens <frank@elevarq.com>
  2026-05-15 22:56   ` Re: Suggestion for Easier Cross-Database Query Handling in PostgreSQL Ron Johnson <ronljohnsonjr@gmail.com>
  1 sibling, 1 reply; 6+ messages in thread

From: Frank Heikens @ 2026-05-15 22:17 UTC (permalink / raw)
  To: Shivam Pandey <shivampandey91199@gmail.com>; +Cc: pgsql-general


Hi Shivam,

Thank you for your feedback.

One important difference is terminology.

In MySQL, CREATE DATABASE and CREATE SCHEMA are essentially the same command, so what MySQL calls a “database” is effectively a schema (namespace).

PostgreSQL also supports querying across schemas natively, so the same functionality is already available when the objects are in the same PostgreSQL database.

In PostgreSQL, a database is a true isolation boundary with its own catalogs and connection context. Because of this design, direct joins across databases are not supported. When this is required, postgres_fdw is the recommended solution.

So for most MySQL users, the equivalent approach in PostgreSQL is to use multiple schemas within a single database rather than multiple databases.

Best regards,
Frank Heikens



> On May 15, 2026, at 3:06 PM, Shivam Pandey <shivampandey91199@gmail.com> wrote:
> 
> 
> Hello PostgreSQL Team,
> 
> I would like to share feedback from a developer perspective regarding cross-database querying in PostgreSQL.
> 
> One feature that many developers appreciate in MySQL is the ability to directly query and join tables across multiple databases within the same server instance. This approach becomes very useful in real-world situations where applications need to access shared or distributed data quickly and efficiently.
> 
> In PostgreSQL, achieving similar functionality often requires additional setup using extensions such as postgres_fdw or dblink. While these solutions are powerful and architecturally clean, they can feel complex for developers who are building applications rapidly or migrating from systems like MySQL.
> 
> It would be valuable if PostgreSQL could provide a more developer-friendly and simplified native approach for cross-database querying while still maintaining PostgreSQL’s strong isolation and security principles.
> 
> Possible improvements could include:
> 
> 1)Simpler syntax for cross-database joins
> 2) Easier configuration for trusted local databases
> 3) Built-in lightweight federation support
> 4) Better onboarding documentation for multi-database use cases
> 
> PostgreSQL is already one of the most powerful and respected databases in the industry. Enhancing developer convenience in this area could make adoption even smoother for many teams.
> 
> Thank you for your incredible work and continuous innovation.
> 
> Best Regards,
> Shivam Pandey 


^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: Suggestion for Easier Cross-Database Query Handling in PostgreSQL
  2026-05-15 19:00 Suggestion for Easier Cross-Database Query Handling in PostgreSQL Shivam Pandey <shivampandey91199@gmail.com>
  2026-05-15 22:17 ` Re: Suggestion for Easier Cross-Database Query Handling in PostgreSQL Frank Heikens <frank@elevarq.com>
@ 2026-05-15 22:56   ` Ron Johnson <ronljohnsonjr@gmail.com>
  2026-05-15 23:22     ` Re: Suggestion for Easier Cross-Database Query Handling in PostgreSQL Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 1 reply; 6+ messages in thread

From: Ron Johnson @ 2026-05-15 22:56 UTC (permalink / raw)
  To: pgsql-general

Frank,

Why doesn't the shared OID space make cross-database queries possible?  SQL
Server does it, so the idea isn't that far-fetched.

On Fri, May 15, 2026 at 6:18 PM Frank Heikens <frank@elevarq.com> wrote:

>
> Hi Shivam,
>
> Thank you for your feedback.
>
> One important difference is terminology.
>
> In MySQL, CREATE DATABASE and CREATE SCHEMA are essentially the same
> command, so what MySQL calls a “database” is effectively a schema
> (namespace).
>
> PostgreSQL also supports querying across schemas natively, so the same
> functionality is already available when the objects are in the same
> PostgreSQL database.
>
> In PostgreSQL, a database is a true isolation boundary with its own
> catalogs and connection context. Because of this design, direct joins
> across databases are not supported. When this is required, postgres_fdw is
> the recommended solution.
>
> So for most MySQL users, the equivalent approach in PostgreSQL is to use
> multiple schemas within a single database rather than multiple databases.
>
> Best regards,
> Frank Heikens
>
>
>
> > On May 15, 2026, at 3:06 PM, Shivam Pandey <shivampandey91199@gmail.com>
> wrote:
> >
> > 
> > Hello PostgreSQL Team,
> >
> > I would like to share feedback from a developer perspective regarding
> cross-database querying in PostgreSQL.
> >
> > One feature that many developers appreciate in MySQL is the ability to
> directly query and join tables across multiple databases within the same
> server instance. This approach becomes very useful in real-world situations
> where applications need to access shared or distributed data quickly and
> efficiently.
> >
> > In PostgreSQL, achieving similar functionality often requires additional
> setup using extensions such as postgres_fdw or dblink. While these
> solutions are powerful and architecturally clean, they can feel complex for
> developers who are building applications rapidly or migrating from systems
> like MySQL.
> >
> > It would be valuable if PostgreSQL could provide a more
> developer-friendly and simplified native approach for cross-database
> querying while still maintaining PostgreSQL’s strong isolation and security
> principles.
> >
> > Possible improvements could include:
> >
> > 1)Simpler syntax for cross-database joins
> > 2) Easier configuration for trusted local databases
> > 3) Built-in lightweight federation support
> > 4) Better onboarding documentation for multi-database use cases
> >
> > PostgreSQL is already one of the most powerful and respected databases
> in the industry. Enhancing developer convenience in this area could make
> adoption even smoother for many teams.
> >
> > Thank you for your incredible work and continuous innovation.
> >
> > Best Regards,
> > Shivam Pandey
>


-- 
Death to <Redacted>, and butter sauce.
Don't boil me, I'm still alive.
<Redacted> lobster!


^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: Suggestion for Easier Cross-Database Query Handling in PostgreSQL
  2026-05-15 19:00 Suggestion for Easier Cross-Database Query Handling in PostgreSQL Shivam Pandey <shivampandey91199@gmail.com>
  2026-05-15 22:17 ` Re: Suggestion for Easier Cross-Database Query Handling in PostgreSQL Frank Heikens <frank@elevarq.com>
  2026-05-15 22:56   ` Re: Suggestion for Easier Cross-Database Query Handling in PostgreSQL Ron Johnson <ronljohnsonjr@gmail.com>
@ 2026-05-15 23:22     ` Tom Lane <tgl@sss.pgh.pa.us>
  2026-05-15 23:57       ` Re: Suggestion for Easier Cross-Database Query Handling in PostgreSQL Ron Johnson <ronljohnsonjr@gmail.com>
  0 siblings, 1 reply; 6+ messages in thread

From: Tom Lane @ 2026-05-15 23:22 UTC (permalink / raw)
  To: Ron Johnson <ronljohnsonjr@gmail.com>; +Cc: pgsql-general

Ron Johnson <ronljohnsonjr@gmail.com> writes:
> Why doesn't the shared OID space make cross-database queries possible?

OIDs are not guaranteed unique across databases.  To make this work
transparently, we'd have to change all internal APIs to use database
OID + object OID, not just object OID, as object identifiers.  That
would be horrendously invasive, not to mention probably costly in
performance (by doubling the width of cache keys, for instance).

But totally independently of implementation considerations, it's not
apparent to me that this would be a good idea.  As Frank mentioned,
Postgres has always treated databases as isolation boundaries.
Changing that would probably break a lot of peoples' installation
designs.

			regards, tom lane





^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: Suggestion for Easier Cross-Database Query Handling in PostgreSQL
  2026-05-15 19:00 Suggestion for Easier Cross-Database Query Handling in PostgreSQL Shivam Pandey <shivampandey91199@gmail.com>
  2026-05-15 22:17 ` Re: Suggestion for Easier Cross-Database Query Handling in PostgreSQL Frank Heikens <frank@elevarq.com>
  2026-05-15 22:56   ` Re: Suggestion for Easier Cross-Database Query Handling in PostgreSQL Ron Johnson <ronljohnsonjr@gmail.com>
  2026-05-15 23:22     ` Re: Suggestion for Easier Cross-Database Query Handling in PostgreSQL Tom Lane <tgl@sss.pgh.pa.us>
@ 2026-05-15 23:57       ` Ron Johnson <ronljohnsonjr@gmail.com>
  0 siblings, 0 replies; 6+ messages in thread

From: Ron Johnson @ 2026-05-15 23:57 UTC (permalink / raw)
  To: pgsql-general

On Fri, May 15, 2026 at 7:22 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:

> Ron Johnson <ronljohnsonjr@gmail.com> writes:
> > Why doesn't the shared OID space make cross-database queries possible?
>
> OIDs are not guaranteed unique across databases.


Ah.


> But totally independently of implementation considerations, it's not
> apparent to me that this would be a good idea.  As Frank mentioned,
> Postgres has always treated databases as isolation boundaries.
> Changing that would probably break a lot of peoples' installation
> designs.
>

Even now, roles need privilege to access databases.

-- 
Death to <Redacted>, and butter sauce.
Don't boil me, I'm still alive.
<Redacted> lobster!


^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: Suggestion for Easier Cross-Database Query Handling in PostgreSQL
  2026-05-15 19:00 Suggestion for Easier Cross-Database Query Handling in PostgreSQL Shivam Pandey <shivampandey91199@gmail.com>
@ 2026-05-16 02:15 ` Isaac Morland <isaac.morland@gmail.com>
  1 sibling, 0 replies; 6+ messages in thread

From: Isaac Morland @ 2026-05-16 02:15 UTC (permalink / raw)
  To: Shivam Pandey <shivampandey91199@gmail.com>; +Cc: pgsql-general

On Fri, 15 May 2026 at 18:06, Shivam Pandey <shivampandey91199@gmail.com>
wrote:

> Hello PostgreSQL Team,
>
> I would like to share feedback from a developer perspective regarding
> cross-database querying in PostgreSQL.
>
> One feature that many developers appreciate in MySQL is the ability to
> directly query and join tables across multiple databases within the same
> server instance. This approach becomes very useful in real-world situations
> where applications need to access shared or distributed data quickly and
> efficiently.
>

What MySQL calls databases PostgreSQL calls schemas, and PostgreSQL
certainly has the ability to query and join tables across schemas.

What MySQL might call an instance (a collection of MySQL databases)
PostgreSQL calls a database (a collection of PostgreSQL schemas). A single
PostgreSQL instance has the ability to host multiple databases (albeit
sharing a single set of roles and role relationships). Can MySQL query and
join across multiple instances?


^ permalink  raw  reply  [nested|flat] 6+ messages in thread


end of thread, other threads:[~2026-05-16 02:15 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2026-05-15 19:00 Suggestion for Easier Cross-Database Query Handling in PostgreSQL Shivam Pandey <shivampandey91199@gmail.com>
2026-05-15 22:17 ` Frank Heikens <frank@elevarq.com>
2026-05-15 22:56   ` Ron Johnson <ronljohnsonjr@gmail.com>
2026-05-15 23:22     ` Tom Lane <tgl@sss.pgh.pa.us>
2026-05-15 23:57       ` Ron Johnson <ronljohnsonjr@gmail.com>
2026-05-16 02:15 ` Isaac Morland <isaac.morland@gmail.com>

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox