pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
[?]Nobody hasn't add column?
2+ messages / 2 participants
[nested] [flat]

* [?]Nobody hasn't add column?
@ 1999-05-28 08:34  curry <curry@mail.knm.net>
  0 siblings, 1 reply; 2+ messages in thread

From: curry @ 1999-05-28 08:34 UTC (permalink / raw)
  To: pgsql-sql

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.




^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: [SQL] [?]Nobody hasn't add column?
@ 1999-05-28 08:59  Remigiusz Sokolowski <rems@gdansk.sprint.pl>
  parent: curry <curry@mail.knm.net>
  0 siblings, 0 replies; 2+ messages in thread

From: Remigiusz Sokolowski @ 1999-05-28 08:59 UTC (permalink / raw)
  To: curry <curry@mail.knm.net>; +Cc: pgsql-sql

> 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 error
	Rem
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           * *		
-----------------------------------------------------------------*****----------




^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~1999-05-28 08:59 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
1999-05-28 08:34 [?]Nobody hasn't add column? curry <curry@mail.knm.net>
1999-05-28 08:59 ` Remigiusz Sokolowski <rems@gdansk.sprint.pl>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox