> ## Documentation Index
> Fetch the complete documentation index at: https://artie.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Supabase PostgreSQL Source: Setup and Configuration

> Connect Supabase PostgreSQL as a source in Artie with IPv4 setup, credential configuration, service account creation, and logical replication publishing.

## Enable IPv4 address

To do this:

<Steps>
  <Step>
    Go to your project settings in Supabase
  </Step>

  <Step>
    Click on Add Ons
  </Step>

  <Step>
    Enable Dedicated IPv4 address
  </Step>
</Steps>

<Frame>
  <img src="https://mintcdn.com/artie/7-o7ioD6LfjZHdr6/assets/sources/postgres/supabase_ipv4.png?fit=max&auto=format&n=7-o7ioD6LfjZHdr6&q=85&s=34927b1f5537b8a38c317c505d1cddb1" alt="Supabase IPv4 Add on" width="1740" height="634" data-path="assets/sources/postgres/supabase_ipv4.png" />
</Frame>

## Supabase connection string

For logical replication to work, we'll need a direct connection to the database without the connection pooler.

To find your connection string, go to your connection page and click "Direct connection string".

<Frame>
  <img src="https://mintcdn.com/artie/7-o7ioD6LfjZHdr6/assets/sources/postgres/supabase_dsn.png?fit=max&auto=format&n=7-o7ioD6LfjZHdr6&q=85&s=3d021926f9b74b62a6e3a40fdb8b3cbf" alt="Supabase connection string" width="956" height="668" data-path="assets/sources/postgres/supabase_dsn.png" />
</Frame>

<br />

<Accordion title="Still having trouble?">
  If that's configured to be your default setting, click "Get connected" to get an expanded view, then make sure it's configured for a "Direct connection".

  <Frame>
    <img src="https://mintcdn.com/artie/7-o7ioD6LfjZHdr6/assets/sources/postgres/supabase_direct.png?fit=max&auto=format&n=7-o7ioD6LfjZHdr6&q=85&s=e3cbd4fa7218fe091734dd901a5434b4" alt="Supabase direct connection" width="895" height="1144" data-path="assets/sources/postgres/supabase_direct.png" />
  </Frame>
</Accordion>

## To create a service account, run this in Supabase:

<CodeGroup>
  ```sql setup.sql theme={null}
  CREATE USER artie_transfer WITH PASSWORD 'password';

  -- Grant replication permissions
  ALTER USER artie_transfer REPLICATION;

  -- Grant access to existing tables
  GRANT SELECT ON ALL TABLES IN SCHEMA public TO artie_transfer;

  -- Grant read-only access to future tables
  ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT SELECT ON TABLES TO artie_transfer;

  CREATE PUBLICATION dbz_publication FOR ALL TABLES WITH (publish_via_partition_root = true);
  ```
</CodeGroup>
