Thread: : can only make queries to one table

: can only make queries to one table

From
Carlos Ojea Castro
Date:
Hello:

I am connecting to a database from kylix3.
Today I made changes to a table called 'pc104', and now I cannot make 
queries to table 'pc104'.I cannot make queries another table called 'sensores' (that is strange) but I can make queries
toanother table called 'pm500'.
 

Anyone knows what is happening?
Thank you,
Carlos




: query using kylix (delphi)

From
Carlos Ojea Castro
Date:
Hello:

I am trying to access a postgresql database using kylix (delhi).
I made a SQLConnection object and I got it active.
Then I made a SQLQuery object, but when I try to make it active, i get a 
'access violation' message.

Am I missing something?

Regards,
Carlos





Re: : query using kylix (delphi)

From
Darko Prenosil
Date:
On Tuesday 29 June 2004 13:03, Carlos Ojea Castro wrote:
> Hello:
>
> I am trying to access a postgresql database using kylix (delhi).
> I made a SQLConnection object and I got it active.
> Then I made a SQLQuery object, but when I try to make it active, i get a
> 'access violation' message.
>
This is not right list to ask questions about Kylix, however 
you probably have no access permissions to get the data (SELECT permission on 
targer table).Check the permissions for the table you are accessing.
For example if You want to check SELECT permission for pg_catalog.pg_index
table, You can do that using:SELECT has_table_privilege('pg_catalog.pg_index', 'SELECT') 
or INSERT permission:SELECT has_table_privilege('pg_catalog.pg_index', 'INSERT') 
etc...

If you have no privileges You can change it using :GRANT SELECT ON TABLE pg_catalog.pg_index TO public;GRANT INSERT ON
TABLEpg_catalog.pg_index TO public;
 
or:GRANT INSERT ON TABLE pg_catalog.pg_index TO some_other_group;
or:GRANT INSERT ON TABLE pg_catalog.pg_index TO some_other_user;
etc...

You might also want to check server log for exact error message and 
explanation.

Regards !



Re: : query using kylix (delphi)

From
"Jeroen T. Vermeulen"
Date:
On Tue, Jun 29, 2004 at 03:09:47PM +0200, Darko Prenosil wrote:
> On Tuesday 29 June 2004 13:03, Carlos Ojea Castro wrote:

> > I am trying to access a postgresql database using kylix (delhi).
> > I made a SQLConnection object and I got it active.
> > Then I made a SQLQuery object, but when I try to make it active, i get a
> > 'access violation' message.
>     This is not right list to ask questions about Kylix, however 
> you probably have no access permissions to get the data (SELECT permission on 
> targer table).

This may be a stupid question, but better safe than sorry: is the
message really a database-level access violation?  Or is it an access
violation in the sense of the process touching an invalid address?  It's
called a Segmentation Fault in the Unix world [Unix is not a trademark of
The SCO Group Inc. etc. etc. etc.] but IIRC Windows likes to call it an
Access Violation.

Jeroen



Re: : query using kylix (delphi)

From
Carlos Ojea Castro
Date:
Jeroen T. Vermeulen wrote:

>On Tue, Jun 29, 2004 at 03:09:47PM +0200, Darko Prenosil wrote:
>  
>
>>On Tuesday 29 June 2004 13:03, Carlos Ojea Castro wrote:
>>    
>>
>
>  
>
>>>I am trying to access a postgresql database using kylix (delhi).
>>>I made a SQLConnection object and I got it active.
>>>Then I made a SQLQuery object, but when I try to make it active, i get a
>>>'access violation' message.
>>>      
>>>
> 
>  
>
>>    This is not right list to ask questions about Kylix, however 
>>you probably have no access permissions to get the data (SELECT permission on 
>>targer table).
>>    
>>
>
>This may be a stupid question, but better safe than sorry: is the
>message really a database-level access violation?  Or is it an access
>violation in the sense of the process touching an invalid address?  It's
>called a Segmentation Fault in the Unix world [Unix is not a trademark of
>The SCO Group Inc. etc. etc. etc.] but IIRC Windows likes to call it an
>Access Violation.
>

I am not sure. Where could I take a look at postgresql server log?

Thanks,
Carlos







Re: : query using kylix (delphi)

