How to Manage PostgreSQL Databases from the Command Line with psql

Greetings All,

I’ve run into a challenge with the subject course. I’ve followed Gerard Hynes’ instructions as best I can:

I have successfully installed PostgreSQL.
I can connect to the PostgreSQL Local host on my laptop.
I can CREATE DATABASE on my laptop
I can CREATE TABLE on my laptop
Both of the last two items seem to indicate I have read/write privileges on the database I created, right?
I cannot add data to my tables using the INSERT INTO command per Gerard’s directions. I have tried MANY strategies and nothing has worked. I’m sure it is a ME issue. Any suggestions you might have would be greatly appreciated. Thanks!

can you provide an example of how you’re using the INSERT INTO command. Copy and paste what you’re typing

Good Morning Daryle Tan,

Thank you for your email. I am using INSERT INTO per “How to Manage PostgreSQL Databases from the Command Line with pqsl” ([Linky:]([How to Manage PostgreSQL Databases from the Command Line with psql]

These instructions, by Gerard Hynes, depicted the installation of psql (v14.1) on a Windows machine. I followed along using a Windows laptop and I installed psql (v15.3) . Results on my computer matched Gerard’s depicted results until I got to the section concerning inserting sample data into the tables I had successfully created. Here’s the code exactly as it is written on the webpage:

INSERT INTO authors (first_name, last_name)
VALUES (‘Tamsyn’, ‘Muir’), (‘Ann’, ‘Leckie’), (‘Zen’, ‘Cho’);

When I ran this code, psql errored out with a message that there was “no column named tamsyn” to enter data into. Didn’t matter what I tried, this never worked properly. To reiterate, all of the indications I had to this point led me to believe that:

  1. psql had installed properly

  2. I had necessary privileges to Read/Write data into “books_db”

I’m guessing I must have missed a setup step somewhere along the line… Hope this helped. Thanks again for taking the time to respond.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.