Skip to content

Instantly share code, notes, and snippets.

@diaraujo13
diaraujo13 / json
Created April 25, 2018 02:49
GLPI API - Basic calls to tickets endpoint
{
"variables": [],
"info": {
"name": "GLPI API",
"_postman_id": "93d36159-3fa9-bed0-ff15-ad4cc5cc6abb",
"description": "",
"schema": "https://schema.getpostman.com/json/collection/v2.0.0/collection.json"
},
"item": [
{
@ststeiger
ststeiger / Foreign_key_dependencies_PGSQL.sql
Last active January 4, 2025 19:59
List tables by foreign-key dependencies PostgreSQL (also works on MS-SQL with minor modifications)
DROP TABLE IF EXISTS CTE_AllTables;
-- CREATE TEMPORARY TABLE IF NOT EXISTS CTE_AllTables
CREATE TEMPORARY TABLE CTE_AllTables AS
SELECT
ist.table_schema AS OnTableSchema
,ist.table_name AS OnTableName
,tForeignKeyInformation.FkNullable
-- WARNING: TableSchema or Tablename can contain entry-separator (';' used)
,CAST(DENSE_RANK() OVER (ORDER BY ist.table_schema, ist.table_name) AS varchar(20)) AS OnTableId