Question: I have a menu of topics (e.g. "About us", "Support") and I want to be able to tell what topic is active right now. When a topic is clicked it will become the active one. Think of it as a substitute for a router that will set an active route. This is not possible in my case since I'm working in SharePoint 2010... in a content editor. So I made the decision to have an **activeTopic** variable in my Vue instance.

**The Vue instance**

```
new Vue({
    el: '#app',
    data: {
        activeTopic: '',
    }
});

```

This is because the **activeTopic** has to update another component and show some data based on the active topic. Like a router showing a child route.

**The topic component**

```
Vue.component('topic', {
    props: ["title"],
    methods: {
        setActiveTopic: function (title) {
            activeTopic = title;
        },
        isActiveTopic: function (title) {
            return activeTopic == title;
        }
    },
    template: `
        <div v-bind:class="{active: isActiveTopic(title)}" v-on:click="setActiveTopic(title)">
            <p v-text="title"></p>
        </div>
    `
});

```

The **setActiveTopic** function works as it should when I click it; it updates the activeTopic. But the **isActiveTopic** function gives me this error:

```
Error in render: "ReferenceError: activeTopic is not defined"

```

What I don't understand is that I can edit the activeTopic variable but I can't make a comparison? I've tried setting a default value but it still says it is undefined.

Answer: 
In postgres you can use a format like:

```
INSERT INTO films (code, title, did, date_prod, kind) VALUES
('B6717', 'Tampopo', 110, '1985-02-10', 'Comedy'),
('HG120', 'The Dinner Game', 140, DEFAULT, 'Comedy');

```

Due to your record base exception handling you can better first resolve the duplicates before generating this query as the whole query might fail when an integrity error occurs.
Building one large INSERT statement instead of many of them will considerably improve the execution time, you should take a look [here](https://stackoverflow.com/questions/1793169/which-is-faster-multiple-single-inserts-or-one-multiple-row-insert). It is for mysql, but I think a similar approach apply for postgreSQL