lnoir commented on issue #211:
URL: https://github.com/apache/incubator-age/issues/211#issuecomment-1110633512

   Okay, I just got to the bottom of this. @emotionbug's comment made me look 
more carefully at the initial connection and start-up queries. Turns out it was 
user error. Simplified examples follow.
   
   I was doing something along the lines of:
   ```
       this.pool = new Pool({ ... });
       this.pool.query(`
           CREATE EXTENSION IF NOT EXISTS age;
           LOAD 'age';
           SET search_path = ag_catalog, "$user", public;
       `);
   ```
   But I realised I needed to perform the setup queries on the client passed to 
the `connect` event handler:
   ```
       this.pool.on('connect', async client => {
           await client.query(`
             CREATE EXTENSION IF NOT EXISTS age;
             LOAD 'age';
             SET search_path = ag_catalog, "$user", public;
           `);
       });
   ```
   Now the queries are running without error and returning the expected results.
   
   Thanks @pdpotter @JoshInnis @emotionbug for your help.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to