---
title: "PostgreSQL psycopg2:IndexError: tuple index out of range"
author: "2057"
date: "2014-01-09T17:04:50Z"
tags: []
categories: ["编程语言"]
slug: "postgresql-psycopg2-indexerror-tuple-index-out-of-range"
draft: false
lastmod: "2014-01-09T17:04:50Z"
id: 2001941
url: "https://2057.iteye.com/blog/2001941"
---

Postgresql

psycopg2使用like查询的时候出线了这个异常

```exception
tuple index out of range
```

stackoverflow找到了解决办法，即在like后面多加两个%%符号
解决办法参考：
http://stackoverflow.com/questions/1734814/why-isnt-psycopg2-executing-any-of-my-sql-functions-indexerror-tuple-index-o/1735731#1735731