etlmcp writes the table and schema names you type into the PostgreSQL destination as quoted identifiers, so PostgreSQL keeps them exactly as typed, capitals and spaces included. If you name the table Ads_Daily, your own queries and BI custom SQL must write "Ads_Daily" with the double quotes, or PostgreSQL reports that the relation does not exist. The schema defaults to public, and etlmcp never creates a schema: if you choose another one, create it first.
Why capitals and spaces cause trouble
PostgreSQL folds every unquoted name to lower case, and treats a name inside double quotes as case-sensitive. So ads_daily, ADS_DAILY and "ads_daily" all point at the same table, while "Ads_Daily" is a different name. A quoted name may also hold spaces and other characters that an unquoted name cannot.
etlmcp quotes both names in every statement it runs, so the table it creates is exactly what you typed:
| You type in the form | Table PostgreSQL stores | How to query it |
|---|---|---|
ads_daily |
ads_daily |
select * from ads_daily |
Ads_Daily |
Ads_Daily |
select * from "Ads_Daily" |
ads daily |
ads daily |
select * from "ads daily" |
Writing select * from Ads_Daily without quotes asks for ads_daily, which does not exist. The simplest rule is to use lowercase letters, digits and underscores for both names, so nobody ever needs quotes. The same applies to a schema name such as Marketing.
Length
PostgreSQL keeps no more than 63 bytes of a name in a standard build and truncates longer names. etlmcp checks both names when you save the destination: it refuses an empty or blank name, and one with more characters than that PostgreSQL limit. Because PostgreSQL counts bytes, a name with accented or other multibyte characters reaches the limit sooner, which is one more reason to keep names plain.
The schema must already exist
The Schema field defaults to public, and a destination saved without a schema uses public. If the table is not there, etlmcp creates it inside the schema on the first load (and inside the rolled-back transaction of the Test button). It never runs CREATE SCHEMA. Pointing the destination at a schema that does not exist makes both Test and every run fail with a message that starts with database error: followed by PostgreSQL's own text. Create the schema yourself first:
CREATE SCHEMA marketing;
Privileges on a schema other than public
By default a user cannot reach objects in a schema it does not own. The loading user needs USAGE on the schema to see it and CREATE to make the table in it, so the schema owner grants both. Anyone who only reads the table, such as a BI login, needs USAGE on the schema as well as SELECT on the table.
GRANT USAGE, CREATE ON SCHEMA marketing TO etl_loader;
GRANT USAGE ON SCHEMA marketing TO bi_reader;
On PostgreSQL 15 and later, a fresh database no longer lets every user create objects in public, so a new login may need CREATE there too. Databases upgraded from version 14 or earlier keep the older, open grant.
Finding the table: search_path
When a query names a table without a schema, PostgreSQL looks through the schemas in search_path in order and takes the first match. The default path is "$user", public: a schema named after the current user, if one exists, then public. A table in marketing is invisible to select * from ads_daily even though it exists. Either name the schema, as in marketing.ads_daily, or add it to the path with SET search_path TO marketing, public; for the session. If the schema name has capitals, quote both parts: "Marketing"."Ads_Daily".
For the full form and what each field means, see the PostgreSQL destination; for other messages, see PostgreSQL destination errors.