Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1m3sjQ-00030o-8H for pgsql-general@arkaria.postgresql.org; Thu, 15 Jul 2021 04:12:16 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1m3sjP-0007iV-5i for pgsql-general@arkaria.postgresql.org; Thu, 15 Jul 2021 04:12:15 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1m3sjO-0007iG-Sh for pgsql-general@lists.postgresql.org; Thu, 15 Jul 2021 04:12:14 +0000 Received: from mail-ed1-x52f.google.com ([2a00:1450:4864:20::52f]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1m3sjM-0003fn-Qr for pgsql-general@lists.postgresql.org; Thu, 15 Jul 2021 04:12:13 +0000 Received: by mail-ed1-x52f.google.com with SMTP id dj21so6240334edb.0 for ; Wed, 14 Jul 2021 21:12:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=PijOESqQfcno4EjbWsyHOYj3ftfbRsvCNDnIgeXhw+o=; b=PxFe8hh0Egav82cfg9pMxgeryaGlCXxcH5UshbsQ2/GrhLy1vTnGVI2BJvejEA0hj5 INiuKV/eweSr7nkdTdath6d+oEhhENn6knK9RwcNksI+p53J2Rac2wHpVJFsIe7k7jSr vGvhm9QMDcStI7T2CTXTCywVAHVbbBAKoyNuitwRqGE0+KeRzSFhpuXe/HI1b8IdBwc0 kTKbGHl80E5NXg240P7cojGm37G95mr5TM3yhgep1kXlCLIfPK9kV4MuQCqvjLKkGTgK pmfdQO+I+dM1dqNvICV5wX4FfQNT7UxzHXIf5lqAPgWGWGhbKPbC74N7fmCT1e5Z/n/s TH5A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=PijOESqQfcno4EjbWsyHOYj3ftfbRsvCNDnIgeXhw+o=; b=HrPQMrpU9VvEeKORC3OwUtCfrJYrxgjlhZfEIXJx3keLxCxfYn4wYIbz0qYMOJKLKV VjXdQ56yNhk/1mK9FVXufDKSj/wD8pb1qaw7TnHGsKBqZ0ARubW9UyiRYncpJ474ya+v PdJhhdUCtlYOkV4n/Sxfp/lerlMyje2T9RiHTrO8JLLJZwlyvL5XPlgrrvPyX5o0GMgb SOoOr6ODrohId0OOKNkVC1VvNBUtwpMSz5cHi60NM9pV2jz3RVIeOrOoJrGIm5WtqgXq YubFyjU9cLgdp6hntt1JqhH14SH7IUii1gzdmjVXcyrf6NDv1VInEtzBxkUmcX1SqBaD qoTQ== X-Gm-Message-State: AOAM5327rBk4EedFssTRE5y8C9XzlgoX2qf4UMexbx2MR99XInXcJx10 LkNST5vICsYtXGb+cmExOR1DUe4fS1Y= X-Google-Smtp-Source: ABdhPJyvt2X2lPn6LaSfdDp6HPfAbKu8HkR2XyNomskwzPW7Ig8IEVsvq6ctVaJ25iXjoVoQV8dgFQ== X-Received: by 2002:aa7:d48f:: with SMTP id b15mr3393130edr.271.1626322331112; Wed, 14 Jul 2021 21:12:11 -0700 (PDT) Received: from [95.85.160.189] ([95.85.160.189]) by smtp.gmail.com with ESMTPSA id p20sm1351009ejy.95.2021.07.14.21.12.09 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 14 Jul 2021 21:12:10 -0700 (PDT) Subject: Re: How to display stored image as bytea or as large objects? To: Ho John Lee Cc: PostgreSQL General References: From: Csanyi Pal Message-ID: Date: Thu, 15 Jul 2021 06:12:09 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: hu-HU Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk 2021. 07. 14. 22:17 keltezéssel, Ho John Lee írta: > If you have the binary data for the image in the bytea field, DBeaver > will display the image when you select that field in table view of the data. > The field will display something like "ÿØÿà  JFIF   [nnnnn]" in the row > (first part of data as unicode, and data length in bytes), you won't see > the image unless you put focus on it. I will try this, but do not know which SQL code will store an image in a bytea data type column? Could you give such SQL code please? At the moment I have stored image in an oid data type column. > .--hjl > On Wed, Jul 14, 2021 at 12:57 PM Csanyi Pal > wrote: > > Hi, > > I am a novice in postgresql language. > > By reading the documentation about storing binary data in postgresql > database, I realize that that one can store images as binary data by > using bytea or BLOB data types. > > I am running postgresql on Ubuntu 20.04.2 LTS and using pgAdmin4 in > Desktop mode. > > I have stored an image in one of my table with this command: > > > insert into leckek > (az, a_tanitas_nyelve, mely_negyedevben, mely_osztalyban, > mely_tagozaton, mely_orakon, a_tanitas_temaja, >   a_lecke_neve, a_lecke_gyakorlati_reszenek_neve, > a_lecke_gyakorlati_reszenek_dokumentuma, >   a_lecke_elmeleti_reszenek_neve, > a_lecke_elmeleti_reszenek_dokumentuma, > a_lecke_elmeleti_reszenek_tesztje) > values (default, 'Hu', 1, 5, 'b', '1-2', 'Élet és mukakörnyezet', >                 'A technika és technológia fogalma, szerepe és > jelentősége', >                 'másolás', >                 default, >                 'A lényeg', > > lo_import('/home/pali/Irataim/Iskola/IskolaEv_2020_2021/MuszakiOraim/Digitalis_Tananyagok_Orakra/Hu/5/5_osztaly_Tananyag_01_02_orara.png'), >                 default) > > > so I have now in this table the first row: > 1       "Hu"    1       5       "b"     "1-2  " "Élet és > mukakörnyezet" "A technika és > technológia fogalma, szerepe és jelentősége"    "másolás" >    "A lényeg"      "16800" > > Here the 16800 is the OID of the binary data, the image. > > I would like to know how can one display this stored image somehow by > using some IDE for manage databases? > > In applications like pgAdmin4, Libreoffice Base, pgModeler, DBeaver one > can't display this stored image. > > In SQLiteBrowser (this is an IDE for SQLite databases) one can display > with easy the stored image. > > So is there an easy way to display a stored image in postgresql? > > -- > Best, > from Paul