Cockroach-v2.0-alpha.20180129 insert fails: type string doesn't match type BYTES

CREATE TABLE images (
  imageid                  bigint                                    NOT NULL,
  imagetype                integer         DEFAULT '0'               NOT NULL,
  name                     varchar(64)     DEFAULT '0'               NOT NULL,
  image                    bytea           DEFAULT ''                NOT NULL,
  PRIMARY KEY (imageid)
);
CREATE UNIQUE INDEX images_1 ON images (name);

INSERT INTO images (imageid,imagetype,name,image) VALUES (1,1,'Cloud_(128)',decode('89504E470D0A1A0A0000000D494844520000008000000044080600000049473D690000000473424954080808087C086488000000097048597300000DD700000DD70142289B780000001974455874536F667477617265007777772E696E6B73636170652E6F72679BEE3C1A0000130B4944415478DAED9D095C9357B6C0BFD6E7585FFB7C9DE9D8BE71AC4F2B90208EB6DAE9E8D4D73AAF4A36709916B58B1DEDB46EAD9DF6F5D7AAD5B6501F8E2BB8B405C55D2B5664114101954DF645F61D091076C2BEAF77EE395F022124102109A0DFFDFDAEC48404B8E77FCF39F79C73EF650821CC58E8B43DA6D21F67185B2DBDCFF7611F2B7FE3888CEBD8103A08D6661CB378F1BF31F3E78F672C6C7EC598882630D3173FC14CB599881D1EC373F0DAFC0DE3F17BA1C3FB54C0E0843E0600E89DE55478207010EC7CEB7FA75F27317F90FC9A31B3FE2D337BD9738CB9E0778C99D5EF19DEB229F8189E83D72C04BF615E58F29FF4F9FF50BC6F027E0E07C3E806A047F03654503093A750E181204D4493999996CF33330526CC2C8105334BF412632AFE13C313BDCA9849FE073B5FF2670AC32BF81A5FFC070A029F3EFF027DEF54FADE6799E92B9E66E6583E8930A066E040183500F4AA7A85E04150308B6176F3C5668C89601EC317BD4E856EC5988956D3E7D63D39EFCD8FADB7DA1FFCCEE9EAB583176F06EE7272F3DCF8FF275DD66C3B7CC0E68B43767F59FFEDA7E3CC25627C1F5F321F8198B9FC79D410A049C064F4688547178451227C3A1B411860CB51C553C19B4ACC7156F351E8EF0B377C47E51C99169490D3189626ED0A4DCD27C1C9527227F13EB995904BFCE2B3896F6C16B91E9D49BC22D3897B781AF92534A5E3B45F74E9B72E5EBE6BB61FFDE6D905EF09E867CF45CD00E602B4CBD485135535020780D185AF98F560AF412830E3F9560B199E78F9A497DFFA78CF698F80B094BCC6F8DC62129B5D44A232652432A3107B443AFD9A098F652482FE3F2CBD8020182952729B82E11B9345AE52102E0527910B8189E4947F6CEB76270FEF397FFDBF77E8E7BF8C2665C61BCFE1CF06D3A0D0061C00C6123ECC3C50C5D3E8ACB7B09E4685F012158C90E149FEEE78D12738495ADA99925F4612F34A49C2FD129290574212EFB38FEFE5961080222E87ED00470CEDD15932124D2151820260DC4D9592807BB9E46A582A391D104F5C6EC6757F7FEE46F4920DDF6FA666E545FCD9A0794003A136601E196D30B2C28701E7AF7C066722A87B9E78D527F6C7CFA4E497B665165592F4C20A929A5F4E520BCA494A3EF432922C2D23491408806228300427E7118FF05472C22F8EFCE41B4DB63B7B063CB3E0ED37585F833A9BE07FA06FF06898849113FE145C9E4D46E78C27FA5F2AFCF55EC1B16979A5D524A7A48A6451003265952443C682003DAD407F3084A51510B7BBA9E487EB5164FF95900AC1E63D9F30E692D9B89C04930066E9118060046CBE42F8B0343311CDA25EBAE5E4056B3E8DCBCA971754D4120020970200106417CB2908F2416100105461481808862C168628050C601A9C7CA3BB1D3DC3BBB61EFEC575FCEC652FE3D211560A08817673A029EA38D6A290C677F840ED2B854FEDBDE587BB76E79654B616C9EB487E790D9196D590BCB26A72BF147A955160006D004EA2836738D971C23B64BC85F51F11020C24F59A83FEA168701A15114A4DBD37F0346A630EC6153E387CB00E37B3E4337C6B4BC107DFED2EAEAAEB2CAD6A20B2CA5A524835006801008185A1BA07865C250C1484FE302840E80343994E30C466F7C2E0169682107CE5E4758B31B79EC7F0964E612C163F85A165F55034C611A82683D7D955C4245C56B281AB49F81CF813F07DF0FDA334F8642C001EC7417871C5D3E8F0519BFFFBD7FEF699ACB2A6ADA2B69194543790E2AA7A025A40565937A2305C096521F8ECD8554FC64C30177D02102806A76C9EC28822869BC5FF85D149BE703A7D7D263A913C218F851B1DCA99B8BA80F7F3DF780681500B3E3D120020F1F047A363450784277A759CB9D50719D25279557D3329AF692465350DA4944250525D4F4A2808230DC3E590648460CBC19FCF60E088673D0385CDB39C814EAB055D3AF2850B19BED562F061A8F32881B805632AF9EBC4D96FDAFC6AF6F215F47D62746ECD450BD8D0B44AF069FABA27464BF0C938AA1F55259D31E682798C99704D6074725A4D630BA9AA6B2695754D04B44039744D30C8B5C3205587A1A43F0C99DA60505D49F481818240FBF93B09DD0E1E619D7F5AFBF53F189EE42F7446BFCE988B97D2DF7FE5132F2E5F27DA68B7FB8B03E72EEE3D7BCDFFB84750EC25FFA8EC6B61C9A5FE3119353E91A972F79084E28B01D139872F07DCF9D0EEF8BE05EF7DF96E4FF069CECA677B571A23AB0D0C0C00251C53B482DFB0A15DB1D5E1F35E1EF5CDADA4960250DDD04C400B4097531046130CB13945E4E8B5C86EDBF3FE258F9B2FFB7CC2DC159FAFFAE280B393DBADD8E07BD9B589F7CB1096B89C12F421942B8B88F402EA54C232339F84A648315CED1393D97A3928A1F2F0D5C0709B6D0EFF60834F4BA6A14904B360337210187EBD0F76D35CFCDFB4BF46BDEBCDB50DCD1D0DCD6DA4AE8942D0D48220D4A8C020AF6FD20043432F0C55C683C19F2E11C1141CBA7CBB2C3829BB2109A292D45C284D05085E7D69C986A6D9A05338C25080308450107C63B23ACF06C4CAEDCFDDB8B1E8FD9D2B59DF81FA07908F18214D60D8D9CF16694C66EDA878D5B5C098D8E6D676D2D8D2461AA05310401B0C07866235180AB5C150DA0B43CE60301454A0BF00305CB893488E5C8B2431D44954371308825AC049230CE9BD3004A7E4915F42929A7FF00E2B5CBDE3C856C6DCCA14A3A1305623008161673F2E87A8036526593279C1DBDB9A5ADBBA9ADBDA49735B0701109AC6000C206047AF08CC2E0EE4333C280C1EE1A9AD3F7A47547F607FDA16210033890929E33A86864BEF02D16CC0070A34DE8948C8C86AEFE824ADB4B7C1D7F60ED20220E800038050D330300C004259B53A0C751A60A8E91370CA530B38F5C250893040C009B289103256E625D47D86445518D03CE806C3F5A88C8E63DE110D1BF79EDF83130556081616187D1CE300D0D90F5E2EAC91CD846F3CFFFADFBE6E696DEBE8EAEA269D5D5DA4A3B38BB4D3DE36466000D50DBE00A499330AFB9B89E1C0E01591D6E2E819DE24DA7AE01DAC838078039B917C6CAC02C0067DC0AEC1FA97DAFE83A7DDFD88A2757713D245FF194B306417571127DF18723128B18F66D0170CA7FDA2EBFE7939B068AAE5FA5730C884FE80EDE3631400EAC840B2078B35B1666F4B96B4A8826868DD00423780A00186F68161A85785A151330C953AC050A40603F80B05E5FD61806A23F00552F22B502BF49809993A0C1A329652CD194B250C008183C7DDDAED2ED7BDD11480EF841143C36B01C3397F33979930A60289F0C35D47890E6DB4C39040850666001C38F524953E60084EBEDF79C823AC7DE1DA9D42B68895D5028686C030EA1F133E74E9479D3F77FFB038F2804D230C3D264215061684BE30B492FAA6BE300008C38501840D00F8DFCBD1EA330C1786A31E772BBE74F2BA8A5A007C28C6F0BE80FEAB7AE72BD43F96694BB6149656D6906134A3C2A0127DD404C331EF48E21E91A6D14C684A5F67EB90BE562D6C094EC9EB3CE87EB7C56CF9C78B14D5CB130CBD22D0DFAE1DB059A0B6A0B60ED6B56622D19445EFDA758304F5D4461A865301F1E4ECED7B83FA0CC381C1D13DB472E3FE0B7BB11E017C293AB6A30A800177ED40D40F967EB360D386E4BD75DB1DAE100335551800049D6150F1170683014050850152C5A005FA642CE5DA3296432B6C710D4EACDF71D2270827118CA981978443133CD879A8EC51EEDA015A71D60BE632A6E2D760E947EDFF8EA317BCEF11233463C17083AE04C00F8099CF6A867ABDC300758BFBDD426A581F8A2EA5156569230A409FFA7D98EDA0E6A15A86A5F425143A6CE0A04EDF0CC1C69D82CDBBCF7DB6FF6C4C607C6613FC71B03E868100C18C6518C2D2F31100107E7F33A11F180004FA33DA177D606B83C52430D154762FE9BBEE50B7598F25DC0B2762FA123662425104143A9809C5A0EA459BED8FFCE01E9CEDEC13D50603A4AD1FA5EA136AF3210002836750107480A1450D86C696816100411DA17F837AFABA425BFA7A88852D4E3E918DAB76FEB4AB273CACDCDCAADAB5EC7E7E5020068FE9C3AC87BA37589BC28C874D997C2BEBDFBDBE76EBFE4BFEC9CEBED1ED8E5EE1E4E7A024DCA205CB1AF8C3D9A40F3BA8E084C10002E1212952E21A928C193617BF38B47D06D70A7A84E1ECED84DE245543B3416038773BBE6DD5CE1F1D189E700E4E384819C3E61928475376B66AF929D4C8C3A83B1C5CE5C30FC2A81EFD65A0FC89275EFF9DB37BE0F19BB15DC7BCA34860521E0EC8833618708887D3CF417860E08CE22F2861500B38B5AB86A2078001006643D17DCD843E61002DF9CE37CE17218B8A5554B3AC2D181381A28B66298A6BCCB0CC0C4AD5A0DA0AB289103B0093A12C62D50104ED331FD40E66A7ACA75155FF4728855AF1C93F0F5F0A8C6F74BA1183B16C18ACE1369891A0053C23D3D10932661B0A0C25F2867E9AA11F0CC3AC72BA169549B6EC3B1F4E27DB262AE8B7D1A9860E3BA3F1B1E82DAC41A44B6DAC4B04AD0C9B5A0008800134042C2175D8E1A4D9E6C3CC07E163250FD87AC99A6D475C6F9EA0B31552A3B54398F1BA34185008F38E441BAE66D0270C3ED199C4F6A477E17B5F395CDF7BD233F897808854BFC8E4FC5BD1A98577E2D28B82E2338A3C83E2329CDD0242761DBBE4BAFC63FBEFD96DF342019E9100DA4159CD3C48C999F60ADED954B5A0BD17BFBDEFECF5D093FE71C42F3E0707E4616FDA3296EA3018AAB0C53534191DE507296C894ECFAF7176BB1528D96CB78B9A08096A6D7022C17F58D8B3E9F531AD00F409E5023D607BA8BAB175BE7AEB1C757C40E5EB2FA6C7C130100CA069C1611E6A95D3E580C858BE78D326340F78300675E041AE1A20E85FC10BC4282A783FB273BEF43355F9700803D78C0343694D3D39EC1581DA6038256FA9D2D2E66F7F703D858EBB05751C2160A71253E803404F150F2C2BC0E93315BFF682E586AFDC4253BAC123059BC735DD60186E610B04845C6EC6E9ADB0658F8BFB4576F526E4A9D61DAA03C0CE7EC84061158FC4E6AC6F84F4CADD54FC50AE190F86D89C625C11E9ABCA896A84EEDDC7DD4E43593E3AF5E0DFA998825EDBFF9CE593B8A6A4B3FFCF6B77D87B4566D0757A11275D7D642C752C6C01184253A5981AD667C91B85A073F1BAED9FE086149562935E0030950B615EAA26E8FAD2F54E5C091CB604BF28D78C0B03049A40F0FAAE72BA161C170905BA98AD552936E955FFE02450CFDF6A8BBDEDCDB86CAC58E59AF161C8A23E80214ADEA836E8126DB0DD8A0123F005D82CE363ACF70FDE212679848B76FDE8E60E317D884A71CD883028FC05082E19AAB0E594E79DAB18DBC168A1B2E610A244508B8E513FC9928BFE51E9B07DA9ED1108F88C7618F45DE5E41791188B3B9DC1D79BCF561BB100B0275CCC84F46E405C566D8AB48C93CC43084372AEAC983D86CF7A0666783144AC2CE336B7329DBE74DD6AD8B664E85C3DD71E0C067D15B694D734B463E10E9ED2A25C0EAA0060B565F72608F9C20771EDE183A1545ED7DC1F001513F0ECC2D52BE2738A3B4165706D1482304C18F28ACA2B31858C69631B850950730283EE65C92080C0B5B10F837AFA3A3557761F6301206B90399B26565906F244AFBA78DCF6CB2E96777343FCF0C1703D28C68F3D9277E914363184C5222A81A059A29736D9FD640F09097D54FB706D0461D090B1FC70D7919D180EC663EE7A02418A50305400F1C566E32C24CB127264551038E0DAC3034345756D155671BFD077C3496F32883DBC792A4403DFDF76681F64939AB95CC043D35CAEF89DA1F25D80A65E65CB59DF5DBD982F16584001686452762EC494BBBA397760ACB782E2F2C2711656D698EC834D3D2ABB8DFA9683B1972A4D0547C1D4F2A34F4BABEA3BAAE992B09B8360CCB6CECEAECE8FBE39B6136B04A1D46F8A3204ACA80720EA7BFBA72976F79A882CAD36DBED91D7357541108143604C0690BA0F9C7277C68BB37A4E1ED930BE5F4918D1749C3BA40DF962ABBF7FED78ACAEB1A51B82099C39185BEDA49BFFCFD4EB5F8AAA1F6A3D351C43A7F9842F0C0CE1A58C73293DD6EBB71F71AC6D686E6F6C6D33CA064FAE0DAFB5B4B6B5399CF53C81671B4381AF968250A26567107B851B648BF0A8733CE94BF8DCA277B7664A8B65AD7465C041307A5B5199BC64F966BB2FB1241C663E081FEDFE20FB0288A67BFC4013CC8493ADE907C1167033D1EAAF1DCEB994C96B6AB8A11E5DADB2BAAEDAC9F5C685A75E5CF526167D40BC1FCE1798AA7D5308197873A8725B38FD00581E42FC18A3489225B05B68CDE77BF7DD0C8D8B949555CAB9E11F99D6D6DED19E929D9F79F482F799897397AF42670F3692C2665EBC9760F093C8753B18029C07C81882738867FF52DF00CA8CA97FC0F044EFCE5BB9F5AB7D27DCCE5FF209F2F70D89890C8B4F4F49CE92DECFCA2B2ACCCC93D15E24E3FA50BBAC304B5A5498965B9017959499E277373EFCCA8D509FED87CE383EFDCAAAB5B80D0CCE63C45A3FEB6938EBD9DB4D74BA8B40F7B37F95973C0208104BC6EB52608B32C000B762286ECF60AF7A5D01B767B0BB5825365C1F4EB77A8B8EE99B38A6780A8B5040FB62F61C26E11CAA9D4DD853D9A8970F7E5BCFE5D8BA5D7EF9E08740B30524139032CC1FC039362AF7E7E025900086251F3D50D60B9DC5F52176183FBC5B1176F62C33C16B6B946702B04BBB49EC8D2C7D0F8820863825ACDFD170EC8510DA6FD0523DD182EB43EFCADBC8F09A99C51A4E0541553FA45345F5704EE00077E8A99F6BC3F5A175D531B5518CF330CE0552EDFF02DCA524A9371DC0180000000049454E44AE426082','hex'));
pq: value type string doesn’t match type BYTES of column "image"
Error: pq: value type string doesn’t match type BYTES of column “image”

