<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Synced Tables - Partitioned Tables in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/synced-tables-partitioned-tables/m-p/165385#M55430</link>
    <description>&lt;P&gt;I am using synced tables with Lakebase Postgres and am seeing that all Postgres tables created via synced tables have a partition set based on the primary key I select when making the synced table. This is resulting in our downstream users in Postgres not having access to the table we made due to them not having partition access. Is there a way to denote a primary key without making the Postgres table a partitioned table? We are trying to grant select access on the whole table once instead of needing to maintain partition access.&lt;/P&gt;</description>
    <pubDate>Tue, 11 Aug 2026 14:29:03 GMT</pubDate>
    <dc:creator>tpde</dc:creator>
    <dc:date>2026-08-11T14:29:03Z</dc:date>
    <item>
      <title>Synced Tables - Partitioned Tables</title>
      <link>https://community.databricks.com/t5/data-engineering/synced-tables-partitioned-tables/m-p/165385#M55430</link>
      <description>&lt;P&gt;I am using synced tables with Lakebase Postgres and am seeing that all Postgres tables created via synced tables have a partition set based on the primary key I select when making the synced table. This is resulting in our downstream users in Postgres not having access to the table we made due to them not having partition access. Is there a way to denote a primary key without making the Postgres table a partitioned table? We are trying to grant select access on the whole table once instead of needing to maintain partition access.&lt;/P&gt;</description>
      <pubDate>Tue, 11 Aug 2026 14:29:03 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/synced-tables-partitioned-tables/m-p/165385#M55430</guid>
      <dc:creator>tpde</dc:creator>
      <dc:date>2026-08-11T14:29:03Z</dc:date>
    </item>
    <item>
      <title>Re: Synced Tables - Partitioned Tables</title>
      <link>https://community.databricks.com/t5/data-engineering/synced-tables-partitioned-tables/m-p/165396#M55432</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/247511"&gt;@tpde&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;This is expected behavior — synced tables in Lakebase use hash partitioning on the primary key internally for sync pipeline performance (parallel upserts). There's currently no option to create a synced table without partitioning.&lt;/P&gt;&lt;P&gt;However, you shouldn't need per-partition grants. The fix is in how you're granting access. As databricks_superuser, run:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;-- Grant schema-level usage first
GRANT USAGE ON SCHEMA &amp;lt;your_schema&amp;gt; TO &amp;lt;role&amp;gt;;

-- Then grant SELECT on the parent (partitioned) table
GRANT SELECT ON &amp;lt;your_synced_table&amp;gt; TO &amp;lt;role&amp;gt;;&lt;/LI-CODE&gt;&lt;P&gt;In PostgreSQL 11+ (which Lakebase uses), GRANT SELECT on a partitioned parent table automatically propagates to all existing partitions. If your downstream users still can't access it, the issue is likely one of:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;&lt;STRONG&gt;Missing USAGE on the schema&lt;/STRONG&gt; — without this, the table-level grant is invisible to the role.&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;Grants were issued before some partitions were created&lt;/STRONG&gt; (race condition with the sync pipeline creating new partitions). Fix with:&lt;/LI&gt;&lt;/OL&gt;&lt;LI-CODE lang="markup"&gt;-- Covers all existing tables in the schema, including partition tables
GRANT SELECT ON ALL TABLES IN SCHEMA &amp;lt;your_schema&amp;gt; TO &amp;lt;role&amp;gt;;

-- Ensures future partitions (created by the sync pipeline) inherit the grant
ALTER DEFAULT PRIVILEGES IN SCHEMA &amp;lt;your_schema&amp;gt; GRANT SELECT ON TABLES TO &amp;lt;role&amp;gt;;&lt;/LI-CODE&gt;&lt;P&gt;&lt;STRONG&gt;Important note:&lt;/STRONG&gt;&amp;nbsp;Synced tables are owned by the internal&amp;nbsp;databricks_writer_&amp;lt;dbid&amp;gt;&amp;nbsp;role (not by you), so only&amp;nbsp;databricks_superuser&amp;nbsp;can issue these grants. Regular users with&amp;nbsp;pg_read_all_data&amp;nbsp;(which&amp;nbsp;databricks_superuser&amp;nbsp;has) bypass partition-level checks entirely, which is why the creator can read it but other roles can't.&lt;/P&gt;&lt;P&gt;The&amp;nbsp;ALTER DEFAULT PRIVILEGES&amp;nbsp;approach is the "set it and forget it" solution — any new partitions created during future syncs will automatically inherit the SELECT grant.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;If my answer was helpful, please consider marking it as accepted solution!&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 11 Aug 2026 16:18:16 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/synced-tables-partitioned-tables/m-p/165396#M55432</guid>
      <dc:creator>GabFernandes</dc:creator>
      <dc:date>2026-08-11T16:18:16Z</dc:date>
    </item>
  </channel>
</rss>

