Re: Trigger (C) question

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Mitch Vincent" <mitch(at)venux(dot)net>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Trigger (C) question
Date: 2000-06-28 16:20:44
Message-ID: 15833.962209244@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

"Mitch Vincent" <mitch(at)venux(dot)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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Ted Nolan SRI Augusta GA 2000-06-28 16:25:32 Re: DateTime fields
Previous Message Stephen Lawrence Jr. 2000-06-28 16:13:18 Re: disk backups