this works like a charm in postgres.
What can I do to make this work?

Hi @ik_zelf,

The decode() function doesn’t seem to be supported by CockroachDB. However, you don’t need it :wink: . BYTES columns accept values as byte array literals in the format x'89504E47...'. Can you give that a try?

INSERT INTO images (imageid,imagetype,name,image) VALUES (1,1,'Cloud_(128)', x'89504E470D0A1A0A0000000D494844520000008000000044080600000049473D690000000473424954080808087C086488000000097048597300000DD700000DD70142289B780000001974455874536F667477617265007777772E696E6B73636170652E6F72679BEE3C1A0000130B4944415478DAED9D095C9357B6C0BFD6E7585FFB7C9DE9D8BE71AC4F2B90208EB6DAE9E8D4D73AAF4A36709916B58B1DEDB46EAD9DF6F5D7AAD5B6501F8E2BB8B405C55D2B5664114101954DF645F61D091076C2BEAF77EE395F022124102109A0DFFDFDAEC48404B8E77FCF39F79C73EF650821CC58E8B43DA6D21F67185B2DBDCFF7611F2B7FE3888CEBD8103A08D6661CB378F1BF31F3E78F672C6C7EC598882630D3173FC14CB599881D1EC373F0DAFC0DE3F17BA1C3FB54C0E0843E0600E89DE55478207010EC7CEB7FA75F27317F90FC9A31B3FE2D337BD9738CB9E0778C99D5EF19DEB229F8189E83D72C04BF615E58F29FF4F9FF50BC6F027E0E07C3E806A047F03654503093A750E181204D4493999996CF33330526CC2C8105334BF412632AFE13C313BDCA9849FE073B5FF2670AC32BF81A5FFC070A029F3EFF027DEF54FADE6799E92B9E66E6583E8930A066E040183500F4AA7A85E04150308B6176F3C5668C89601EC317BD4E856EC5988956D3E7D63D39EFCD8FADB7DA1FFCCEE9EAB583176F06EE7272F3DCF8FF275DD66C3B7CC0E68B43767F59FFEDA7E3CC25627C1F5F321F8198B9FC79D410A049C064F4688547178451227C3A1B411860CB51C553C19B4ACC7156F351E8EF0B377C47E51C99169490D3189626ED0A4DCD27C1C9527227F13EB995904BFCE2B3896F6C16B91E9D49BC22D3897B781AF92534A5E3B45F74E9B72E5EBE6BB61FFDE6D905EF09E867CF45CD00E602B4CBD485135535020780D185AF98F560AF412830E3F9560B199E78F9A497DFFA78CF698F80B094BCC6F8DC62129B5D44A232652432A3107B443AFD9A098F652482FE3F2CBD8020182952729B82E11B9345AE52102E0527910B8189E4947F6CEB76270FEF397FFDBF77E8E7BF8C2665C61BCFE1CF06D3A0D0061C00C6123ECC3C50C5D3E8ACB7B09E4685F012158C90E149FEEE78D12738495ADA99925F4612F34A49C2FD129290574212EFB38FEFE5961080222E87ED00470CEDD15932124D2151820260DC4D9592807BB9E46A582A391D104F5C6EC6757F7FEE46F4920DDF6FA666E545FCD9A0794003A136601E196D30B2C28701E7AF7C066722A87B9E78D527F6C7CFA4E497B665165592F4C20A929A5F4E520BCA494A3EF432922C2D23491408806228300427E7118FF05472C22F8EFCE41B4DB63B7B063CB3E0ED37585F833A9BE07FA06FF06898849113FE145C9E4D46E78C27FA5F2AFCF55EC1B16979A5D524A7A48A6451003265952443C682003DAD407F3084A51510B7BBA9E487EB5164FF95900AC1E63D9F30E692D9B89C04930066E9118060046CBE42F8B0343311CDA25EBAE5E4056B3E8DCBCA971754D4120020970200106417CB2908F2416100105461481808862C168628050C601A9C7CA3BB1D3DC3BBB61EFEC575FCEC652FE3D211560A08817673A029EA38D6A290C677F840ED2B854FEDBDE587BB76E79654B616C9EB487E790D9196D590BCB26A72BF147A955160006D004EA2836738D971C23B64BC85F51F11020C24F59A83FEA168701A15114A4DBD37F0346A630EC6153E387CB00E37B3E4337C6B4BC107DFED2EAEAAEB2CAD6A20B2CA5A524835006801008185A1BA07865C250C1484FE302840E80343994E30C466F7C2E0169682107CE5E4758B31B79EC7F0964E612C163F85A165F55034C611A82683D7D955C4245C56B281AB49F81CF813F07DF0FDA334F8642C001EC7417871C5D3E8F0519BFFFBD7FEF699ACB2A6ADA2B69194543790E2AA7A025A40565937A2305C096521F8ECD8554FC64C30177D02102806A76C9EC28822869BC5FF85D149BE703A7D7D263A913C218F851B1DCA99B8BA80F7F3DF780681500B3E3D120020F1F047A363450784277A759CB9D50719D25279557D3329AF692465350DA4944250525D4F4A2808230DC3E590648460CBC19FCF60E088673D0385CDB39C814EAB055D3AF2850B19BED562F061A8F32881B805632AF9EBC4D96FDAFC6AF6F215F47D62746ECD450BD8D0B44AF069FABA27464BF0C938AA1F55259D31E682798C99704D6074725A4D630BA9AA6B2695754D04B44039744D30C8B5C3205587A1A43F0C99DA60505D49F481818240FBF93B09DD0E1E619D7F5AFBF53F189EE42F7446BFCE988B97D2DF7FE5132F2E5F27DA68B7FB8B03E72EEE3D7BCDFFB84750EC25FFA8EC6B61C9A5FE3119353E91A972F79084E28B01D139872F07DCF9D0EEF8BE05EF7DF96E4FF069CECA677B571A23AB0D0C0C00251C53B482DFB0A15DB1D5E1F35E1EF5CDADA4960250DDD04C400B4097531046130CB13945E4E8B5C86EDBF3FE258F9B2FFB7CC2DC159FAFFAE280B393DBADD8E07BD9B589F7CB1096B89C12F421942B8B88F402EA54C232339F84A648315CED1393D97A3928A1F2F0D5C0709B6D0EFF60834F4BA6A14904B360337210187EBD0F76D35CFCDFB4BF46BDEBCDB50DCD1D0DCD6DA4AE8942D0D48220D4A8C020AF6FD20043432F0C55C683C19F2E11C1141CBA7CBB2C3829BB2109A292D45C284D05085E7D69C986A6D9A05338C25080308450107C63B23ACF06C4CAEDCFDDB8B1E8FD9D2B59DF81FA07908F18214D60D8D9CF16694C66EDA878D5B5C098D8E6D676D2D8D2461AA05310401B0C07866235180AB5C150DA0B43CE60301454A0BF00305CB893488E5C8B2431D44954371308825AC049230CE9BD3004A7E4915F42929A7FF00E2B5CBDE3C856C6DCCA14A3A1305623008161673F2E87A8036526593279C1DBDB9A5ADBBA9ADBDA49735B0701109AC6000C206047AF08CC2E0EE4333C280C1EE1A9AD3F7A47547F607FDA16210033890929E33A86864BEF02D16CC0070A34DE8948C8C86AEFE824ADB4B7C1D7F60ED20220E800038050D330300C004259B53A0C751A60A8E91370CA530B38F5C250893040C009B289103256E625D47D86445518D03CE806C3F5A88C8E63DE110D1BF79EDF83130556081616187D1CE300D0D90F5E2EAC91CD846F3CFFFADFBE6E696DEBE8EAEA269D5D5DA4A3B38BB4D3DE36466000D50DBE00A499330AFB9B89E1C0E01591D6E2E819DE24DA7AE01DAC838078039B917C6CAC02C0067DC0AEC1FA97DAFE83A7DDFD88A2757713D245FF194B306417571127DF18723128B18F66D0170CA7FDA2EBFE7939B068AAE5FA5730C884FE80EDE3631400EAC840B2078B35B1666F4B96B4A8826868DD00423780A00186F68161A85785A151330C953AC050A40603F80B05E5FD61806A23F00552F22B502BF49809993A0C1A329652CD194B250C008183C7DDDAED2ED7BDD11480EF841143C36B01C3397F33979930A60289F0C35D47890E6DB4C39040850666001C38F524953E60084EBEDF79C823AC7DE1DA9D42B68895D5028686C030EA1F133E74E9479D3F77FFB038F2804D230C3D264215061684BE30B492FAA6BE300008C38501840D00F8DFCBD1EA330C1786A31E772BBE74F2BA8A5A007C28C6F0BE80FEAB7AE72BD43F96694BB6149656D6906134A3C2A0127DD404C331EF48E21E91A6D14C684A5F67EB90BE562D6C094EC9EB3CE87EB7C56CF9C78B14D5CB130CBD22D0DFAE1DB059A0B6A0B60ED6B56622D19445EFDA758304F5D4461A865301F1E4ECED7B83FA0CC381C1D13DB472E3FE0B7BB11E017C293AB6A30A800177ED40D40F967EB360D386E4BD75DB1DAE100335551800049D6150F1170683014050850152C5A005FA642CE5DA3296432B6C710D4EACDF71D2270827118CA981978443133CD879A8EC51EEDA015A71D60BE632A6E2D760E947EDFF8EA317BCEF11233463C17083AE04C00F8099CF6A867ABDC300758BFBDD426A581F8A2EA5156569230A409FFA7D98EDA0E6A15A86A5F425143A6CE0A04EDF0CC1C69D82CDBBCF7DB6FF6C4C607C6613FC71B03E868100C18C6518C2D2F31100107E7F33A11F180004FA33DA177D606B83C52430D154762FE9BBEE50B7598F25DC0B2762FA123662425104143A9809C5A0EA459BED8FFCE01E9CEDEC13D50603A4AD1FA5EA136AF3210002836750107480A1450D86C696816100411DA17F837AFABA425BFA7A88852D4E3E918DAB76FEB4AB273CACDCDCAADAB5EC7E7E5020068FE9C3AC87BA37589BC28C874D997C2BEBDFBDBE76EBFE4BFEC9CEBED1ED8E5EE1E4E7A024DCA205CB1AF8C3D9A40F3BA8E084C10002E1212952E21A928C193617BF38B47D06D70A7A84E1ECED84DE245543B3416038773BBE6DD5CE1F1D189E700E4E384819C3E61928475376B66AF929D4C8C3A83B1C5CE5C30FC2A81EFD65A0FC89275EFF9DB37BE0F19BB15DC7BCA34860521E0EC8833618708887D3CF417860E08CE22F2861500B38B5AB86A2078001006643D17DCD843E61002DF9CE37CE17218B8A5554B3AC2D181381A28B66298A6BCCB0CC0C4AD5A0DA0AB289103B0093A12C62D50104ED331FD40E66A7ACA75155FF4728855AF1C93F0F5F0A8C6F74BA1183B16C18ACE1369891A0053C23D3D10932661B0A0C25F2867E9AA11F0CC3AC72BA169549B6EC3B1F4E27DB262AE8B7D1A9860E3BA3F1B1E82DAC41A44B6DAC4B04AD0C9B5A0008800134042C2175D8E1A4D9E6C3CC07E163250FD87AC99A6D475C6F9EA0B31552A3B54398F1BA34185008F38E441BAE66D0270C3ED199C4F6A477E17B5F395CDF7BD233F897808854BFC8E4FC5BD1A98577E2D28B82E2338A3C83E2329CDD0242761DBBE4BAFC63FBEFD96DF342019E9100DA4159CD3C48C999F60ADED954B5A0BD17BFBDEFECF5D093FE71C42F3E0707E4616FDA3296EA3018AAB0C53534191DE507296C894ECFAF7176BB1528D96CB78B9A08096A6D7022C17F58D8B3E9F531AD00F409E5023D607BA8BAB175BE7AEB1C757C40E5EB2FA6C7C130100CA069C1611E6A95D3E580C858BE78D326340F78300675E041AE1A20E85FC10BC4282A783FB273BEF43355F9700803D78C0343694D3D39EC1581DA6038256FA9D2D2E66F7F703D858EBB05751C2160A71253E803404F150F2C2BC0E93315BFF682E586AFDC4253BAC123059BC735DD60186E610B04845C6EC6E9ADB0658F8BFB4576F526E4A9D61DAA03C0CE7EC84061158FC4E6AC6F84F4CADD54FC50AE190F86D89C625C11E9ABCA896A84EEDDC7DD4E43593E3AF5E0DFA998825EDBFF9CE593B8A6A4B3FFCF6B77D87B4566D0757A11275D7D642C752C6C01184253A5981AD667C91B85A073F1BAED9FE086149562935E0030950B615EAA26E8FAD2F54E5C091CB604BF28D78C0B03049A40F0FAAE72BA161C170905BA98AD552936E955FFE02450CFDF6A8BBDEDCDB86CAC58E59AF161C8A23E80214ADEA836E8126DB0DD8A0123F005D82CE363ACF70FDE212679848B76FDE8E60E317D884A71CD883028FC05082E19AAB0E594E79DAB18DBC168A1B2E610A244508B8E513FC9928BFE51E9B07DA9ED1108F88C7618F45DE5E41791188B3B9DC1D79BCF561BB100B0275CCC84F46E405C566D8AB48C93CC43084372AEAC983D86CF7A0666783144AC2CE336B7329DBE74DD6AD8B664E85C3DD71E0C067D15B694D734B463E10E9ED2A25C0EAA0060B565F72608F9C20771EDE183A1545ED7DC1F001513F0ECC2D52BE2738A3B4165706D1482304C18F28ACA2B31858C69631B850950730283EE65C92080C0B5B10F837AFA3A3557761F6301206B90399B26565906F244AFBA78DCF6CB2E96777343FCF0C1703D28C68F3D9277E914363184C5222A81A059A29736D9FD640F09097D54FB706D0461D090B1FC70D7919D180EC663EE7A02418A50305400F1C566E32C24CB127264551038E0DAC3034345756D155671BFD077C3496F32883DBC792A4403DFDF76681F64939AB95CC043D35CAEF89DA1F25D80A65E65CB59DF5DBD982F16584001686452762EC494BBBA397760ACB782E2F2C2711656D698EC834D3D2ABB8DFA9683B1972A4D0547C1D4F2A34F4BABEA3BAAE992B09B8360CCB6CECEAECE8FBE39B6136B04A1D46F8A3204ACA80720EA7BFBA72976F79A882CAD36DBED91D7357541108143604C0690BA0F9C7277C68BB37A4E1ED930BE5F4918D1749C3BA40DF962ABBF7FED78ACAEB1A51B82099C39185BEDA49BFFCFD4EB5F8AAA1F6A3D351C43A7F9842F0C0CE1A58C73293DD6EBB71F71AC6D686E6F6C6D33CA064FAE0DAFB5B4B6B5399CF53C81671B4381AF968250A26567107B851B648BF0A8733CE94BF8DCA277B7664A8B65AD7465C041307A5B5199BC64F966BB2FB1241C663E081FEDFE20FB0288A67BFC4013CC8493ADE907C1167033D1EAAF1DCEB994C96B6AB8A11E5DADB2BAAEDAC9F5C685A75E5CF526167D40BC1FCE1798AA7D5308197873A8725B38FD00581E42FC18A3489225B05B68CDE77BF7DD0C8D8B949555CAB9E11F99D6D6DED19E929D9F79F482F799897397AF42670F3692C2665EBC9760F093C8753B18029C07C81882738867FF52DF00CA8CA97FC0F044EFCE5BB9F5AB7D27DCCE5FF209F2F70D89890C8B4F4F49CE92DECFCA2B2ACCCC93D15E24E3FA50BBAC304B5A5498965B9017959499E277373EFCCA8D509FED87CE383EFDCAAAB5B80D0CCE63C45A3FEB6938EBD9DB4D74BA8B40F7B37F95973C0208104BC6EB52608B32C000B762286ECF60AF7A5D01B767B0BB5825365C1F4EB77A8B8EE99B38A6780A8B5040FB62F61C26E11CAA9D4DD853D9A8970F7E5BCFE5D8BA5D7EF9E08740B30524139032CC1FC039362AF7E7E025900086251F3D50D60B9DC5F52176183FBC5B1176F62C33C16B6B946702B04BBB49EC8D2C7D0F8820863825ACDFD170EC8510DA6FD0523DD182EB43EFCADBC8F09A99C51A4E0541553FA45345F5704EE00077E8A99F6BC3F5A175D531B5518CF330CE0552EDFF02DCA524A9371DC0180000000049454E44AE426082');

INSERT 1

Time: 1.344ms

it’s a pity this does not work for postgres. Is the implementation of decode on the list?

I just created a feature request for you. You can track and add details here: https://github.com/cockroachdb/cockroach/issues/22331.

@ik_zelf, it turns out that this function is implemented in the v2.0 alpha that you’re using, so there may be a bug. Sorry for the confusion. Please track via the issue I posted above.

Hi @ik_zelf, the problem you’re seeing with decode should be fixed in the next alpha, it was fixed in this pr. Sorry for the trouble!

thanks, good to know, I can test this soon.

thanks @justin,

I just tested this and it works in v2.0-alpha.20180212

Hey @ik_zelf, glad to hear it! Very glad we have users who will test this stuff out for us, it’s much appreciated!