Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Table cartodbfy'ed without default seq value #138

Closed
rafatower opened this issue Sep 7, 2015 · 1 comment
Closed

Table cartodbfy'ed without default seq value #138

rafatower opened this issue Sep 7, 2015 · 1 comment

Comments

@rafatower
Copy link
Contributor

Steps to reproduce:

  • Create an empty table:
CREATE TABLE bug_empty_table_no_seq (
    cartodb_id integer,
    the_geom geometry(Geometry,4326),
    the_geom_webmercator geometry(Geometry,3857),
    name text,
    description text
);
  • Cartodbfy the table:
SELECT CDB_CartodbfyTable('bug_empty_table_no_seq');
  • Try to insert an empty row:
INSERT INTO bug_empty_table_no_seq DEFAULT VALUES;
  • Expected: the row is inserted without problem
  • Actual:
ERROR:  null value in column "cartodb_id" violates not-null constraint
DETAIL:  Failing row contains (null, null, null, null, null).

The problem is that the table is created without the default sequence value. That breaks the editor and possibly other scenarios.

See CartoDB/cartodb#5392

@rafatower
Copy link
Contributor Author

_CDB_Has_Usable_Primary_ID does not take into account if there's a valid sequence there. I think I got a fix for that particular case, but more profound changes might be required.

rafatower pushed a commit that referenced this issue Sep 8, 2015
rafatower pushed a commit that referenced this issue Sep 8, 2015
rafatower pushed a commit that referenced this issue Sep 8, 2015
rafatower pushed a commit that referenced this issue Sep 8, 2015
rafatower pushed a commit that referenced this issue Sep 9, 2015
rafatower pushed a commit that referenced this issue Sep 9, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant