Re: [Gambas-user] Can't access PostreSQL schemas

2009-09-25 Thread José Luis Castro
Hi Benoît. Thanks for your kind answer.

I must say, however, the database was created and it's maintained using the
application PGAdmin, so I can say with absolute security that the table
I'm trying to acces has been created, in fact, with a primary key. Also I
ran a lot of queries from PGAdmin and everything works just fine; so a
priori I think the database and tables are well designed.
On the other hand, I tried to access from Gambas 2.16, another table of the
same database, but a one that is not into the schema (for instance, has the
same sctructure, keys and indexes) and works fine when using the Edit()
method. That's the reason I think this is a problem with schemas.

Regards,

José Luis



2009/9/25 Benoît Minisini gam...@users.sourceforge.net

  Hi. I've created a schema in a PostreSQL database. The sintax for
 accessing
  data from the schema is: schema.tableName
  That works fine when trying with .exec method (i.e. SELECT * FROM
  schema.tableName or INSERT INTO schema.tableName VALUES...), but it
  doesn't work when I try to use the .edit method
 
  I'm using Gambas 2.16 and PostreSQL 8.5
 
  If anyone can help me with this (maybe just telling me where to get the
  answer for this question, probably already answered) i'll apreciatte it.
 
  JOSÉ L. CASTRO

 You can only use the Edit() on tables having a primary index. In that case,
 you should better create your database with the database manager, to be
 sure
 things work as expected.

 See: http://gambasdoc.org/help/comp/gb.db

 Regards,

 --
 Benoît Minisini


 --
 Come build with us! The BlackBerryreg; Developer Conference in SF, CA
 is the only developer event you need to attend this year. Jumpstart your
 developing skills, take BlackBerry mobile applications to market and stay
 ahead of the curve. Join us from November 9#45;12, 2009. Register now#33;
 http://p.sf.net/sfu/devconf
 ___
 Gambas-user mailing list
 Gambas-user@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/gambas-user

--
Come build with us! The BlackBerryreg; Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9#45;12, 2009. Register now#33;
http://p.sf.net/sfu/devconf
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] Can't access PostreSQL schemas

2009-09-25 Thread Jean-Yves F. Barbier
José Luis Castro a écrit :
 Hi Benoît. Thanks for your kind answer.
 
 I must say, however, the database was created and it's maintained using the
 application PGAdmin, so I can say with absolute security that the table
 I'm trying to acces has been created, in fact, with a primary key. Also I
 ran a lot of queries from PGAdmin and everything works just fine; so a
 priori I think the database and tables are well designed.
 On the other hand, I tried to access from Gambas 2.16, another table of the
 same database, but a one that is not into the schema (for instance, has the
 same sctructure, keys and indexes) and works fine when using the Edit()
 method. That's the reason I think this is a problem with schemas.

José, did you set your schema up into the 'search_path' variable ?

-- 
Reality is a cop-out for people who can't handle drugs.

--
Come build with us! The BlackBerryreg; Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9#45;12, 2009. Register now#33;
http://p.sf.net/sfu/devconf
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] Can't access PostreSQL schemas

2009-09-25 Thread José Luis Castro
Sorry, Jean-Yves: I have no idea how to do that. Is it necessary? Or -better
answered- when is necessary to declare a search_path variable?
Thaks for your help.

2009/9/25 Jean-Yves F. Barbier 12u...@gmail.com

 José Luis Castro a écrit :
  Hi Benoît. Thanks for your kind answer.
 
  I must say, however, the database was created and it's maintained using
 the
  application PGAdmin, so I can say with absolute security that the table
  I'm trying to acces has been created, in fact, with a primary key. Also I
  ran a lot of queries from PGAdmin and everything works just fine; so a
  priori I think the database and tables are well designed.
  On the other hand, I tried to access from Gambas 2.16, another table of
 the
  same database, but a one that is not into the schema (for instance, has
 the
  same sctructure, keys and indexes) and works fine when using the Edit()
  method. That's the reason I think this is a problem with schemas.

 José, did you set your schema up into the 'search_path' variable ?

 --
 Reality is a cop-out for people who can't handle drugs.


 --
 Come build with us! The BlackBerryreg; Developer Conference in SF, CA
 is the only developer event you need to attend this year. Jumpstart your
 developing skills, take BlackBerry mobile applications to market and stay
 ahead of the curve. Join us from November 9#45;12, 2009. Register now#33;
 http://p.sf.net/sfu/devconf
 ___
 Gambas-user mailing list
 Gambas-user@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/gambas-user

--
Come build with us! The BlackBerryreg; Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9#45;12, 2009. Register now#33;
http://p.sf.net/sfu/devconf
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] Can't access PostreSQL schemas

2009-09-25 Thread Jean-Yves F. Barbier
José Luis Castro a écrit :
 Sorry, Jean-Yves: I have no idea how to do that. Is it necessary? Or -better
 answered- when is necessary to declare a search_path variable?
 Thaks for your help.

search_path is a system variable, unique for each role.

command to see what's going on is: 
show search-path;
default path is: $user,public
this command can be issued by a regular user.

however, if you happen to create new schemas, only the postgres user has
total control of it (ONLY with qualified table's name if you don't update
the postgres SU search_path variable, such as: schema2.table5), for a user,
you must inclued the new schema in its search_path otherwise he'll see the
schema but won't be able to access what's in it.
(this not exactly true, as it depend on the permissions you're gonna GRANT to 
him,
but until you haven't got further, this would be a loss of time)

permanent alteration can be done by postgres user as:
ALTER USER mybeloveduserthatilovesomuch SET search_path TO 
schema1,schema2,schema3...;

This is a very important command as most of the time you suppress any
rights from the public schema (WARNING: there's a 'public' ROLE AND a 'public' 
SCHEMA!!!)
in order to gain the possibility to enable/disable the CONNECT possibility
for any user that must have access to this DB (and also other type of access).

This also gives the user the possibility to retrieve rows from a table that is 
listed
into its search_path.


Things are a tiny bit more complicated, but this should do.

JY
-- 
Q:  How many Democrats does it take to enjoy a good joke?
A:  One more than you can find.

--
Come build with us! The BlackBerryreg; Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9#45;12, 2009. Register now#33;
http://p.sf.net/sfu/devconf
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user