Hi,
I got stucked with an example. Let me share it.
Assume that I've a table like this:
CREATE TABLE countries ( country text, total_pop int STATIC, state text, state_pop int, PRIMARY KEY (country, state) );
Then I add a row like this then select it:
INSERT INTO countries (country, total_pop) VALUES ('USA', 111); country | state | total_pop | state_pop ---------+-------+-----------+----------- USA | null | 111 | null
First time, I didn't understand this because I dont think clustering key column can be null. But then thought that, that may be OK.
So, I add another row like this then select it:
INSERT INTO countries (country, state ) VALUES ('USA', 'Oregon'); country | state | total_pop | state_pop ---------+--------+-----------+----------- USA | Oregon | 111 | null
This is the where I got stucked with it.
country and state provides uniqueness.
But why second query updates the first record in the table? Those are different records.
I was waiting for a result like this:
country | state | total_pop | state_pop ---------+--------+-----------+----------- USA | null | 111 | null USA | Oregon | 111 | null
Can you explain it to me?
Thanks