Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Select value from table? Bash

I want to extract the value of ID in a single command, I think this is a table but i’m not sure.

                  id                  
--------------------------------------
 00000000-0000-0000-00000-00000000000

I get this ID from a table in a docker container of postgres and I want to get only the value in a single command, I use this command to obtain the table:

docker exec -it container psql -U postgres -d database --command="SELECT id FROM table WHERE name='device_name';

Different things that I saw on internet.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

Use This Command

docker exec -it container psql -U postgres -d database --tuples-only --no-align --command="SELECT id FROM table WHERE name='device_name';"
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading