<commit_before>---
title: Frequently Asked Questions
aliases:
  - /influxdb/v1.4/troubleshooting/frequently_encountered_issues/

menu:
  influxdb_1_4:
    weight: 0
    parent: troubleshooting
---

This page addresses frequent sources of confusion and places where InfluxDB behaves in an unexpected way relative to other database systems.
Where applicable, it links to outstanding issues on GitHub.

**Administration**  

* [How do I include a single quote in a password?](#how-do-i-include-a-single-quote-in-a-password)  
* [How can I identify my version of InfluxDB?](#how-can-i-identify-my-version-of-influxdb)  
* [Where can I find InfluxDB logs?](#where-can-i-find-influxdb-logs)
* [What is the relationship between shard group durations and retention policies?](#what-is-the-relationship-between-shard-group-durations-and-retention-policies)
* [Why aren't data dropped after I've altered a retention policy?](#why-aren-t-data-dropped-after-i-ve-altered-a-retention-policy)
* [Why does InfluxDB fail to parse microsecond units in the configuration file?](#why-does-influxdb-fail-to-parse-microsecond-units-in-the-configuration-file)

**Command Line Interface (CLI)**

* [How do I make InfluxDB’s CLI return human readable timestamps?](#how-do-i-make-influxdb-s-cli-return-human-readable-timestamps)  
* [How can a non-admin user `USE` a database in InfluxDB's CLI?](#how-can-a-non-admin-user-use-a-database-in-influxdb-s-cli)  
* [How do I write to a non-`DEFAULT` retention policy with InfluxDB's CLI?](#how-do-i-write-to-a-non-default-retention-policy-with-influxdb-s-cli)
* [How do I cancel a long-running query?](#how-do-i-cancel-a-long-running-query)

**Data Types**

* [Why can't I query boolean field values?](#why-can-t-i-query-boolean-field-values)  
* [How does InfluxDB handle field type discrepancies across shards?](#how-does-influxdb-handle-field-type-discrepancies-across-shards)  
* [What are the minimum and maximum integers that InfluxDB can store?](#what-are-the-minimum-and-maximum-integers-that-influxdb-can-store)  
* [What are the minimum and maximum timestamps that InfluxDB can store?](#what-are-the-minimum-and-maximum-timestamps-that-influxdb-can-store)
* [How can I tell what type of data are stored in a field?](#how-can-i-tell-what-type-of-data-are-stored-in-a-field)
* [Can I change a field's data type?](#can-i-change-a-field-s-data-type)

**InfluxQL Functions**

* [How do I perform mathematical operations within a function?](#how-do-i-perform-mathematical-operations-within-a-function)  
* [Why does my query return epoch 0 as the timestamp?](#why-does-my-query-return-epoch-0-as-the-timestamp)   
* [Which InfluxQL functions support nesting?](#which-influxql-functions-support-nesting)

**Querying Data**  

* [What determines the time intervals returned by `GROUP BY time()` queries?](#what-determines-the-time-intervals-returned-by-group-by-time-queries)  
* [Why do my queries return no data or partial data?](#why-do-my-queries-return-no-data-or-partial-data)
* [Why don't my `GROUP BY time()` queries return timestamps that occur after `now()`?](#why-don-t-my-group-by-time-queries-return-timestamps-that-occur-after-now)  
* [Can I perform mathematical operations against timestamps?](#can-i-perform-mathematical-operations-against-timestamps)  
* [Can I identify write precision from returned timestamps?](#can-i-identify-write-precision-from-returned-timestamps)  
* [When should I single quote and when should I double quote in queries?](#when-should-i-single-quote-and-when-should-i-double-quote-in-queries)  
* [Why am I missing data after creating a new `DEFAULT` retention policy?](#why-am-i-missing-data-after-creating-a-new-default-retention-policy)
* [Why is my query with a `WHERE OR` time clause returning empty results?](#why-is-my-query-with-a-where-or-time-clause-returning-empty-results)
* [Why does `fill(previous)` return empty results?](#why-does-fill-previous-return-empty-results)
* [Why are my `INTO` queries missing data?](#why-are-my-into-queries-missing-data)
* [How do I query data with an identical tag key and field key?](#how-do-i-query-data-with-an-identical-tag-key-and-field-key)
* [How do I query data across measurements?](#how-do-i-query-data-across-measurements)
* [Does the order of the timestamps matter?](#does-the-order-of-the-timestamps-matter)
* [How do I `SELECT` data with a tag that has no value?](#how-do-i-select-data-with-a-tag-that-has-no-value)

**Series and Series Cardinality**

* [How can I query for series cardinality?](#how-can-i-query-for-series-cardinality)  
* [Why does series cardinality matter?](#why-does-series-cardinality-matter)  
* [How can I remove series from the index?](#how-can-i-remove-series-from-the-index)

**Writing Data**  

* [How do I write integer field values?](#how-do-i-write-integer-field-values)   
* [How does InfluxDB handle duplicate points?](#how-does-influxdb-handle-duplicate-points)  
* [What newline character does the HTTP API require?](#what-newline-character-does-the-http-api-require)
* [What words and characters should I avoid when writing data to InfluxDB?](#what-words-and-characters-should-i-avoid-when-writing-data-to-influxdb)  
* [When should I single quote and when should I double quote when writing data?](#when-should-i-single-quote-and-when-should-i-double-quote-when-writing-data)  
* [Does the precision of the timestamp matter?](#does-the-precision-of-the-timestamp-matter)
* [What are the configuration recommendations and schema guidelines for writing sparse, historical data?](#what-are-the-configuration-recommendations-and-schema-guidelines-for-writing-sparse-historical-data)

## How do I include a single quote in a password?
Escape the single quote with a backslash (`\`) both when creating the password
and when sending authentication requests.

## How can I identify my version of InfluxDB?
There a number of ways to identify the version of InfluxDB that you're using:

#### Run `influxd version` in your terminal:
```
$ influxd version

InfluxDB ✨ v1.4.0 ✨ (git: master b7bb7e8359642b6e071735b50ae41f5eb343fd42)
```

#### `curl` the `/ping` endpoint:

```
$ curl -i 'http://localhost:8086/ping'

HTTP/1.1 204 No Content
Content-Type: application/json
Request-Id: 1e08aeb6-fec0-11e6-8486-000000000000
✨ X-Influxdb-Version: 1.4.x ✨
Date: Wed, 01 Mar 2017 20:46:17 GMT
```

#### Launch InfluxDB's [Command Line Interface](/influxdb/v1.4/tools/shell/):

```
$ influx

Connected to http://localhost:8086✨ version 1.4.x ✨  
InfluxDB shell version: 1.4.x
```

#### Check the HTTP response in your logs:  

```
$ journald-ctl -u influxdb.service

Mar 01 20:49:45 rk-api influxd[29560]: [httpd] 127.0.0.1 - - [01/Mar/2017:20:49:45 +0000] "POST /query?db=&epoch=ns&q=SHOW+DATABASES HTTP/1.1" 200 151 "-" ✨ "InfluxDBShell/1.4.x" ✨ 9a4371a1-fec0-11e6-84b6-000000000000 1709
```

## Where can I find InfluxDB logs?

On System V operating systems logs are stored under `/var/log/influxdb/`.

On systemd operating systems you can access the logs using `journalctl`.
Use `journalctl -u influxdb` to view the logs in the journal or `journalctl -u influxdb > influxd.log` to print the logs to a text file. With systemd, log retention depends on your system's journald settings.

## What is the relationship between shard group durations and retention policies?

InfluxDB stores data in shard groups.
A single shard group covers a specific time interval; InfluxDB determines that time interval by looking at the `DURATION` of the relevant retention policy (RP).
The table below outlines the default relationship between the `DURATION` of an RP and the time interval of a shard group:

| RP duration  | Shard group interval  |
|---|---|
| < 2 days  | 1 hour  |
| >= 2 days and <= 6 months  | 1 day  |
| > 6 months  | 7 days  |


Users can also configure the shard group duration with the
[`CREATE RETENTION POLICY`](/influxdb/v1.4/query_language/database_management/#create-retention-policies-with-create-retention-policy)
and
[`ALTER RETENTION POLICY`](/influxdb/v1.4/query_language/database_management/#modify-retention-policies-with-alter-retention-policy)
statements.
Check your retention policy's shard group duration with the
[`SHOW RETENTION POLICY`](/influxdb/v1.4/query_language/schema_exploration/#explore-retention-policies-with-show-retention-policies)
statement.

## Why aren't data dropped after I've altered a retention policy?

Several factors explain why data may not be immediately dropped after a
retention policy (RP) change.

The first and most likely cause is that, by default, InfluxDB checks to enforce
an RP every 30 minutes.
You may need to wait for the next RP check for InfluxDB to drop data that are
outside the RP's new `DURATION` setting.
The 30 minute interval is
[configurable](/influxdb/v1.4/administration/config/#check-interval-30m0s).

Second, altering both the `DURATION` and `SHARD DURATION` of an RP can result in
unexpected data retention.
InfluxDB stores data in shard groups which cover a specific RP and time
interval.
When InfluxDB enforces an RP it drops entire shard groups, not individual data
points.
InfluxDB cannot divide shard groups.

If the RP's new `DURATION` is less than the old `SHARD DURATION` and InfluxDB is
currently writing data to one of the old, longer shard groups, the system is
forced to keep all of the data in that shard group.
This occurs even if some of the data in that shard group are outside of the new
`DURATION`.
InfluxDB will drop that shard group once all of its data are outside the new
`DURATION`.
The system will then begin writing data to shard groups that have the new,
shorter `SHARD DURATION` preventing any further unexpected data retention.

## Why does InfluxDB fail to parse microsecond units in the configuration file?
The syntax for specifying microsecond duration units differs for [configuration](/influxdb/v1.4/administration/config/) settings, writes, queries, and setting the precision in InfluxDB's [Command Line Interface](/influxdb/v1.4/tools/shell/) (CLI).
The table below shows the supported syntax for each category:

| |  Configuration File | HTTP API Writes | All Queries  | CLI Precision Command |
|---|---|---|---|---|
| u  | ❌ | 👍  |  👍 |  👍  |
| us |  👍  | ❌ | ❌ |  ❌ |
|  µ  | ❌ | ❌ |  👍  | ❌ |  
|  µs  | 👍  | ❌ | ❌ |  ❌ |  


If a configuration option specifies the `u` or `µ` syntax, InfluxDB fails to start and reports the following error in the logs:
```
run: parse config: time: unknown unit [µ|u] in duration [<integer>µ|<integer>u]
```

## How do I make InfluxDB’s CLI return human readable timestamps?

When you first connect to the CLI, specify the [rfc3339](https://www.ietf.org/rfc/rfc3339.txt) precision:

```
$ influx -precision rfc3339
```

Alternatively, specify the precision once you’ve already connected to the CLI:

```
$ influx
Connected to http://localhost:8086 version 0.xx.x
InfluxDB shell 0.xx.x
> precision rfc3339
>
```

Check out [CLI/Shell](/influxdb/v1.4/tools/shell/) for more useful CLI options.

## How can a non-admin user `USE` a database in InfluxDB's CLI?

In versions prior to v1.3, [non-admin users](/influxdb/v1.4/query_language/authentication_and_authorization/#user-types-and-privileges) could not execute a `USE <database_name>` query in the CLI even if they had `READ` and/or `WRITE` permissions on that database.

Starting with version 1.3, non-admin users can execute the `USE <database_name>` query for databases on which they have `READ` and/or `WRITE` permissions.
If a non-admin user attempts to `USE` a database on which the user doesn't have `READ` and/or `WRITE` permissions, the system returns an error:
```
ERR: Database <database_name> doesn't exist. Run SHOW DATABASES for a list of existing databases.
```
> **Note** that the [`SHOW DATABASES` query](/influxdb/v1.4/query_language/schema_exploration/#show-databases) returns only those databases on which the non-admin user has `READ` and/or `WRITE` permissions.

## How do I write to a non-DEFAULT retention policy with InfluxDB's CLI?

Use the syntax `INSERT INTO [<database>.]<retention_policy> <line_protocol>` to write data to a non-`DEFAULT` retention policy using the CLI.
(Specifying the database and retention policy this way is only allowed with the CLI.
Writes over HTTP must specify the database and optionally the retention policy with the `db` and `rp` query parameters.)

For example:

```
> INSERT INTO one_day mortality bool=true
Using retention policy one_day
> SELECT * FROM "mydb"."one_day"."mortality"
name: mortality
---------------
time                             bool
2016-09-13T22:29:43.229530864Z   true
```

Note that you will need to fully qualify the measurement to query data in the non-`DEFAULT` retention policy. Fully qualify the measurement with the syntax:

```
"<database>"."<retention_policy>"."<measurement>"
```

## How do I cancel a long-running query?
You can cancel a long-running interactive query from the CLI by hitting `ctrl+c`. If the query is running in the background,
please see the [`KILL QUERY`](/influxdb/v1.4/troubleshooting/query_management/#stop-currently-running-queries-with-kill-query) command in the documentation.

## Why can't I query boolean field values?
Acceptable boolean syntax differs for data writes and data queries.

| Boolean syntax |  Writes | Queries  |
-----------------------|-----------|--------------|
|  `t`,`f` |	👍 | ❌ |
|  `T`,`F` |  👍 |  ❌ |
|  `true`,`false` | 👍  | 👍  |
|  `True`,`False` |  👍 |  👍 |
|  `TRUE`,`FALSE` |  👍 |  👍 |

For example, `SELECT * FROM "hamlet" WHERE "bool"=True` returns all points with `bool` set to `TRUE`, but `SELECT * FROM "hamlet" WHERE "bool"=T` returns nothing.

<dt> [GitHub Issue #3939](https://github.com/influxdb/influxdb/issues/3939) </dt>

## How does InfluxDB handle field type discrepancies across shards?

Field values can be floats, integers, strings, or booleans.
Field value types cannot differ within a
[shard](/influxdb/v1.4/concepts/glossary/#shard), but they can [differ](/influxdb/v1.4/write_protocols/line_protocol_reference/#example-7-attempt-to-write-a-string-to-a-field-that-previously-accepted-floats) across shards.<commit_msg>Update frequently-asked-questions.md<commit_after>---
title: Frequently Asked Questions
aliases:
  - /influxdb/v1.4/troubleshooting/frequently_encountered_issues/

menu:
  influxdb_1_4:
    weight: 0
    parent: troubleshooting
---

This page addresses frequent sources of confusion and places where InfluxDB behaves in an unexpected way relative to other database systems.
Where applicable, it links to outstanding issues on GitHub.

**Administration**  

* [How do I include a single quote in a password?](#how-do-i-include-a-single-quote-in-a-password)  
* [How can I identify my version of InfluxDB?](#how-can-i-identify-my-version-of-influxdb)  
* [Where can I find InfluxDB logs?](#where-can-i-find-influxdb-logs)
* [What is the relationship between shard group durations and retention policies?](#what-is-the-relationship-between-shard-group-durations-and-retention-policies)
* [Why aren't data dropped after I've altered a retention policy?](#why-aren-t-data-dropped-after-i-ve-altered-a-retention-policy)
* [Why does InfluxDB fail to parse microsecond units in the configuration file?](#why-does-influxdb-fail-to-parse-microsecond-units-in-the-configuration-file)

**Command Line Interface (CLI)**

* [How do I make InfluxDB’s CLI return human readable timestamps?](#how-do-i-make-influxdb-s-cli-return-human-readable-timestamps)  
* [How can a non-admin user `USE` a database in InfluxDB's CLI?](#how-can-a-non-admin-user-use-a-database-in-influxdb-s-cli)  
* [How do I write to a non-`DEFAULT` retention policy with InfluxDB's CLI?](#how-do-i-write-to-a-non-default-retention-policy-with-influxdb-s-cli)
* [How do I cancel a long-running query?](#how-do-i-cancel-a-long-running-query)

**Data Types**

* [Why can't I query boolean field values?](#why-can-t-i-query-boolean-field-values)  
* [How does InfluxDB handle field type discrepancies across shards?](#how-does-influxdb-handle-field-type-discrepancies-across-shards)  
* [What are the minimum and maximum integers that InfluxDB can store?](#what-are-the-minimum-and-maximum-integers-that-influxdb-can-store)  
* [What are the minimum and maximum timestamps that InfluxDB can store?](#what-are-the-minimum-and-maximum-timestamps-that-influxdb-can-store)
* [How can I tell what type of data are stored in a field?](#how-can-i-tell-what-type-of-data-are-stored-in-a-field)
* [Can I change a field's data type?](#can-i-change-a-field-s-data-type)

**InfluxQL Functions**

* [How do I perform mathematical operations within a function?](#how-do-i-perform-mathematical-operations-within-a-function)  
* [Why does my query return epoch 0 as the timestamp?](#why-does-my-query-return-epoch-0-as-the-timestamp)   
* [Which InfluxQL functions support nesting?](#which-influxql-functions-support-nesting)

**Querying Data**  

* [What determines the time intervals returned by `GROUP BY time()` queries?](#what-determines-the-time-intervals-returned-by-group-by-time-queries)  
* [Why do my queries return no data or partial data?](#why-do-my-queries-return-no-data-or-partial-data)
* [Why don't my `GROUP BY time()` queries return timestamps that occur after `now()`?](#why-don-t-my-group-by-time-queries-return-timestamps-that-occur-after-now)  
* [Can I perform mathematical operations against timestamps?](#can-i-perform-mathematical-operations-against-timestamps)  
* [Can I identify write precision from returned timestamps?](#can-i-identify-write-precision-from-returned-timestamps)  
* [When should I single quote and when should I double quote in queries?](#when-should-i-single-quote-and-when-should-i-double-quote-in-queries)  
* [Why am I missing data after creating a new `DEFAULT` retention policy?](#why-am-i-missing-data-after-creating-a-new-default-retention-policy)
* [Why is my query with a `WHERE OR` time clause returning empty results?](#why-is-my-query-with-a-where-or-time-clause-returning-empty-results)
* [Why does `fill(previous)` return empty results?](#why-does-fill-previous-return-empty-results)
* [Why are my `INTO` queries missing data?](#why-are-my-into-queries-missing-data)
* [How do I query data with an identical tag key and field key?](#how-do-i-query-data-with-an-identical-tag-key-and-field-key)
* [How do I query data across measurements?](#how-do-i-query-data-across-measurements)
* [Does the order of the timestamps matter?](#does-the-order-of-the-timestamps-matter)
* [How do I `SELECT` data with a tag that has no value?](#how-do-i-select-data-with-a-tag-that-has-no-value)

**Series and Series Cardinality**

* [How can I query for series cardinality?](#how-can-i-query-for-series-cardinality)  
* [Why does series cardinality matter?](#why-does-series-cardinality-matter)  
* [How can I remove series from the index?](#how-can-i-remove-series-from-the-index)

**Writing Data**  

* [How do I write integer field values?](#how-do-i-write-integer-field-values)   
* [How does InfluxDB handle duplicate points?](#how-does-influxdb-handle-duplicate-points)  
* [What newline character does the HTTP API require?](#what-newline-character-does-the-http-api-require)
* [What words and characters should I avoid when writing data to InfluxDB?](#what-words-and-characters-should-i-avoid-when-writing-data-to-influxdb)  
* [When should I single quote and when should I double quote when writing data?](#when-should-i-single-quote-and-when-should-i-double-quote-when-writing-data)  
* [Does the precision of the timestamp matter?](#does-the-precision-of-the-timestamp-matter)
* [What are the configuration recommendations and schema guidelines for writing sparse, historical data?](#what-are-the-configuration-recommendations-and-schema-guidelines-for-writing-sparse-historical-data)

## How do I include a single quote in a password?
Escape the single quote with a backslash (`\`) both when creating the password
and when sending authentication requests.

## How can I identify my version of InfluxDB?
There a number of ways to identify the version of InfluxDB that you're using:

#### Run `influxd version` in your terminal:
```
$ influxd version

InfluxDB ✨ v1.4.0 ✨ (git: master b7bb7e8359642b6e071735b50ae41f5eb343fd42)
```

#### `curl` the `/ping` endpoint:

```
$ curl -i 'http://localhost:8086/ping'

HTTP/1.1 204 No Content
Content-Type: application/json
Request-Id: 1e08aeb6-fec0-11e6-8486-000000000000
✨ X-Influxdb-Version: 1.4.x ✨
Date: Wed, 01 Mar 2017 20:46:17 GMT
```

#### Launch InfluxDB's [Command Line Interface](/influxdb/v1.4/tools/shell/):

```
$ influx

Connected to http://localhost:8086✨ version 1.4.x ✨  
InfluxDB shell version: 1.4.x
```

#### Check the HTTP response in your logs:  

```
$ journald-ctl -u influxdb.service

Mar 01 20:49:45 rk-api influxd[29560]: [httpd] 127.0.0.1 - - [01/Mar/2017:20:49:45 +0000] "POST /query?db=&epoch=ns&q=SHOW+DATABASES HTTP/1.1" 200 151 "-" ✨ "InfluxDBShell/1.4.x" ✨ 9a4371a1-fec0-11e6-84b6-000000000000 1709
```

## Where can I find InfluxDB logs?

On System V operating systems logs are stored under `/var/log/influxdb/`.

On systemd operating systems you can access the logs using `journalctl`.
Use `journalctl -u influxdb` to view the logs in the journal or `journalctl -u influxdb > influxd.log` to print the logs to a text file. With systemd, log retention depends on your system's journald settings.

## What is the relationship between shard group durations and retention policies?

InfluxDB stores data in shard groups.
A single shard group covers a specific time interval; InfluxDB determines that time interval by looking at the `DURATION` of the relevant retention policy (RP).
The table below outlines the default relationship between the `DURATION` of an RP and the time interval of a shard group:

| RP duration  | Shard group interval  |
|---|---|
| < 2 days  | 1 hour  |
| >= 2 days and <= 6 months  | 1 day  |
| > 6 months  | 7 days  |


Users can also configure the shard group duration with the
[`CREATE RETENTION POLICY`](/influxdb/v1.4/query_language/database_management/#create-retention-policies-with-create-retention-policy)
and
[`ALTER RETENTION POLICY`](/influxdb/v1.4/query_language/database_management/#modify-retention-policies-with-alter-retention-policy)
statements.
Check your retention policy's shard group duration with the
[`SHOW RETENTION POLICY`](/influxdb/v1.4/query_language/schema_exploration/#explore-retention-policies-with-show-retention-policies)
statement.

## Why aren't data dropped after I've altered a retention policy?

Several factors explain why data may not be immediately dropped after a
retention policy (RP) change.

The first and most likely cause is that, by default, InfluxDB checks to enforce
an RP every 30 minutes.
You may need to wait for the next RP check for InfluxDB to drop data that are
outside the RP's new `DURATION` setting.
The 30 minute interval is
[configurable](/influxdb/v1.4/administration/config/#check-interval-30m0s).

Second, altering both the `DURATION` and `SHARD DURATION` of an RP can result in
unexpected data retention.
InfluxDB stores data in shard groups which cover a specific RP and time
interval.
When InfluxDB enforces an RP it drops entire shard groups, not individual data
points.
InfluxDB cannot divide shard groups.

If the RP's new `DURATION` is less than the old `SHARD DURATION` and InfluxDB is
currently writing data to one of the old, longer shard groups, the system is
forced to keep all of the data in that shard group.
This occurs even if some of the data in that shard group are outside of the new
`DURATION`.
InfluxDB will drop that shard group once all of its data are outside the new
`DURATION`.
The system will then begin writing data to shard groups that have the new,
shorter `SHARD DURATION` preventing any further unexpected data retention.

## Why does InfluxDB fail to parse microsecond units in the configuration file?
The syntax for specifying microsecond duration units differs for [configuration](/influxdb/v1.4/administration/config/) settings, writes, queries, and setting the precision in InfluxDB's [Command Line Interface](/influxdb/v1.4/tools/shell/) (CLI).
The table below shows the supported syntax for each category:

| |  Configuration File | HTTP API Writes | All Queries  | CLI Precision Command |
|---|---|---|---|---|
| u  | ❌ | 👍  |  👍 |  👍  |
| us |  👍  | ❌ | ❌ |  ❌ |
|  µ  | ❌ | ❌ |  👍  | ❌ |  
|  µs  | 👍  | ❌ | ❌ |  ❌ |  


If a configuration option specifies the `u` or `µ` syntax, InfluxDB fails to start and reports the following error in the logs:
```
run: parse config: time: unknown unit [µ|u] in duration [<integer>µ|<integer>u]
```

## How do I make InfluxDB’s CLI return human readable timestamps?

When you first connect to the CLI, specify the [rfc3339](https://www.ietf.org/rfc/rfc3339.txt) precision:

```
$ influx -precision rfc3339
```

Alternatively, specify the precision once you’ve already connected to the CLI:

```
$ influx
Connected to http://localhost:8086 version 0.xx.x
InfluxDB shell 0.xx.x
> precision rfc3339
>
```

Check out [CLI/Shell](/influxdb/v1.4/tools/shell/) for more useful CLI options.

## How can a non-admin user `USE` a database in InfluxDB's CLI?

In versions prior to v1.3, [non-admin users](/influxdb/v1.4/query_language/authentication_and_authorization/#user-types-and-privileges) could not execute a `USE <database_name>` query in the CLI even if they had `READ` and/or `WRITE` permissions on that database.

Starting with version 1.3, non-admin users can execute the `USE <database_name>` query for databases on which they have `READ` and/or `WRITE` permissions.
If a non-admin user attempts to `USE` a database on which the user doesn't have `READ` and/or `WRITE` permissions, the system returns an error:
```
ERR: Database <database_name> doesn't exist. Run SHOW DATABASES for a list of existing databases.
```
> **Note** that the [`SHOW DATABASES` query](/influxdb/v1.4/query_language/schema_exploration/#show-databases) returns only those databases on which the non-admin user has `READ` and/or `WRITE` permissions.

## How do I write to a non-DEFAULT retention policy with InfluxDB's CLI?

Use the syntax `INSERT INTO [<database>.]<retention_policy> <line_protocol>` to write data to a non-`DEFAULT` retention policy using the CLI.
(Specifying the database and retention policy this way is only allowed with the CLI.
Writes over HTTP must specify the database and optionally the retention policy with the `db` and `rp` query parameters.)

For example:

```
> INSERT INTO one_day mortality bool=true
Using retention policy one_day
> SELECT * FROM "mydb"."one_day"."mortality"
name: mortality
---------------
time                             bool
2016-09-13T22:29:43.229530864Z   true
```

Note that you will need to fully qualify the measurement to query data in the non-`DEFAULT` retention policy. Fully qualify the measurement with the syntax:

```
"<database>"."<retention_policy>"."<measurement>"
```

## How do I cancel a long-running query?
You can cancel a long-running interactive query from the CLI using `Ctrl+C`. To stop other long-running query that you see when using the [`SHOW QUERIES`](https://docs.influxdata.com/influxdb/v1.3/query_language/spec/#show-queries) command,
you can use the [`KILL QUERY`](/influxdb/v1.4/troubleshooting/query_management/#stop-currently-running-queries-with-kill-query) command to stop it.

## Why can't I query boolean field values?
Acceptable boolean syntax differs for data writes and data queries.

| Boolean syntax |  Writes | Queries  |
-----------------------|-----------|--------------|
|  `t`,`f` |	👍 | ❌ |
|  `T`,`F` |  👍 |  ❌ |
|  `true`,`false` | 👍  | 👍  |
|  `True`,`False` |  👍 |  👍 |
|  `TRUE`,`FALSE` |  👍 |  👍 |

For example, `SELECT * FROM "hamlet" WHERE "bool"=True` returns all points with `bool` set to `TRUE`, but `SELECT * FROM "hamlet" WHERE "bool"=T` returns nothing.

<dt> [GitHub Issue #3939](https://github.com/influxdb/influxdb/issues/3939) </dt>

## How does InfluxDB handle field type discrepancies across shards?

Field values can be floats, integers, strings, or booleans.
Field value types cannot differ within a
[shard](/influxdb/v1.4/concepts/glossary/#shard), but they can [differ](/influxdb/v1.4/write_protocols/line_protocol_reference/#example-7-attempt-to-write-a-string-to-a-field-that-previously-accepted-floats) across shards.
{'fraction_non_alphanumeric': 0.12262357414448669, 'fraction_numerical': 0.018588931136459652, 'mean_word_length': 4.364494806421152, 'pattern_counts': {'":': 0, '<': 33, '<?xml version=': 0, '>': 45, 'https://': 5, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 2, 'substrings_counts': 4, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3523127', 'n_tokens_mistral': 9795, 'n_tokens_neox': 9049, 'n_words': 3046}