Questions tagged [bytea]

Variable-length binary string type in PostgreSQL

189 questions
0
votes
0 answers

Image address displayed instead of image

I have a php script that goes like:- where $db is my postgresql database. I'm using…
user11067275
  • 99
  • 3
  • 8
0
votes
1 answer

How to convert bytea to joda.time.DateTime or to Timestamp?

In my database I have a column of type bytea. I want to retrive that value and convert to date time. This is how my value look…
Buda Sergiu Flavius
  • 210
  • 1
  • 3
  • 13
0
votes
2 answers

PostgreSQL - Converting Binary data to Varchar

We are working towards migration of databases from MSSQL to PostgreSQL database. During this process we came across a situation where a table contains password field which is of NVARCHAR type and this field value got converted from VARBINARY type…
Kamal
  • 453
  • 1
  • 10
  • 22
0
votes
0 answers

JPA entity byte[] mapped to bytea PostgreSQL always null

I am having a java class with one of its attribute: private byte[] file; When I upload a image it stores itself in my PostgreSQL database as bytea data (and other attributes stores themselves successfully as well). When I retrieve my entity from…
eXPRESS
  • 425
  • 2
  • 4
  • 19
0
votes
0 answers

How do I get the exact text of a postgresql bytea field with Laravel PHP?

I have a PostgreSQL bytea field. Using this query in pgAdmin, i get this result: Query: SELECT bytea_column::text FROM users where email = 'xxxx@gmail.com'; Result (text): \014\321\031\353\354\005\263\.... If I try to get the value using this…
Hector
  • 139
  • 3
0
votes
0 answers

How to convert JSON into HTML image and store it as a byte array?

I have a sample JSON: { "userUuid": "ea02b5b7-2a5d-40b6-8edf-fa2ae1e204dc", "userJson": { "generalUser": { "country": "United States", "customer": "Test", "state": "", "Id": "a1", …
sjain
  • 23,126
  • 28
  • 107
  • 185
0
votes
1 answer

The essential conversion required in node.js for sending image type file to postgresql

I want to send multipart/form-data from client via nodejs server to postgresql In nodejs I am using express-form-data module. server code: var formData = require("express-form-data"); var…
Biboswan
  • 1,145
  • 12
  • 15
0
votes
1 answer

Inserting image into bytea column shows 0 bytes

Database is: POSTGRESQL Database driver: PDO My query is: INSERT INTO poi ( "idPoiCategory", name, "shortName", description, url, source, "contactPostalCode", "contactCity", "contactAddress", …
Sargit
  • 11
  • 4
0
votes
0 answers

BYTEA to Integer using libpq

I have a table with two columns: 1) id SERIAL PRIMARY KEY 2) BYTEA I am trying to fetch all the rows using PGresult * res = PQexecParams(conn, "select * from table",0,NULL,NULL,NULL,NULL,1); ==> The last argument = 1 specify results to be in…
Saurabh
  • 295
  • 3
  • 12
0
votes
1 answer

Postgres: After converting from bytea to varchar '\r' remains

I have a table which contains xml file as binary data. The xmls contains "\r\n" characters as "\015\012" in bytea. I need to change the column type from bytea to varchar. I run: ALTER TABLE my_table ALTER COLUMN xml_data TYPE VARCHAR; UPDATE…
slevin_by
  • 15
  • 3
0
votes
0 answers

Indexing PostgreSQL BYTEA data with Solr & Tika

Previously, I have successfully indexed rich documents that are stored in a BLOB column in Oracle using Tika & Solr. However, now I'm trying to do that same thing with a PostgreSQL (9.5.1) database and Solr (5.5.0) and cannot get it to work. I've…
DarkerIvy
  • 1,477
  • 14
  • 26
0
votes
1 answer

Sum bytea in postgres

I have stored procedure in postgres with a variable like DECLARE totLen BYTEA; BEGIN totLen = E'\\x000034'; .... totLen must be exactly 3 bytes an I have to sum other value like totLen = totLen + 1; I try totLen = totLen +…
elia_c
  • 99
  • 1
  • 6
0
votes
2 answers

PostgreSQL database convert printable characters to octets with bytea column on linux platform

here is the scenario: CREATE TABLE amaaa ( laaaid integer NOT NULL DEFAULT 0, blobdata bytea ) INSERT INTO amaaa(laaaid)VALUES (1); SQLRETURN connect() { SQLRETURN ret; /* ODBC API return status */ /* Allocate an environment handle */ ret…
Ramin
  • 43
  • 1
  • 4
0
votes
0 answers

PostgreSQL Bytea - SQL Insert different ways - Optimal?

I would like to save big arrays of integer (e.g. length = 1000) as bytea in postgres. Example: Given an integer (32 bits) array x = [1] I could insert the array in different ways in postgres, but which form is best practice (faster/less space in…
Hangon
  • 2,449
  • 7
  • 23
  • 31
0
votes
0 answers

AES encryption in POSTRGESQL

I used a function in pgcrypto - encrypt('id','TheBestSecretKey','aes') to encrypt a field in postgresql(Pg admin tool).The field got encrypted and the output was in bytea format like:\234u\321\036\027\317O\371\020bb\342\334x)\236. The same data when…
bhavanak
  • 255
  • 1
  • 12