I am designing a database in PostgreSQL on a dedicated server. I want certain complex queries to be run often, and the results to be accessible with ODBC/JDBC clients such as MS-Access or reporting software.
As I see it, I have the option to either define a VIEW within PostgreSQL and import it using ODBC, or to define the query within the ODBC client and import the underlying tables.
Which is best?
Are there any other options that I am missing?
I’m not sure what you mean by “import”. A view is essentially a predefined query which you can select data from as you would from a table. When you execute a SELECT query, whether you’re accessing the data tables directly or through a view, only the results of the query are sent back to you.
If you have to execute the same query from various different clients it might be a good idea to define a view for that query.
Share and enjoy.