Ok, very good, thanks to everyone who replied! I was hoping to see a methos within PostgreSQL itself (via INSERT or something), but I can test out a method using PHP instead, since that's the ultimate destination, anyhow.
Not sure how you expected to be able to issue an INSERT w/o some kind of client interface. If you need to do this via "psql" (i.e. the official PostgreSQL client) there are ways - though I am not that familiar with them. Typically I'd store the data into a file then do something like:
\set variable_name `cat filename.ext`
psql variable can only hold text string,so only "cat" do not work here if the ext is jpeg or some other binary file extension.But if we encode the binary to base64 text first,then it will "work" somehow.
I wrote a blog about input and output the bytea as binary file in psql: