Last active
April 22, 2016 23:03
-
-
Save pramsey/35fedc493b4bb8e45a2faa532c7cdc6e to your computer and use it in GitHub Desktop.
Updateable OGR FDW
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Butterfly:~/Code/pgsql-ogr-fdw pramsey(readwrite)$ cat data/pt_two.dbf | |
Peter 45 5.6019650412 Paul 33 5.8419710325 | |
Butterfly:~/Code/pgsql-ogr-fdw pramsey(readwrite)$ psql fdw | |
psql (9.5.1) | |
Type "help" for help. | |
fdw=# select * from pt_1 ; | |
fid | geom | name | age | height | birthdate | |
-----+--------------------------------------------+-------+-----+--------+------------ | |
0 | 0101000000C00497D1162CB93F8CBAEF08A080E63F | Peter | 45 | 5.6 | 1965-04-12 | |
1 | 010100000054E943ACD697E2BFC0895EE54A46CF3F | Paul | 33 | 5.84 | 1971-03-25 | |
(2 rows) | |
fdw=# update pt_1 set name = 'PAT' where fid = 1; | |
NOTICE: ogrAddForeignUpdateTargets | |
NOTICE: ogrIsForeignRelUpdatable | |
NOTICE: ogrBeginForeignModify | |
NOTICE: ogrExecForeignUpdate | |
NOTICE: ogrEndForeignModify | |
UPDATE 1 | |
fdw=# select * from pt_1 ; | |
fid | geom | name | age | height | birthdate | |
-----+--------------------------------------------+-------+-----+--------+------------ | |
0 | 0101000000C00497D1162CB93F8CBAEF08A080E63F | Peter | 45 | 5.6 | 1965-04-12 | |
1 | 010100000054E943ACD697E2BFC0895EE54A46CF3F | PAT | 33 | 5.84 | 1971-03-25 | |
(2 rows) | |
fdw=# \q | |
Butterfly:~/Code/pgsql-ogr-fdw pramsey(readwrite)$ cat data/pt_two.dbf | |
Peter 45 5.6019650412 PAT 33 5.8419710325 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Unfortunately handling deletion means going back and revisiting this whole book of work from first principles again. More to learn about PgSQL FDW still...