{"id":3,"date":"2005-02-28T12:02:44","date_gmt":"2005-02-28T16:02:44","guid":{"rendered":"http:\/\/blogs.law.harvard.edu\/rlucastemp\/2005\/02\/28\/bugworkaround-classdbi-postgres-ca"},"modified":"2005-02-28T12:02:44","modified_gmt":"2005-02-28T16:02:44","slug":"bugworkaround-classdbi-postgres-cant-delete-cant-bind-a-reference","status":"publish","type":"post","link":"https:\/\/archive.blogs.harvard.edu\/rlucastemp\/2005\/02\/28\/bugworkaround-classdbi-postgres-cant-delete-cant-bind-a-reference\/","title":{"rendered":"BUG\/WORKAROUND: Class::DBI \/ Postgres: &#8220;Can&#8217;t delete: Can&#8217;t bind a reference&#8221;"},"content":{"rendered":"<p><a name='a65'><\/a><\/p>\n<p>In Class::DBI, there appears to be a problem with the Postgresql driver<br \/>\nand certain kinds of relationships being defined.&nbsp; It shows up as<br \/>\na &#8220;can&#8217;t bind a reference&#8221; error in the DBIx::Recordset code for<br \/>\nPostgres.<\/p>\n<p>It persists for me with Class::DBI 0.96 and DBIx::Recordset 0.26.<\/p>\n<p>The effect is seen for me when I retrieve a Class::DBI object id # 56<br \/>\nwith some has_a relationships defined, and then try immediately&nbsp;<br \/>\nto delete it.&nbsp; It bombs out with <\/p>\n<p><span style=\"font-family: courier;\">Can&#8217;t delete 56: Can&#8217;t bind a reference at blah\/blah\/blah\/DBIx:\/Recordset blah blah<\/span><\/p>\n<p>I can work around this by 1. removing the has_a relationships, or 2.<br \/>\nstringifying the object before deleting it (found this inadvertantly in<br \/>\nwriting some debug statements to explore this; very vexing that reading<br \/>\na property has such a nonorthogonal effect, but I&#8217;ll hush since I<br \/>\nhaven&#8217;t the time to become a CDBI developer myself).<\/p>\n<p><a href='http:\/\/www.spanner.org\/lists\/cdbi\/2004\/06\/23\/1fb545ec.html'>BUG\/WORKAROUND: Class::DBI \/ Postgres: &#8220;Can&#8217;t delete: Can&#8217;t bind a reference&#8221; &#8230;<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>In Class::DBI, there appears to be a problem with the Postgresql driver and certain kinds of relationships being defined.&nbsp; It shows up as a &#8220;can&#8217;t bind a reference&#8221; error in the DBIx::Recordset code for Postgres. It persists for me with Class::DBI 0.96 and DBIx::Recordset 0.26. The effect is seen for me when I retrieve a [&hellip;]<\/p>\n","protected":false},"author":1180,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-3","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/archive.blogs.harvard.edu\/rlucastemp\/wp-json\/wp\/v2\/posts\/3","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/archive.blogs.harvard.edu\/rlucastemp\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/archive.blogs.harvard.edu\/rlucastemp\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/archive.blogs.harvard.edu\/rlucastemp\/wp-json\/wp\/v2\/users\/1180"}],"replies":[{"embeddable":true,"href":"https:\/\/archive.blogs.harvard.edu\/rlucastemp\/wp-json\/wp\/v2\/comments?post=3"}],"version-history":[{"count":0,"href":"https:\/\/archive.blogs.harvard.edu\/rlucastemp\/wp-json\/wp\/v2\/posts\/3\/revisions"}],"wp:attachment":[{"href":"https:\/\/archive.blogs.harvard.edu\/rlucastemp\/wp-json\/wp\/v2\/media?parent=3"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/archive.blogs.harvard.edu\/rlucastemp\/wp-json\/wp\/v2\/categories?post=3"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/archive.blogs.harvard.edu\/rlucastemp\/wp-json\/wp\/v2\/tags?post=3"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}