Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1t8yV7-0071Yu-Lv for pgsql-admin@arkaria.postgresql.org; Thu, 07 Nov 2024 09:08:25 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1t8yV3-00Dn6w-Ck for pgsql-admin@arkaria.postgresql.org; Thu, 07 Nov 2024 09:08:21 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1t8yV3-00Dn6o-1V for pgsql-admin@lists.postgresql.org; Thu, 07 Nov 2024 09:08:21 +0000 Received: from mail-ej1-x631.google.com ([2a00:1450:4864:20::631]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1t8yUz-000eT1-0d for pgsql-admin@postgresql.org; Thu, 07 Nov 2024 09:08:20 +0000 Received: by mail-ej1-x631.google.com with SMTP id a640c23a62f3a-a9e44654ae3so93442166b.1 for ; Thu, 07 Nov 2024 01:08:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1730970497; x=1731575297; darn=postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=ujJriNsJtLzlZE7oe0ijHVrnhPeDTyS1yzkGlMj04UI=; b=DoFPvO6XLOpxX3U7zYoYBWHjsyecZv6vqjtrhC25LGPTLytLkR2qTaCivzIm9Elqhd FM3uQvEPj69k+cIKUOOGBzDTLB+p9HJPGEtvH5f+1DcjSGcvtiHG6VohIdi/aVIJus9Z Bx4SnJGBLKyW6Y7RB6/mYGA2VcANBr0sarq+abt4vkIble4MVNe8cArF7EMP7vZc89PO Xy/YU+uyH2VlI7xO682oP7x0zW5EISzdu7kqkCv9Py5YBTuwd4TKgqi7v9iMA64dhGBR 2Fu+7gr9rlfjUW/XWoOgC8Ex1mzx8+GE1c5LqlZuiQzCSNkW6wAXLnM1onK/M72zBVYL uH5Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730970497; x=1731575297; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=ujJriNsJtLzlZE7oe0ijHVrnhPeDTyS1yzkGlMj04UI=; b=CIkFEjzpzq06+pSH7SW3heXa+d2mxQcgaezt3YZZgT2GBVhfM5xnLXKxvbKeo5XO+r Qerb6PJYrcjB5AOJ8ZczzhOLpEMTfRwh2QzJjvGmadLI2FAQc7YyosQdmnRRUUgTAOHa y0+PK+888yn9N6zqQCGm8qfte5bFhEUmFrTArxP6ysLI6Cyb6167UVDeq/Nnn/bZVGPa QlScCNwAc2k8JDlf0Iqp19gtVto/AH+w1KB9JYSSAAPgg6y7SCB9qck+tsxHb1h+7pO9 NlXyMnEYFmKVz+v2edlXyWAoE5gpI9FRpgh08TF7EBAWKkvMljcYOJM+6wyxIqSwgEix o9Yg== X-Gm-Message-State: AOJu0YxtAGSscrpygN0vFe5rVy6WRIJ7iFrN9xiS8Hy14reyj62ndWNT b3X2+0/QbGcui6R+r8Qsa2UE+DV5Hg299Fhi0WqcGhMCEUjftT93wHnKXQjufdcl6/Rek0fuh0R hQwb3NOGoi7XUt+33qrLY/I56StQ= X-Google-Smtp-Source: AGHT+IFKzELSBycu5Vgigwvklik4CixCkBr0zOqiPhA8b9/eeyXz0OtSrfXlJAoojsz8SidyEi+UNn546cOhw8W4rQE= X-Received: by 2002:a17:907:2cc2:b0:a99:f861:ebd with SMTP id a640c23a62f3a-a9ee74bbbd6mr22563766b.14.1730970496637; Thu, 07 Nov 2024 01:08:16 -0800 (PST) MIME-Version: 1.0 References: <202411061603.rile4w5i3ugo@alvherre.pgsql> In-Reply-To: <202411061603.rile4w5i3ugo@alvherre.pgsql> From: Wasim Devale Date: Thu, 7 Nov 2024 14:38:05 +0530 Message-ID: Subject: Re: Bytea datatype content to view To: Alvaro Herrera Cc: pgsql-admin , Pgsql-admin Content-Type: multipart/alternative; boundary="00000000000091a31a06264ef9c2" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --00000000000091a31a06264ef9c2 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Thanks everyone for your valuable inputs. On Wed, 6 Nov, 2024, 9:33=E2=80=AFpm Alvaro Herrera, wrote: > On 2024-Nov-06, Wasim Devale wrote: > > > Hi All > > > > I have a table having bytea datatype. Anyone has worked on it how we ca= n > > see the content as the files are in .csv, .pdf, .bin and .docx format. > > In a pinch, you could turn the bytea column into an LO using the > lo_from_bytea() function and use psql's \lo_export. Quick and easy, no > need to write any code. > > -- > =C3=81lvaro Herrera Breisgau, Deutschland =E2=80=94 > https://www.EnterpriseDB.com/ > --00000000000091a31a06264ef9c2 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

Thanks everyone for your valuable inputs.


On Wed= , 6 Nov, 2024, 9:33=E2=80=AFpm Alvaro Herrera, <alvherre@alvh.no-ip.org> wrote:
On 2024-Nov-06, Wasim Devale wrote:

> Hi All
>
> I have a table having bytea datatype. Anyone has worked on it how we c= an
> see the content as the files are in .csv, .pdf, .bin and .docx format.=

In a pinch, you could turn the bytea column into an LO using the
lo_from_bytea() function and use psql's \lo_export.=C2=A0 Quick and eas= y, no
need to write any code.

--
=C3=81lvaro Herrera=C2=A0 =C2=A0 =C2=A0 =C2=A0 Breisgau, Deutschland=C2=A0 = =E2=80=94=C2=A0 https://www.EnterpriseDB.com/
--00000000000091a31a06264ef9c2--