# AZ206: A key written wrongly, or of the wrong shape

A type's key is its table's primary key: `id bigint` unless written after the table, `type folder = app.folders (folder_no)` or `(id uuid)`. A composite key names each column, `(org_id, slug text)`, of integers, text or uuid. No key is a date, a time, an interval or money: ids are kept as text, and these write theirs by the session's settings. Nor a numeric, a float or a bytea, which write one value several ways (`2` and `2.0` are one numeric). A type that signs in (the user type, principals) has a key of one column. A relation to a type with a composite key gives its columns in brackets: `page : doc = [org_id, doc_slug]`.

Reported when the policy is compiled: `rowstile check`, the editor, `rowstile dev`.

## The mistake

```authz
app role app_user
type user = app.users
type folder = app.folders (id bigint uuid)
  owner : user = owner_id
  can view = owner
```

```
line 3: write the key as (column [type]), or (col1 [type], col2 [type]) for a composite key [AZ206]
```

## Fixed

```authz
app role app_user
type user = app.users
type folder = app.folders (id uuid)
  owner : user = owner_id
  can view = owner
```
