Opened 16 years ago
Last modified 16 years ago
#47 closed defect (wontfix)
Avoiding notices upon import of lwpostgis.sql
Reported by: | dane.springmeyer | Owned by: | |
---|---|---|---|
Priority: | medium | Milestone: | |
Component: | postgis | Version: | |
Keywords: | Cc: |
Description
Whenever a user imports lwpostgis.sql into a postgres database the STDOUT in the shell gives a large amount of NOTICE's.
I think it would be desirable to make the necessary changes within the lwpostgis.sql creation to avoid these notices, for two reasons
1) New users may not understand that NOTICES are not errors and be concerned that their installation did not work
2) When actually Warnings or Errors do occur they are usually spit out along with the NOTICES and makes reading through the output and understanding the error more difficult for new users.
Now, perhaps these notices are not only harmless but either necessary or unavoidable.
In this case, I propose adding 'set client_min_messages = 'warning';' to the top of the script to manually suppress the NOTICES.
If this is undesirable for some reason, that's fine, just please close the issue with an explanation of how they are needed.
I see these notices on SVN trunk with Ubuntu 8.04 and Mac 10.5.
Here is the output I get on Ubuntu 8.04 with Postgis SVN HEAD:
psql:/usr/share/lwpostgis.sql:44: NOTICE: type 'histogram2d' is not yet defined DETAIL: Creating a shell type definition. psql:/usr/share/lwpostgis.sql:50: NOTICE: return type histogram2d is only a shell psql:/usr/share/lwpostgis.sql:56: NOTICE: argument type histogram2d is only a shell psql:/usr/share/lwpostgis.sql:62: NOTICE: argument type histogram2d is only a shell psql:/usr/share/lwpostgis.sql:88: NOTICE: type 'spheroid' is not yet defined DETAIL: Creating a shell type definition. psql:/usr/share/lwpostgis.sql:94: NOTICE: return type spheroid is only a shell psql:/usr/share/lwpostgis.sql:100: NOTICE: argument type spheroid is only a shell psql:/usr/share/lwpostgis.sql:106: NOTICE: argument type spheroid is only a shell psql:/usr/share/lwpostgis.sql:131: NOTICE: type 'geometry' is not yet defined DETAIL: Creating a shell type definition. psql:/usr/share/lwpostgis.sql:137: NOTICE: return type geometry is only a shell psql:/usr/share/lwpostgis.sql:143: NOTICE: argument type geometry is only a shell psql:/usr/share/lwpostgis.sql:149: NOTICE: argument type geometry is only a shell psql:/usr/share/lwpostgis.sql:170: NOTICE: return type geometry is only a shell psql:/usr/share/lwpostgis.sql:176: NOTICE: return type geometry is only a shell psql:/usr/share/lwpostgis.sql:182: NOTICE: argument type geometry is only a shell psql:/usr/share/lwpostgis.sql:188: NOTICE: argument type geometry is only a shell psql:/usr/share/lwpostgis.sql:382: NOTICE: type 'box3d' is not yet defined DETAIL: Creating a shell type definition. psql:/usr/share/lwpostgis.sql:388: NOTICE: argument type box3d is only a shell psql:/usr/share/lwpostgis.sql:394: NOTICE: return type box3d is only a shell psql:/usr/share/lwpostgis.sql:400: NOTICE: argument type box3d is only a shell psql:/usr/share/lwpostgis.sql:497: NOTICE: type 'chip' is not yet defined DETAIL: Creating a shell type definition. psql:/usr/share/lwpostgis.sql:503: NOTICE: return type chip is only a shell psql:/usr/share/lwpostgis.sql:509: NOTICE: argument type chip is only a shell psql:/usr/share/lwpostgis.sql:515: NOTICE: argument type chip is only a shell psql:/usr/share/lwpostgis.sql:542: NOTICE: type 'box2d' is not yet defined DETAIL: Creating a shell type definition. psql:/usr/share/lwpostgis.sql:548: NOTICE: return type box2d is only a shell psql:/usr/share/lwpostgis.sql:554: NOTICE: argument type box2d is only a shell psql:/usr/share/lwpostgis.sql:560: NOTICE: argument type box2d is only a shell
Change History (4)
comment:1 by , 16 years ago
comment:2 by , 16 years ago
And a link to a good explanation for the notices after another user is concerned: http://postgis.refractions.net/pipermail/postgis-users/2006-November/013995.html
This leads me to believe that the notices will not be avoided until postgis requires postgres 8.2?
comment:3 by , 16 years ago
Hi Dane,
I can't get too excited about removing notices because... well, they are notices! If they were caused by us doing something unusual with PostgreSQL then I may be slightly more inclined to do something with them, but it's simply PostgreSQL's way of informing you about what it is doing. During normal usage, you see plenty of these in the logs anyway...
Incidentally, you are loading the wrong file into your database - /usr/share/lwpostgis.sql is the location of the PostGIS SQL file for current versions of PostGIS. SVN trunk uses PGXS which correctly places its SQL file under $sharedir/postgresql/contrib.
HTH,
Mark.
An example of a user being 'spooked' by postgis notices: http://archives.postgresql.org/pgsql-bugs/2008- 06/msg00135.php