[postgis-users] Raster Table Name With Upper-Case Characters

Osahon Oduware osahon.gis at gmail.com
Fri Jul 14 03:44:26 PDT 2017


Hi Hugues,

Thanks for your suggestion. I would attempt this on a small raster and give
you feedback. However, in practice I am working with a large raster, hence,
I am piping the output of the raster2pgsql command with the connection to
the database as below:
raster2pgsql -s <SRID> -d -Y -e -I -C -F -M /path/to/raster/file
<RASTER_TABLE> | psql -h localhost -U postgres -p 5432 -d <database>


On Fri, Jul 14, 2017 at 8:51 AM, Hugues François <hugues.francois at irstea.fr>
wrote:

> Hi,
>
> I did some test using shp2pgsql because I didn't have available raster
> data on the computer I use from my holidays place.
>
> It seems that it changes upper to lower case and already uses double
> quotes. Maybe, you coud try to proceed in several steps: first saving the
> output file of raster2pgsql, then uses sed to change its content with the
> correct syntax and finally uses psql command to execute le sql command file.
>
> Regards,
>
> Hug
>
>
>
> ------------------------------
> *De: *"Osahon Oduware" <osahon.gis at gmail.com>
> *À: *"PostGIS Users Discussion" <postgis-users at lists.osgeo.org>
> *Envoyé: *Jeudi 13 Juillet 2017 14:41:27
> *Objet: *Re: [postgis-users] Raster Table Name With Upper-Case Characters
>
> Hi Hugues,
>
> Using the backslash to escape the quotes as you suggested produces a
> syntax error.
>
> On Thu, Jul 13, 2017 at 12:36 PM, Osahon Oduware <osahon.gis at gmail.com>
> wrote:
>
>> Hi Hugues,
>>
>> I would try this out and give you feedback. Thanks.
>>
>> On Thu, Jul 13, 2017 at 12:32 PM, Hugues François <
>> hugues.francois at irstea.fr> wrote:
>>
>>> Yes, that's what I mean. I didn't try it but I think you need to tell
>>> raster2pgsql that double quotes are part of the string and not a simple
>>> text delimiter.
>>>
>>> It could look like something like this:
>>> raster2pgsql raster_options_go_here raster_file someschema.\"sometable\"
>>>
>>> Hug
>>>
>>> Le 13 juil. 2017 1:13 PM, Osahon Oduware <osahon.gis at gmail.com> a
>>> écrit :
>>>
>>> Hi Hugues,
>>>
>>> Thanks for your response. Do you mean escape with a backslash as is done
>>> with most programming languages? Please, provide an example.
>>>
>>> On Thu, Jul 13, 2017 at 11:27 AM, Hugues François <
>>> hugues.francois at irstea.fr> wrote:
>>>
>>> Hi,
>>>
>>> Did you try to escape double quotes in the raster2pgsql command line ?
>>>
>>> Regards,
>>> Hug
>>>
>>>
>>> Le 13 juil. 2017 12:21 PM, Osahon Oduware <osahon.gis at gmail.com> a
>>> écrit :
>>>
>>> Hi All,
>>>
>>> *I wanted to know if there is a way to specify a raster table name with
>>> Upper-Case characters using the raster2pgsql tool*. I have tried
>>> enclosing the table name in double-quotes, but the raster2pgsql tool seems
>>> to convert it to Lower-Case characters.
>>>
>>> Knowing how to do this would save me from the current challenge of
>>> renaming the raster table after they have been created (see the link below):
>>> Renaming Raster Table
>>> <https://groups.google.com/forum/#!searchin/postgis-users/Renaming$20Raster$20Table%7Csort:relevance/postgis-users/MKI7pvko6q0/Oqfqw9nUBAAJ>
>>>
>>> I would be glad if someone could help me with this.
>>>
>>>
>>>
>>> _______________________________________________
>>> postgis-users mailing list
>>> postgis-users at lists.osgeo.org
>>> https://lists.osgeo.org/mailman/listinfo/postgis-users
>>>
>>>
>>>
>>>
>>> _______________________________________________
>>> postgis-users mailing list
>>> postgis-users at lists.osgeo.org
>>> https://lists.osgeo.org/mailman/listinfo/postgis-users
>>>
>>
>>
>
> _______________________________________________
> postgis-users mailing list
> postgis-users at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/postgis-users
>
>
> _______________________________________________
> postgis-users mailing list
> postgis-users at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/postgis-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20170714/623c0e48/attachment.html>


More information about the postgis-users mailing list