citusdata / citusdata/citus

Use consistent quoting for #define'd SQL commands

Open
#293 0 comments 0 reactions 0 assignees View on GitHub
technical debt
Dominant language
C
Stars
12.8k
Forks
794
Avg merge
2d 14h
Merged PRs (30d)
31

Description

We don't have a consistent quoting policy for #define'd SQL commands in CItusDB. For example, we have the following declarations in include/distributed/worker_protocol.h:

```
#define TRANSMIT_REGULAR_COMMAND "COPY \"%s\" TO STDOUT WITH (format 'transmit')"
#define COPY_OUT_COMMAND "COPY %s TO STDOUT"
#define COPY_IN_COMMAND "COPY %s FROM '%s'"
```

Andres notes that we should use double quoting everywhere (is this all table names or does it also include filenames?) - right now it'd e.g. would be impossible to use the other commands on a table that starts with numbers or have spaces. To be really correct we should do proper quoting.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.