> ## 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

> Configure a Mirror pipeline YAML that streams a Goldsky curated dataset such as blocks, logs, or token transfers directly into a PostgreSQL sink.

<Warning>
  Mirror is Goldsky's previous-generation pipeline product. If you're building a new pipeline, use [Turbo](/turbo-pipelines/introduction) instead. See the [Mirror vs. Turbo comparison](/mirror-vs-turbo), or the [migration guide](/turbo-pipelines/migrate-from-mirror) if you have an existing Mirror pipeline.
</Warning>

This pipeline is named `raw-logs-pipeline`. It pulls data from a Goldsky dataset, without performing any transformations, and stores the result into a PostgreSQL sink, in a table called `eth_logs` in the `goldsky` schema.

```yaml raw-logs-pipeline.yaml theme={null}
name: raw-logs-pipeline
apiVersion: 3
sources:
  my_ethereum_raw_logs:
    dataset_name: ethereum.raw_logs
    version: 1.0.0
    type: dataset
    start_at: latest

transforms:
  logs:
    sql: |
      SELECT
          id,
          address,
          topics,
          data,
          block_number,
          block_hash,
          transaction_hash
      FROM
          my_ethereum_raw_logs
    primary_key: id

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

You can start above pipeline by running:

```bash theme={null}
goldsky pipeline start pipeline.yaml
```

Or

```bash theme={null}
goldsky pipeline apply pipeline.yaml --status ACTIVE
```


## Related topics

- [Sync a subgraph to PostgreSQL with Mirror](/mirror/guides/sync-subgraph-to-postgres.md)
- [PostgreSQL sink for Turbo pipelines](/turbo-pipelines/sinks/postgres.md)
- [Agent Skills](/ai-skills.md)
- [Non-EVM dataset schemas: Beacon, Solana, and more](/mirror/reference/schema/non-EVM-schemas.md)
- [zkSync Era](/chains/zksync-era.md)
