{"action":"closed","issue":{"url":"https://api.github.com/repos/linq2db/examples/issues/10","repository_url":"https://api.github.com/repos/linq2db/examples","labels_url":"https://api.github.com/repos/linq2db/examples/issues/10/labels{/name}","comments_url":"https://api.github.com/repos/linq2db/examples/issues/10/comments","events_url":"https://api.github.com/repos/linq2db/examples/issues/10/events","html_url":"https://github.com/linq2db/examples/issues/10","id":191267645,"number":10,"title":"Linq2DB.InsertWithIdentity with PostgreSQL custom sequence","user":{"login":"JFGauvin","id":23700702,"avatar_url":"https://avatars.githubusercontent.com/u/23700702?v=3","gravatar_id":"","url":"https://api.github.com/users/JFGauvin","html_url":"https://github.com/JFGauvin","followers_url":"https://api.github.com/users/JFGauvin/followers","following_url":"https://api.github.com/users/JFGauvin/following{/other_user}","gists_url":"https://api.github.com/users/JFGauvin/gists{/gist_id}","starred_url":"https://api.github.com/users/JFGauvin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JFGauvin/subscriptions","organizations_url":"https://api.github.com/users/JFGauvin/orgs","repos_url":"https://api.github.com/users/JFGauvin/repos","events_url":"https://api.github.com/users/JFGauvin/events{/privacy}","received_events_url":"https://api.github.com/users/JFGauvin/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-11-23T13:15:58Z","updated_at":"2016-11-23T13:53:14Z","closed_at":"2016-11-23T13:53:14Z","body":"Using PostgreSQL, I have a Sequence that creates unique Ids throughout the whole database. Every table has an \"id\" field which defaults the next value of this sequence.\r\n\r\n```\r\nCREATE SEQUENCE generic_id_seq\r\n    START WITH 1\r\n    INCREMENT BY 1\r\n    NO MINVALUE\r\n    NO MAXVALUE\r\n    CACHE 1;\r\n\r\n```\r\nTrying to use Linq2DB's method InsertWithIdentity on a table that uses this sequence I get error: {\"42P01: relation \\\"public.ctest_id_seq\\\" does not exist\"}. Here is the table definition:\r\n\r\n```\r\nCREATE TABLE public.ctest\r\n(\r\n    id bigint NOT NULL DEFAULT nextval('generic_id_seq'::regclass) , \r\n    name citext,\r\n    CONSTRAINT ctest_pk PRIMARY KEY (id)\r\n)\r\n```\r\n\r\nThe InsertWithIdentity method works well when using a standard id field, typed Serial or BigSerial, like in the definition below:\r\n\r\n```\r\nCREATE TABLE public.btest\r\n(\r\n    id bigserial NOT NULL,\r\n    name citext,\r\n    CONSTRAINT btest_pk PRIMARY KEY (id)\r\n)\r\n```\r\n\r\nIs there a way to use the InsertWithIdentity with a Sequence number generator?"}}
{"actor":{"display_login":"JFGauvin"}}