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

# Sync dataset to Postgres

> Sync a Goldsky dataset directly to a PostgreSQL sink with a simple Turbo pipeline definition.

This pipeline is named `raw-logs-pipeline`. It pulls data from a Goldsky dataset, selects a handful of columns without any further transformation, and stores the result in a [PostgreSQL sink](/turbo-pipelines/sinks/postgres), in a table called `eth_logs` in the `goldsky` schema.

```yaml raw-logs-pipeline.yaml theme={"dark"}
name: raw-logs-pipeline
resource_size: s

sources:
  my_ethereum_raw_logs:
    type: dataset
    dataset_name: ethereum.raw_logs
    version: 1.0.0
    start_at: latest

transforms:
  # Project the log columns we want to persist
  logs:
    type: sql
    primary_key: id
    sql: |
      SELECT
        id,
        address,
        topics,
        data,
        block_number,
        block_hash,
        transaction_hash
      FROM my_ethereum_raw_logs

sinks:
  logs_sink:
    type: postgres
    from: logs
    schema: goldsky
    table: eth_logs
    secret_name: API_POSTGRES_CREDENTIALS
    primary_key: id
```

The `secret_name` references a secret containing your Postgres connection string (`postgres://username:password@host:port/database`). Create one with `goldsky secret create API_POSTGRES_CREDENTIALS`; see [managing secrets](/platform/secrets).

You can start the above pipeline by running:

```bash theme={"dark"}
goldsky turbo apply raw-logs-pipeline.yaml
```

Once it's running, watch the records flow through it with [live inspect](/turbo-pipelines/live-inspect):

```bash theme={"dark"}
goldsky turbo inspect raw-logs-pipeline
```


## Related topics

- [PostgreSQL sink for Turbo pipelines](/turbo-pipelines/sinks/postgres.md)
- [Agent Skills](/ai-skills.md)
- [Non-EVM dataset schemas: Beacon, Solana, and more](/turbo-pipelines/reference/schema/non-EVM-schemas.md)
- [Create a cross-chain subgraph](/subgraphs/guides/create-a-cross-chain-subgraph.md)
- [zkSync Era](/chains/zksync-era.md)