From
"Jeroen T. Vermeulen"
Date:
On Tue, Jun 29, 2004 at 05:30:38PM +0200, Carlos Ojea Castro wrote:
> I am not sure. Where could I take a look at postgresql server log?

Easiest way to find out may be to run your code in the debugger.  That
should halt execution at the point of failure if it's a memory protection
violation.

I have no idea where your log would be if you're using Windows, sorry!


Jeroen



Re: : query using kylix (delphi)

From
"Darko Prenosil"
Date:
If You are using windows port of PostgreSQL server, log should be in event
viewer I think. If it is linux or derivate, it should be in
your postgresql data directory or in /var/log. It is usually called
serverlog or postgresql.
However if the program continues execution after reporting error , and do
not crash - it is probably not a segmentation fault, but server access
violation.

Regards !


----- Original Message ----- 
From: "Jeroen T. Vermeulen" <jtv@xs4all.nl>
To: "Carlos Ojea Castro" <carlosojea@leveltelecom.es>
Cc: <pgsql-interfaces@postgresql.org>
Sent: Tuesday, June 29, 2004 7:07 PM
Subject: Re: [INTERFACES]: query using kylix (delphi)


> On Tue, Jun 29, 2004 at 05:30:38PM +0200, Carlos Ojea Castro wrote:
>  
> > I am not sure. Where could I take a look at postgresql server log?
> 
> Easiest way to find out may be to run your code in the debugger.  That
> should halt execution at the point of failure if it's a memory protection
> violation.
> 
> I have no idea where your log would be if you're using Windows, sorry!
> 
> 
> Jeroen
> 
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org
> 



Re: : query using kylix (delphi)

From
Carlos Ojea Castro
Date:
Jeroen T. Vermeulen wrote:

>On Tue, Jun 29, 2004 at 05:30:38PM +0200, Carlos Ojea Castro wrote:
> 
>  
>
>>I am not sure. Where could I take a look at postgresql server log?
>>    
>>
>
>Easiest way to find out may be to run your code in the debugger.  That
>should halt execution at the point of failure if it's a memory protection
>violation.
>
>I have no idea where your log would be if you're using Windows, sorry!
>
>  
>
I am using LINUX ! (debian woody)




Re: : query using kylix (delphi)

From
"Jeroen T. Vermeulen"
Date:
On Wed, Jun 30, 2004 at 09:13:33AM +0200, Carlos Ojea Castro wrote:

> >Easiest way to find out may be to run your code in the debugger.  That
> >should halt execution at the point of failure if it's a memory protection
> >violation.
> >
> >I have no idea where your log would be if you're using Windows, sorry!
> >
> I am using LINUX ! (debian woody)

Good...  Have you tried running your program in a debugger yet?  It ought
to tell you whether this is a client-side crash or a server-side error
message.  Another thing you could try is to execute your queries manually
from psql, the command-line query interface.


Jeroen



Re: : query using kylix (delphi)

From
"Carlos Ojea"
Date:

Finally I found I had /usr/local/pgsql/lib/libpq.so as a simbolic link
to libpq.so.3.1
My query works if I remove that simbolic link and create it again as a
simbolic link to libpq.so.2.2 !!



O> -----Mensaje original-----
O> De: Jeroen T. Vermeulen [mailto:jtv@xs4all.nl] 
O> Enviado el: jueves, 01 de julio de 2004 16:12
O> Para: Carlos Ojea Castro
O> CC: pgsql-interfaces@postgresql.org
O> Asunto: Re: [INTERFACES]: query using kylix (delphi)
O> 
O> 
O> On Wed, Jun 30, 2004 at 09:13:33AM +0200, Carlos Ojea Castro wrote:
O> 
O> > >Easiest way to find out may be to run your code in the debugger.  
O> > >That should halt execution at the point of failure if 
O> it's a memory 
O> > >protection violation.
O> > >
O> > >I have no idea where your log would be if you're using Windows, 
O> > >sorry!
O> > >
O> > I am using LINUX ! (debian woody)
O> 
O> Good...  Have you tried running your program in a debugger 
O> yet?  It ought to tell you whether this is a client-side 
O> crash or a server-side error message.  Another thing you 
O> could try is to execute your queries manually from psql, the 
O> command-line query interface.
O> 
O> 
O> Jeroen
O>