If you need to convert a TEXT column to a BYTEA column, you can use a cast expression to do the work:
ALTER TABLE mytable ALTER COLUMN col TYPE bytea USING decode(replace(col, '\\', '\\\\'), 'escape');
Note that altering the column type of a column is only supported beginning with PostgreSQL version 8.0. For more information, see the manual.
byteacastconversiondatabasemodificationpostgresqlschemasqltext
Use split to move blocks of text around rather than having multiple terminals open. Open the file you want using the split command:
split: path/to/file
C-w and then k or j will move you between vertically between the buffers when you are not in insert mode (up and down, respectively). For example, this makes moving text between files much easier.
buffercommandeditorssplitterminaltextwindow