Category Archives: Data

Latest tutorials and tips for data such as databases

Linked List Data Structure Code in JavaScript

In the examples below we show how to implement Linked List Data Structure in Javascript class Node { constructor(data, next=null) this.data = data; this.next = next; } } class LinkedList { constructor(data) { this.head = null; } /////////// insertStart(data) { this.head = new Node(data, this.head); } /////////// size() { let cnt = 0; let node […]

Export Import GIS Shape File to Postgres or Postgis

For importing or ingesting GIS shapefile to a postgresql database we can use shp2pgsql  command, example:   shp2pgsql -s 4326 -c -D -I myshapefile dbtable | \ psql -d dbname -h localhost -p 5432 -U dbuser   In example above we convert or import the shapefile  (myshapefile) to dbtable in dbname database with a dbuser. […]

how to backup or dump and restore postgresql database

In this tutorial, we show how to backup or dump and how to restore a postgresql database.   For making a backup you can use pg_dump command like below:   pg_dump -Fc -h localhost mydatabase -U myuser -n myschema > test.pgdump   in the above, change hostname (localhost), database name (mydatabase), user (myuser) and schema […]