{"action":"created","issue":{"url":"https://api.github.com/repos/cockroachdb/cockroach/issues/5575","repository_url":"https://api.github.com/repos/cockroachdb/cockroach","labels_url":"https://api.github.com/repos/cockroachdb/cockroach/issues/5575/labels{/name}","comments_url":"https://api.github.com/repos/cockroachdb/cockroach/issues/5575/comments","events_url":"https://api.github.com/repos/cockroachdb/cockroach/issues/5575/events","html_url":"https://github.com/cockroachdb/cockroach/issues/5575","id":143510239,"number":5575,"title":"A few questions: Strange SQL syntax, and inserting without giving primary keys","user":{"login":"tchoulihan","id":930215,"avatar_url":"https://avatars.githubusercontent.com/u/930215?v=3","gravatar_id":"","url":"https://api.github.com/users/tchoulihan","html_url":"https://github.com/tchoulihan","followers_url":"https://api.github.com/users/tchoulihan/followers","following_url":"https://api.github.com/users/tchoulihan/following{/other_user}","gists_url":"https://api.github.com/users/tchoulihan/gists{/gist_id}","starred_url":"https://api.github.com/users/tchoulihan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tchoulihan/subscriptions","organizations_url":"https://api.github.com/users/tchoulihan/orgs","repos_url":"https://api.github.com/users/tchoulihan/repos","events_url":"https://api.github.com/users/tchoulihan/events{/privacy}","received_events_url":"https://api.github.com/users/tchoulihan/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/cockroachdb/cockroach/labels/question","name":"question","color":"cc317c"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2016-03-25T14:23:04Z","updated_at":"2016-03-26T14:31:08Z","closed_at":"2016-03-25T15:32:45Z","body":"I tried inserting a row (from the example) without giving the primary key(as is typical in SQL), as follows:\r\n\r\n```\r\nroot@:26257> CREATE TABLE accounts (id INT PRIMARY KEY, balance DECIMAL);\r\nCREATE TABLE\r\n\r\nroot@26257> INSERT INTO accounts (balance) VALUES (DECIMAL '10000.50');\r\n....fails\r\n```\r\n\r\nAlso, what's with the strange syntax for table creation and datatype inserts? If cockroach uses postgressql for a translation layer, then why isn't the syntax the same as postgres? Will my postgres sql connector even work, considering the syntax looks different?\r\n"},"comment":{"url":"https://api.github.com/repos/cockroachdb/cockroach/issues/comments/201834062","html_url":"https://github.com/cockroachdb/cockroach/issues/5575#issuecomment-201834062","issue_url":"https://api.github.com/repos/cockroachdb/cockroach/issues/5575","id":201834062,"user":{"login":"tchoulihan","id":930215,"avatar_url":"https://avatars.githubusercontent.com/u/930215?v=3","gravatar_id":"","url":"https://api.github.com/users/tchoulihan","html_url":"https://github.com/tchoulihan","followers_url":"https://api.github.com/users/tchoulihan/followers","following_url":"https://api.github.com/users/tchoulihan/following{/other_user}","gists_url":"https://api.github.com/users/tchoulihan/gists{/gist_id}","starred_url":"https://api.github.com/users/tchoulihan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tchoulihan/subscriptions","organizations_url":"https://api.github.com/users/tchoulihan/orgs","repos_url":"https://api.github.com/users/tchoulihan/repos","events_url":"https://api.github.com/users/tchoulihan/events{/privacy}","received_events_url":"https://api.github.com/users/tchoulihan/received_events","type":"User","site_admin":false},"created_at":"2016-03-26T14:31:08Z","updated_at":"2016-03-26T14:31:08Z","body":"Usually the primary key is given after, both in mysql and postresql like this:\r\n```sql\r\nCREATE TABLE table_name(\r\n   column1 datatype,\r\n   column2 datatype,\r\n   column3 datatype,\r\n   .....\r\n   columnN datatype,\r\n   PRIMARY KEY( one or more columns )\r\n);\r\n```\r\nWhereas in cockroachdb, it uses this: `id INT PRIMARY KEY`\r\n\r\nAlso, the `INSERT` statement looks like it requires a datatype, whereas this isn't necessary in either mysql or postresql. \r\n"}}