How to add a value to existing column in a Postgres SQL table?

Suppose you are having an existing table and you want to add a value all rows of the column. 

To do that, you are essentially updating the value and setting the column's value to the desired value. If you want you can add condition to it too using WHERE.

Sample Query -

Update yt_records SET yt_channel = 'myindianodyssey'

Using the above query, you are adding myindianodyssey value to the column yt_channel which is there inside the table called yt_records.

Leave a comment

Filtered HTML

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <blockquote> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.