jtkells <jtkells@verizon.net> writes:
> Thanks much for your reply, that does the trick quite nicely. But, I just
> came to the realization that this only works if your are running the
> client and the file both resides on the database server. I thought that
> I would be able to do this from a remote server where the client was
> running, picking up a local file and sending it into a remote database
> table. Unless I am missing something, I cant. I can create a temp table
> on this server, upload the file to a similar table then replicate it to
> the targeted server.. Lots of work that could be easily done with a
> programming language (as someone else posted) but thats what I have to
> work with for now and I have no direct access (I.e. sftp ) to the
> database server
Maybe use psql's \lo_import command to suck the data into a "large
object" on the server, and then use loread() to insert it into the
target table? (And don't forget to drop the large object after.)
Pretty grotty but I think it might be the only solution with the
currently available tools.
btw, does "bytea_import" actually exist? It's not in the core
server for sure.
regards, tom lane