"Vance Maverick" <vmaverick(at)pgp(dot)com> writes:
> My question is about performance in the postgres server. When I execute
> "SELECT SUBSTRING (my_bytea FROM ? FOR ?) FROM my_table WHERE id =3D ?",
> does it fetch the whole BYTEA into memory? Or does it access only the
> pages that contain the requested substring?
Recent releases will do what you want if the column has been marked
SET STORAGE EXTERNAL (before storing anything in it...) See the
ALTER TABLE reference page.
regards, tom lane