<div dir="ltr">Thanks Paul! It all lives in a shell script so it's not a big deal to reset the ownership & permissions. But I didn't want to miss out on any fdw goodness if there was a more elegant way of doing it. I hate looking at my old scripts and saying "geez, I didn't know very much back then!"</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Jul 13, 2021 at 3:31 PM Paul Ramsey <<a href="mailto:pramsey@cleverelephant.ca">pramsey@cleverelephant.ca</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">ogr must be removing and re-writing the files, so you're getting the ownership of the writing process, which is the postgres daemon. No way to change that (except running your daemon under the ownership you want!! (don't)). A cron job may have to suffice.<br>
<br>
P<br>
<br>
> On Jul 13, 2021, at 2:26 PM, Richard Greenwood <<a href="mailto:richard.greenwood@gmail.com" target="_blank">richard.greenwood@gmail.com</a>> wrote:<br>
> <br>
> I'm using ogr_fdw to delete and insert rows in shapefiles from postgis tables. The operations change the ownership and permissions of the files. Is it possible to control ownership and permissions with ogr_fdw or do I need to do that outside of psql. For example, before my sql operations on the ogr_fdw tables they look like:<br>
> -rw-rw---- 1 rich postgres 465K Jul 13 15:08 GUERNSEY_PARCELS.dbf<br>
> -rw-rw---- 1 rich postgresĀ  96K Jul 13 15:08 GUERNSEY_PARCELS.shp<br>
> -rw-rw---- 1 rich postgres 5.2K Jul 13 15:08 GUERNSEY_PARCELS.shx<br>
> and after:<br>
> -rw------- 1 postgres postgres 465K Jul 13 15:18 GUERNSEY_PARCELS.dbf<br>
> -rw------- 1 postgres postgresĀ  96K Jul 13 15:18 GUERNSEY_PARCELS.shp<br>
> -rw------- 1 postgres postgres 5.2K Jul 13 15:18 GUERNSEY_PARCELS.shx<br>
> I'd like the ownership & permissions to not change.<br>
> <br>
> Thanks,<br>
> Rich<br>
> -- <br>
> Richard W. Greenwood, PLS<br>
> <a href="http://www.greenwoodmap.com" rel="noreferrer" target="_blank">www.greenwoodmap.com</a><br>
> _______________________________________________<br>
> postgis-users mailing list<br>
> <a href="mailto:postgis-users@lists.osgeo.org" target="_blank">postgis-users@lists.osgeo.org</a><br>
> <a href="https://lists.osgeo.org/mailman/listinfo/postgis-users" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/postgis-users</a><br>
<br>
_______________________________________________<br>
postgis-users mailing list<br>
<a href="mailto:postgis-users@lists.osgeo.org" target="_blank">postgis-users@lists.osgeo.org</a><br>
<a href="https://lists.osgeo.org/mailman/listinfo/postgis-users" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/postgis-users</a><br>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr">Richard W. Greenwood, PLS<br><a href="http://www.greenwoodmap.com" target="_blank">www.greenwoodmap.com</a></div></div>