# Database-Specific Troubleshooting

> Source: https://docs.synthesized.io/tdk/latest/user_guide/080_troubleshooting/database_specific/
> For the complete documentation index, see [llms.txt](https://docs.synthesized.io/llms.txt).

Solutions to issues specific to particular database platforms.

## Overview

Each database platform has unique characteristics and potential issues:

- PostgreSQL-specific problems
- MySQL issues
- Oracle Database concerns
- SQL Server challenges

## PostgreSQL

### Schema Search Path

**Issue**: Tables not found despite correct names.

**Solution**: Set search path explicitly:

```yaml
data_sources:
  input:
    url: jdbc:postgresql://host:5432/db?currentSchema=public,schema1,schema2
```

### Large Object Support

**Issue**: BLOB/CLOB handling errors.

**Solution**: Adjust LO (Large Object) settings:

```yaml
url: jdbc:postgresql://host:5432/db?ApplicationName=TDK&lobMode=on
```

## MySQL

### max\_allowed\_packet

**Issue**: "Packet too large" errors.

**Solution**: Increase packet size:

```sql
SET GLOBAL max_allowed_packet=1073741824;  -- 1GB
```

### ENUM Types

**Issue**: ENUM values not preserved correctly.

**Solution**: Use Categorical transformer:

```yaml
transformations:
  - columns: ["status"]
    type: Categorical
```

## Oracle

### ORA-00001: Unique Constraint Violated

**Issue**: Sequence values conflict with existing data.

**Solution**: Reset sequences before generation:

```sql
-- Reset sequence
ALTER SEQUENCE customer_seq RESTART WITH 10000;
```

### TNS Configuration

**Issue**: "TNS: could not resolve connect identifier".

**Solution**: Verify tnsnames.ora and set TNS\_ADMIN:

```shell
export TNS_ADMIN=/path/to/tnsnames.ora
```

## SQL Server

### Identity Columns

**Issue**: Cannot insert into IDENTITY columns.

**Solution**: TDK handles this automatically, but verify:

```sql
-- Check IDENTITY columns
SELECT name, is_identity
FROM sys.columns
WHERE object_id = OBJECT_ID('dbo.customers');
```

### Collation Issues

**Issue**: Comparison or sorting errors.

**Solution**: Specify collation in connection string:

```yaml
url: jdbc:sqlserver://host:1433;database=db;collation=SQL_Latin1_General_CP1_CI_AS
```

## See Also

- [Database Integrations](https://docs.synthesized.io/tdk/latest/user_guide/070_integrations/databases/)
