Обсуждение: [?]Nobody hasn't add column?

Поиск
Список
Период
Сортировка

[?]Nobody hasn't add column?

От
curry
Дата:
I'm first time in postgresql...
Um....
I made little program... with C and postgres on the web.
Everything is OK.
But I want to add a column.
So
....... sprintf(rest, "alter table danga add (a%s float)",entries[0].val); res = PQexec(conn, rest); if
(PQresultStatus(res)!= PGRES_COMMAND_OK) {   fprintf(stderr,"command failed\n");   PQclear(res); printf("###");
exit_nicely(conn);} PQclear(res);
 
.........

Excute this program print JUST

###

WHY?
Maybe Nobody hasn't create column.... I don't know...

My English write level is very low.
so my message reading thank you so much.



Re: [SQL] [?]Nobody hasn't add column?

От
Remigiusz Sokolowski
Дата:
> I'm first time in postgresql...
> Um....
> I made little program... with C and postgres on the web.
> Everything is OK.
> But I want to add a column.
> So
> .......
>   sprintf(rest, "alter table danga add (a%s float)",entries[0].val);
>   res = PQexec(conn, rest);
>   if (PQresultStatus(res) != PGRES_COMMAND_OK) {
>     fprintf(stderr,"command failed\n");
>     PQclear(res);
>   printf("###");
>     exit_nicely(conn);
>   }
>   PQclear(res);
> .........
> 
> Excute this program print JUST
> 
> ###
> 
> WHY?
> Maybe Nobody hasn't create column.... I don't know...

May be :-)
First just check if You have created user with name nobody in database.
After that check if this user has appropriate permissions to Your table.
I'm not sure, but it is possible, that tables can be modified only by
its owners and probably by superusers.
So if You create table as xxxuser and after try to modify it by nobody -
You get errorRem
p.s.
You can solve this by:
- firstly creating table as nobody ( I recommend this )
- give nobody permissions of superuser

-------------------------------------------------------------------*------------
Remigiusz Sokolowski      e-mail: rems@gdansk.sprint.pl           * *        
-----------------------------------------------------------------*****----------