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 1g3Vn0-000460-72 for pgsql-general@arkaria.postgresql.org; Sat, 22 Sep 2018 00:28:50 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1g3Vmw-00021u-Jh for pgsql-general@arkaria.postgresql.org; Sat, 22 Sep 2018 00:28:46 +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 1g3Vmw-00021m-9V for pgsql-general@lists.postgresql.org; Sat, 22 Sep 2018 00:28:46 +0000 Received: from mail-pl1-x633.google.com ([2607:f8b0:4864:20::633]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1g3Vms-0006mw-TT for pgsql-general@postgresql.org; Sat, 22 Sep 2018 00:28:45 +0000 Received: by mail-pl1-x633.google.com with SMTP id 38-v6so6629830plc.10 for ; Fri, 21 Sep 2018 17:28:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=to:from:subject:message-id:date:user-agent:mime-version :content-language; bh=7uX6r0Mgacg8fVh7VcB/vuLlrUm72evB1fWc6d3D6BA=; b=DT+JYqYlKv1nsD3FlQdJHNkOGIEKJmUIKc2tGxR1yRS9zpLndkonayYKtphj98cC7u o5YJwFsxbMjfFJx4YRfzTXXPXOAmuglSXgaR6Jd66w8AbHPHkFJl0fasWNpPcwKVCdee LTHPsWuQLcSKhbK7v+ckt7A0uCfKHUP04d71NaRhFO7Mkml8v6N6kynYmiZ2yaVP5T9y 3BrlqTr/2Ov0dcPEHGpLSwQJcc1UhRrQxDuf7sO4KCmQBgtkOcsmNEKW4xy6lt6cZjtr MWV2TO1GS8E7gs/BqiLaHS6LscV74WSODMhy9YGFmt2oTQWDHq2qYLh7Mk/cD+pUb3jX zEdQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:from:subject:message-id:date:user-agent :mime-version:content-language; bh=7uX6r0Mgacg8fVh7VcB/vuLlrUm72evB1fWc6d3D6BA=; b=PmxMizUqjck4vNB8DRUx6Vk4HHeksdui+c4YTR48ybY+uXmVxbNUTt8RLRn23sXLKi /dapYToyWJscf1nvAWRFBbXFeUKN1sAE8MZGChfQ59DuzJzpfjF+O6dxe+b1lXR/qKyj v1/Skjk0wKkHijksmc6369tS6A5jC2WIv3Qv6CgZFVV0ULB23BhUYAZS5qntcX13mU98 zUaBMVp4OEcHdxg+A7xshyUOvOANmgGpmr8ZzwRR2IG+taopaBKd7QujWB0FW97MW+v1 cm7sH4Urhzq1IX4f2H8/jKVnPXikNiVfl5HFGTNrAcLyMYl9MHEMeSdEWunG6ySaOpvn dFpA== X-Gm-Message-State: ABuFfoj7XoHgaFdOxEGhLA2R6BOh3xDe3iR+YrBuch8SYj/iZh6Linm6 kMwxxCO5bI70e8WhI4Y2X79rgk3a X-Google-Smtp-Source: ACcGV63Az22zsjsVgR1dJbhKQZIUKS/5fK1PPYPG7R/nXG6iTVl+KYvvNf+UQA+yV/EeCF4CYF7+1w== X-Received: by 2002:a17:902:d703:: with SMTP id w3-v6mr140919ply.132.1537576119450; Fri, 21 Sep 2018 17:28:39 -0700 (PDT) Received: from [10.104.134.14] ([155.100.47.6]) by smtp.gmail.com with ESMTPSA id e207-v6sm216553pfh.16.2018.09.21.17.28.38 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 21 Sep 2018 17:28:38 -0700 (PDT) To: "pgsql-general@postgresql.org" From: Rob Sargent Subject: heads up on large text fields. Message-ID: Date: Fri, 21 Sep 2018 18:28:37 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="------------5E48FB4D00599E3CE557BC3F" Content-Language: en-US List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk This is a multi-part message in MIME format. --------------5E48FB4D00599E3CE557BC3F Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Playing around with files-in-text-field.  I can happily slam a 10M file into a text field in a table defined as gtdb=# \d gt.ld                     Table "gt.ld"     Column    | Type | Collation | Nullable | Default --------------+------+-----------+----------+---------  id           | uuid |           | not null |  name         | text |           |          |  markerset_id | uuid |           | not null |  ld           | text |           |          | Indexes:     "ld_pkey" PRIMARY KEY, btree (id) Foreign-key constraints:     "ld_markerset_id_fkey" FOREIGN KEY (markerset_id) REFERENCES base.markerset(id) gtdb=# select id, length(ld), substring(ld,  300000, 100) from gt.ld;                   id                  | length  | substring --------------------------------------+---------+------------------------------  28f8dc94-c9d1-4c45-b504-fda585b497f8 | 6742760 |                             +                                       |         | 3 2 rs1858447|5852230|10+                                       |         |  0.500000 0.500000         +                                       |         | 3 2 rs1567706|5853767|10+                                       |         |  0.500000 0.500000 (1 row) And I can regenerate the file using java (with jOOQ) in respectable time. However, I get into deep dodo when I try redirecting psql output such as select ld from gt.ld\g /tmp/regen.file "/tmp/regen.file" gets very large, very fast and I have to pg_terminate_backend.  Tried this three times, once using "\o test.blob" instead. h009357:loader$ ls -ltr total 2048 -rwxr-xr-x 1 u0138544 camplab 10002460672 Sep 21 15:49 test.blob Frankly, I'm suspicious of that ls (it's an smb mount of 25T partition) but that's what's in the emacs shell buffer! The re-direct isn't a must-have, but was hoping that would be an easy way to get a file back. Have I simply gone too far with text type? h009357:share$ psql --version psql (PostgreSQL) 10.5 (Ubuntu 10.5-0ubuntu0.18.04) postgres=# select version(); version ---------------------------------------------------------------------------------------------------------  PostgreSQL 10.5 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-28), 64-bit (1 row) --------------5E48FB4D00599E3CE557BC3F Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 8bit

Playing around with files-in-text-field.  I can happily slam a 10M file into a text field in a table defined as

gtdb=# \d gt.ld
                    Table "gt.ld"
    Column    | Type | Collation | Nullable | Default
--------------+------+-----------+----------+---------
 id           | uuid |           | not null |
 name         | text |           |          |
 markerset_id | uuid |           | not null |
 ld           | text |           |          |
Indexes:
    "ld_pkey" PRIMARY KEY, btree (id)
Foreign-key constraints:
    "ld_markerset_id_fkey" FOREIGN KEY (markerset_id) REFERENCES base.markerset(id)

gtdb=# select id, length(ld), substring(ld,  300000, 100) from gt.ld;
                  id                  | length  |          substring          
--------------------------------------+---------+------------------------------
 28f8dc94-c9d1-4c45-b504-fda585b497f8 | 6742760 |                             +
                                      |         | 3 2     rs1858447|5852230|10+
                                      |         |  0.500000  0.500000         +
                                      |         | 3 2     rs1567706|5853767|10+
                                      |         |  0.500000  0.500000
(1 row)

And I can regenerate the file using java (with jOOQ) in respectable time.

However, I get into deep dodo when I try redirecting psql output such as
select ld from gt.ld\g /tmp/regen.file
"/tmp/regen.file" gets very large, very fast and I have to pg_terminate_backend.  Tried this three times, once using "\o test.blob" instead.
h009357:loader$ ls -ltr
total 2048
-rwxr-xr-x 1 u0138544 camplab 10002460672 Sep 21 15:49 test.blob
Frankly, I'm suspicious of that ls (it's an smb mount of 25T partition) but that's what's in the emacs shell buffer!
The re-direct isn't a must-have, but was hoping that would be an easy way to get a file back.

Have I simply gone too far with text type?

h009357:share$ psql --version
psql (PostgreSQL) 10.5 (Ubuntu 10.5-0ubuntu0.18.04)

postgres=# select version();
                                                 version                                                
---------------------------------------------------------------------------------------------------------
 PostgreSQL 10.5 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-28), 64-bit
(1 row)


--------------5E48FB4D00599E3CE557BC3F--