"Mitch Vincent" <mitch@venux.net> writes:
> sprintf(query, "INSERT INTO %s (string, id) VALUES ($1, $2)", indexname);
> The above makes the query string, as I can see but what in the world is the
> $1 $2 and where did they come from?
Parameters. The chunk of code you quote shows the plan being set up
with two parameters, the first of type VARCHAR and the second of type
OID (this allows the parser to know what datatype conversions it might
need to apply). The actual values of the parameters will get passed to
the executor when the plan is executed, later on. Too lazy to go
looking for the details right now...
regards, tom lane