<p>I use <a href="https://github.com/zalando/postgres-operator" rel="nofollow noreferrer">https://github.com/zalando/postgres-operator</a> to deploy PostgreSQL instances and have the following running instances:</p>

<pre><code>kubectl get postgresqls.acid.zalan.do 
NAME                   TEAM        VERSION   PODS   VOLUME   CPU-REQUEST   MEMORY-REQUEST   AGE     STATUS
acid-minimal-cluster   acid        12        2      1Gi                                     2d18h   SyncFailed
acid-userdb            acid        12        2      5Gi      100m          100Mi            2d18h   SyncFailed
databaker-userdb       databaker   12        2      2Gi      100m          100Mi            2d18h   SyncFailed
databaker-users-db     databaker   12        2      2Gi      100m          100Mi            2d17h   SyncFailed
</code></pre>

<p>I try to get the instance as follows:</p>

<pre><code>kubectl get postgresql --field-selector NAME=databaker-userdb
Error from server (BadRequest): Unable to find "acid.zalan.do/v1, Resource=postgresqls" that match label selector "", field selector "NAME=databaker-userdb": field label not supported: NAME
</code></pre>

<p>as you can see, I've got error message.  </p>

<p>What am I doing wrong?</p>

<p><strong>Update</strong></p>

<p>The yaml file</p>

<pre><code>apiVersion: acid.zalan.do/v1
kind: postgresql
metadata:
  annotations:
    meta.helm.sh/release-name: user-db
    meta.helm.sh/release-namespace: default
  creationTimestamp: "2020-06-16T15:58:28Z"
  generation: 1
  labels:
    app.kubernetes.io/managed-by: Helm
    team: databaker
  managedFields:
  - apiVersion: acid.zalan.do/v1
    fieldsType: FieldsV1
    fieldsV1:
      f:metadata:
        f:annotations:
          .: {}
          f:meta.helm.sh/release-name: {}
          f:meta.helm.sh/release-namespace: {}
        f:labels:
          .: {}
          f:app.kubernetes.io/managed-by: {}
          f:team: {}
      f:spec:
        .: {}
        f:databases:
          .: {}
          f:users: {}
        f:numberOfInstances: {}
        f:postgresql:
          .: {}
          f:version: {}
        f:resources:
          .: {}
          f:limits:
            .: {}
            f:cpu: {}
            f:memory: {}
          f:requests:
            .: {}
            f:cpu: {}
            f:memory: {}
        f:teamId: {}
        f:users:
          .: {}
          f:databaker: {}
        f:volume:
          .: {}
          f:size: {}
    manager: Go-http-client
    operation: Update
    time: "2020-06-16T15:58:28Z"
  - apiVersion: acid.zalan.do/v1
    fieldsType: FieldsV1
    fieldsV1:
      f:status:
        .: {}
        f:PostgresClusterStatus: {}
    manager: postgres-operator
    operation: Update
    time: "2020-06-16T15:58:53Z"
  name: databaker-users-db
  namespace: default
  resourceVersion: "68486"
  selfLink: /apis/acid.zalan.do/v1/namespaces/default/postgresqls/databaker-users-db
  uid: 8bc3b591-4346-4cca-a1ae-682a1ad16615
spec:
  databases:
    users: databaker
  numberOfInstances: 2
  postgresql:
    version: "12"
  resources:
    limits:
      cpu: 500m
      memory: 500Mi
    requests:
      cpu: 100m
      memory: 100Mi
  teamId: databaker
  users:
    databaker:
    - superuser
    - createdb
  volume:
    size: 2Gi
status:
  PostgresClusterStatus: Running
</code></pre>

<p>From the <a href="https://kubernetes.io/docs/concepts/overview/working-with-objects/field-selectors/" rel="nofollow noreferrer">documentation </a></p>

<blockquote>
  <p>Field selectors let you select Kubernetes resources based on the value of one or more resource fields. Here are some examples of field selector queries:</p>
  
  <ul>
  <li>metadata.name=my-service</li>
  <li>metadata.namespace!=default </li>
  <li>status.phase=Pending</li>
  </ul>
</blockquote>

<p><strong>NAME</strong> is not resource field, You can use like following</p>

<pre><code>$ kubectl get postgresql --field-selector metadata.name=databaker-userdb
</code></pre>

<p>According to documentation</p>

<blockquote>
  <p>Supported field selectors vary by Kubernetes resource type. All resource types support the metadata.name and metadata.namespace fields. Using unsupported field selectors produces an error.</p>
</blockquote>

<p>To get according to status, you can run</p>

<pre><code>$ kubectl get postgresql | grep "SyncFailed"

</code></pre>
