Solution:
C is able to compile with an embedded shell script.
So a small C program with an argument being the user passed to the shell
script it succeded succesfully.
I am aware that it could be my question was not specifically relevant to
Postgresql! :)
It took a while to solve. :)
Thanks
Poul
My goal is to grap a user from the OS and and substitute the grapped user -
to be the owner of the database - in the sql commands
e.g using shell-script substitution syntax:
create user ${user} with login;
create tablespace ${user} location '/path/${user)';
create database
"David G. Johnston" writes:
> On Wed, Nov 23, 2016 at 3:46 AM, Poul Kristensen wrote:
>> In the postgresql.log I get "select datname from $1".
> That is expected when you parameterize a query - the query string includes
> parameters instead of
On Wed, Nov 23, 2016 at 3:46 AM, Poul Kristensen wrote:
> In the postgresql.log I get "select datname from $1".
>
That is expected when you parameterize a query - the query string includes
parameters instead of values. What you are seeing is the "Prepare"
component of a
The below mentioned pg_database does not appear in $1.
In the postgresql.log I get "select datname from $1".
Do you have a suggestion of how to solve this?
I get double declarations when using both
char *paramValues[1]
char *paramValues[1]
//char *value1 = "pg_database";
//char **paramValues =
On Tue, Nov 22, 2016 at 8:22 AM, Poul Kristensen wrote:
> I think I understand.
> When I use this in my code I get
> "undefined reference to `PQexecParms'
>
The correct name is PQexecParams (note the last "a"). Sorry I missed that
when first looking. Also, just to be sure,
Poul Kristensen writes:
> When I use this in my code I get
> "undefined reference to `PQexecParms'
> when compiling.
IIRC, it's PQexecParams not PQexecParms
regards, tom lane
--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To
I think I understand.
When I use this in my code I get
"undefined reference to `PQexecParms'
when compiling.
references in main is
const char *conninfo; /* connection string to the database */
PGconn *conn; /* connection to the database */
PGresult *res; /* result of sql query */
int nFields;
On Mon, Nov 21, 2016 at 11:22 AM, Poul Kristensen wrote:
> Thank you for fast repons!
>
> The $1 substitution below. I assume that it refers to "joe's place". But
> it is not very clear to me, how "joe's place" will appear instead of $1
> when running. Where is it possiible to
On Mon, Nov 21, 2016 at 8:56 AM, Poul Kristensen wrote:
> Hi!
>
> Hopefully this is this list.
>
> A shell variabel is defined like this
>
> var1= value
>
> used like ${var1}.
>
> How is the equal defened in the Postgresql C programming?
>
> Thanks.
>
> Poul
>
> BTW: I have
On 11/21/2016 06:56 AM, Poul Kristensen wrote:
Hi!
Hopefully this is this list.
A shell variabel is defined like this
var1= value
used like ${var1}.
How is the equal defened in the Postgresql C programming?
You probably need to be more specific about what aspect of using C in
Postgres
Hi!
Hopefully this is this list.
A shell variabel is defined like this
var1= value
used like ${var1}.
How is the equal defened in the Postgresql C programming?
Thanks.
Poul
BTW: I have not received my ordered book yet!
12 matches
Mail list logo