# Syncing specific schema tables in PostgreSQL with CloudQuery

**URL:** <https://community.cloudquery.io/t/syncing-specific-schema-tables-in-postgresql-with-cloudquery/655>\
**Category:** CloudQuery Plugins\
**Created:** [October 18, 2023, 1:56pm UTC](https://community.cloudquery.io/t/syncing-specific-schema-tables-in-postgresql-with-cloudquery/655 "2023-10-18T13:56:57Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ample-dog](https://avatars.discourse-cdn.com/v4/letter/a/8c91f0/32.png) [@ample-dog](https://community.cloudquery.io/u/ample-dog)\
**Post date:** [October 18, 2023, 1:56pm UTC](https://community.cloudquery.io/t/syncing-specific-schema-tables-in-postgresql-with-cloudquery/655/1 "2023-10-18T13:56:57Z")

</div>

Hello, I’m trying to sync data from PostgreSQL to PostgreSQL. I did not find a way to synchronize **only** tables in a specific schema.

---

<div class="post-metadata">

**Author:** ![erez](https://sea1.discourse-cdn.com/flex001/user_avatar/community.cloudquery.io/erez/32/40_2.png) [@erez](https://community.cloudquery.io/u/erez)\
**Post date:** [October 18, 2023, 2:02pm UTC](https://community.cloudquery.io/t/syncing-specific-schema-tables-in-postgresql-with-cloudquery/655/2 "2023-10-18T14:02:48Z")

</div>

Hi @ample-dog, can you try specifying the schema in the connection string? It should look like:

```yaml
kind: source
spec:
  name: "postgresql"
  registry: "github"
  path: "cloudquery/postgresql"
  version: "v3.0.6"
  tables: ["*"]
  spec:
    connection_string: "postgresql://postgres:pass@localhost:5432/postgres?search_path=stitch_google_ads"

```

---

<div class="post-metadata">

**Author:** ![ample-dog](https://avatars.discourse-cdn.com/v4/letter/a/8c91f0/32.png) [@ample-dog](https://community.cloudquery.io/u/ample-dog)\
**Post date:** [October 18, 2023, 2:15pm UTC](https://community.cloudquery.io/t/syncing-specific-schema-tables-in-postgresql-with-cloudquery/655/3 "2023-10-18T14:15:21Z")

</div>

Yes, it worked, but now I have another problem.  
I made the sync in the “public” schema. Where in the destination spec should I change the schema?

---

<div class="post-metadata">

**Author:** ![erez](https://sea1.discourse-cdn.com/flex001/user_avatar/community.cloudquery.io/erez/32/40_2.png) [@erez](https://community.cloudquery.io/u/erez)\
**Post date:** [October 18, 2023, 2:22pm UTC](https://community.cloudquery.io/t/syncing-specific-schema-tables-in-postgresql-with-cloudquery/655/4 "2023-10-18T14:22:24Z")

</div>

The configuration should be similar:

```yaml
kind: destination
spec:
  name: "postgresql"
  registry: "github"
  path: "cloudquery/postgresql"
  version: "v6.1.0"

  spec:
    connection_string: "postgresql://postgres:pass@localhost:5432/postgres?search_path=stitch_google_ads"

```

---

<div class="post-metadata">

**Author:** ![ample-dog](https://avatars.discourse-cdn.com/v4/letter/a/8c91f0/32.png) [@ample-dog](https://community.cloudquery.io/u/ample-dog)\
**Post date:** [October 18, 2023, 3:11pm UTC](https://community.cloudquery.io/t/syncing-specific-schema-tables-in-postgresql-with-cloudquery/655/5 "2023-10-18T15:11:24Z")

</div>

Yep, thanks a lot!  
It’s working.  
CloudQuery is fantastic!
