0

I've tried to find a way to ask the postgres server for the current list of databases (and later list and describe the tables) from a C program using the libpq library. Currently I'm doing a (simplified) popen("psql --command '\\l'") but this is not really how I would like to solve the problem ... Is there any way of asking the postgres server for the information I need via a libpq function?

1

1 Answer 1

1

You can run a metadata query like

SELECT ... FROM pg_database;

The columns you select will depend on the information you need.
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.