[Geoserver-users] Error while publishing postgis layers that have a name encapsulated with "

Dear all,

I’m facing a strange problem that only happens on Linux. When trying to publish postgis layers which name is encapsulated with " Geoserver gives no error but is not able to publish the layer either. When checking the logs i could find the following:

relation “toponimia.lugares” does not exist
Where: SQL statement “SELECT has_table_privilege((SELECT usesysid FROM pg_user WHERE usename = session_user), ‘toponimia.lugares’, ‘select’)”

I could immediately find the problem. In PostgreSQL the table is named as “lugares” and so, the previous query should be :

SELECT has_table_privilege((SELECT usesysid FROM pg_user WHERE usename = session_user), ‘toponimia.“lugares”’, ‘select’)

The stange thing is that I’m able to publish this layer when having geoserver installed in a windows machine. Is there any configuration i need to do in Linux to achieve the same result or is my only option to rename all tables?

Thanks in advance.
Cheers


Hugo Martins

Hello all,

With further testing, I see that the problem is the browser… This is happening with IE8 and not with Firefox. Problem solved!

Cheers,

Hugo

On Wed, Nov 21, 2012 at 12:33 PM, Hugo <hfpmartins@anonymised.com> wrote:

Dear all,

I’m facing a strange problem that only happens on Linux. When trying to publish postgis layers which name is encapsulated with " Geoserver gives no error but is not able to publish the layer either. When checking the logs i could find the following:

relation “toponimia.lugares” does not exist
Where: SQL statement “SELECT has_table_privilege((SELECT usesysid FROM pg_user WHERE usename = session_user), ‘toponimia.lugares’, ‘select’)”

I could immediately find the problem. In PostgreSQL the table is named as “lugares” and so, the previous query should be :

SELECT has_table_privilege((SELECT usesysid FROM pg_user WHERE usename = session_user), ‘toponimia.“lugares”’, ‘select’)

The stange thing is that I’m able to publish this layer when having geoserver installed in a windows machine. Is there any configuration i need to do in Linux to achieve the same result or is my only option to rename all tables?

Thanks in advance.
Cheers


Hugo Martins


Hugo Martins

Hi,

I noticed that your problem went away, but even if it works now I am not sure if everything is correct. Double quotes around table names should be a hint for a SQL interpreter that you want to use do called delimited identifiers and according to ANSI SQL for example in your case the most correct SQL select should be written as

SELECT ... FROM "toponimia".""lugares""

http://www.postgresql.org/docs/8.2/static/sql-syntax-lexical.html

I would say that you call for troubles by using double quotas in table names, even it is allowed.

-Jukka Rahkonen-

________________________________
Hugo wrote:

Dear all,

I'm facing a strange problem that only happens on Linux. When trying to publish postgis layers which name is encapsulated with " Geoserver gives no error but is not able to publish the layer either. When checking the logs i could find the following:

relation "toponimia.lugares" does not exist

  Where: SQL statement "SELECT has_table_privilege((SELECT usesysid FROM pg_user WHERE usename = session_user), 'toponimia.lugares', 'select')"

I could immediately find the problem. In PostgreSQL the table is named as "lugares" and so, the previous query should be :

SELECT has_table_privilege((SELECT usesysid FROM pg_user WHERE usename = session_user), 'toponimia."lugares"', 'select')

The stange thing is that I'm able to publish this layer when having geoserver installed in a windows machine. Is there any configuration i need to do in Linux to achieve the same result or is my only option to rename all tables?

Thanks in advance.

Cheers

--
Hugo Martins