Tell me more ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

When I run \e on the command line while logged into the psql command line tool, my default editor, sublime text, duitifully opens. However, when I type in a query like this:

create table tutorials (
  tutorial_id serial primary key,
  title text,

  author_id integer references authors(author_id)

);

Then hit save and exit, nothing happens! My query is not run. What am I doing wrong? How do I fix this?

share|improve this question
 
After having left the editor you are in the psql shell again. enter \g to execute te query in the buffer (or \e to edit again ;-) –  joop 2 days ago
 
Just tried that - did not work –  Amit Erandole 2 days ago

1 Answer

After the editor exits, type \p to see what the editor put back into the query buffer.

share|improve this answer
 
Just did that - editor shows nothing - just a big blank multiline space. So does that mean the buffer is broken? How do I fix this? –  Amit Erandole yesterday
 
That means your editor isn't saving anything back to where it should. –  Peter Eisentraut yesterday

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.