Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fpH4S-0004rP-Vl for pgsql-general@arkaria.postgresql.org; Mon, 13 Aug 2018 17:56:01 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fpH4Q-0004a1-4u for pgsql-general@arkaria.postgresql.org; Mon, 13 Aug 2018 17:55:58 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fpH4P-0004Zm-Qm for pgsql-general@lists.postgresql.org; Mon, 13 Aug 2018 17:55:57 +0000 Received: from mail-io0-x236.google.com ([2607:f8b0:4001:c06::236]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1fpH4J-0004BB-0T for pgsql-general@postgresql.org; Mon, 13 Aug 2018 17:55:57 +0000 Received: by mail-io0-x236.google.com with SMTP id z20-v6so15671794iol.0 for ; Mon, 13 Aug 2018 10:55:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=pNlPv6jNfHjyDVg3Ox5ZcE6nVkZ8Ge0wxL6OMCIXzFI=; b=Fi69OYb/Xi6sop/au9H+T3t7iz4lPzibizP+0pRgglvaoNsGby6Se8x6vLLERBwie9 vkbgwxZlBn2i49jXTDL5GJE9DTzRlScNAv/qJEdA9YykUeMxOpdA0Cve90UiZoinFBfl 5WyI/JSjIeMZ7h3STpFIoepEDLZYa+m/6HoOdfTRW7aOCM1b0MQVyebADuYBF0a5Mqu3 nxigpj9gW4oBSms1Ifvgju4Ml2RjNgsnIYLgzmMPt5BpgSh1Vxf2m88ix2pNHsAZ933B aE2bQ2OVhFLHvq3U/zsNAHAdhuou4Yf6PPRgW79OAKjhc0CZT5iWQkL9woKpNZmyE1kZ AgPg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=pNlPv6jNfHjyDVg3Ox5ZcE6nVkZ8Ge0wxL6OMCIXzFI=; b=p6ejPND0dDnPTDr/u38dSQ4LYT24pwdLAC6s7Vo9K/yMloTfYzokPCN54lkn1L1M5v 8yMg+FyjCsK+yiNpHnwgj03JMm1Z/0GaeeVI16M693tJLV7O+oYKmy3LXQP/nnp8Qv07 lF7nXURdUAk+R2hw6Wf1u92Q6aXm1FIbUmgXlEgI2wQufQdgVy3QbOlbZnnkk9doaTxE u0YFEvGCgVNKgD4avNiyvGlkhhHJq9VmXRr8iCHiImf+y6MmwhOsXLbvQbDWpxbEajZT 8Uqd45fl176eQVdN7j/IIv1PtaECMobBSgRwcus//iP0AwwzLJwlW4UAXxCsu7eicsus pBsw== X-Gm-Message-State: AOUpUlFjhs3PQgLuSQfavx0d2Kj798gG+Hhw2kS2ePLnlfrK9kiylf7d h84IXF+nghv1+Xz0E2CvDCk01Dod2gm6UiarZewvow== X-Google-Smtp-Source: AA+uWPy6o49PQvInMzZMqpuH/1+RghqHENHfK6BS2z0hr+XM+VN5nx2qapdyOofEScGls893j/swUgaeCrgpMIX/n50= X-Received: by 2002:a6b:7b49:: with SMTP id m9-v6mr15821341iop.36.1534182948899; Mon, 13 Aug 2018 10:55:48 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a4f:4d17:0:0:0:0:0 with HTTP; Mon, 13 Aug 2018 10:55:48 -0700 (PDT) In-Reply-To: <7D710F90-3332-497E-9390-54B1F302961B@swisspug.org> References: <7D710F90-3332-497E-9390-54B1F302961B@swisspug.org> From: mrcasa bengaluru Date: Mon, 13 Aug 2018 23:25:48 +0530 Message-ID: Subject: Re: JSONB filed with default JSON from a file To: Charles Clavadetscher Cc: pgsql-general@postgresql.org Content-Type: multipart/alternative; boundary="000000000000b08dc4057354cd55" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --000000000000b08dc4057354cd55 Content-Type: text/plain; charset="UTF-8" > > I assume that you could declare the column as > > address jsonb not null default 'your json here'::jsonb; > Thanks! However, this involves writing the entire JSON in the schema file looks inconvenient. I was hoping I would be able to reference to an external JSON file which could be used for the default value. --000000000000b08dc4057354cd55 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
I assume that you could declare the column as<= /span>

address jsonb not null default &#= 39;your json here'::jsonb;

= Thanks! However, this involves writing the entire JSON in the schema file l= ooks inconvenient. I was hoping I would be able to reference to an external= JSON file which could be used for the default value.=C2=A0

=
--000000000000b08dc4057354cd55--