Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6839111
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T23:40:44+00:00 2026-05-26T23:40:44+00:00

I moved a mysql DB to Postgres, but some of the tables had a

  • 0

I moved a mysql DB to Postgres, but some of the tables had a varbinary(16) field (to store an ip address).

Postgres does not support varbinary fields, and after some research, I found that the Postgres equivalent is bytea.

So, I went ahead and made tables with bytea as the field type for the ip columns.

Now, I am not sure, but this might be causing me problems.

So, now my question is if bytea and varbinary can be treated totally equally or not.
For example, if the original MySQL query is:

 INSERT INTO messages(userID, userName, userRole, dateTime, ip, text)
 Values('21212111','bot','4',NOW(), inet_pton($ip), 'hi');

Note: I included some php in there, because my logs don’t show what the inserted ip address is (It’s a blob/something)

Now, would this query store the exact same data if it was a bytea field instead? I would presume yes, but does the same hold true for a select statement?
i.e. Would, this query return the same data regardless of whether the ip field was varbinary or bytea?

SELECT userID, userName, userRole, channel ,ip FROM table

Thanks for your time, have a good day.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T23:40:45+00:00Added an answer on May 26, 2026 at 11:40 pm

    Yes, bytea is an equivalent to varbinary/image/blob et al. Having said that, PostgreSQL does come with an inet type as standard, which will take an IPv4 address in textual representation and store it as a 32-bit integer.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to move from MySQL to MySQLi but am having some problems.
I'm trying to move some Excel-Data to MySQL, but having troubles with encoding. What
I have a CakePHP app that is being moved to Sql Server from MySql.
I'm thinking about moving from MySQL to Postgres for Rails development and I just
I want to ask about UNIX time, Does UNIX time record Timezone? I moved
I need to move a database with a Django schema from Postgres to MySQL,
I've moved to mysql from sqlite and funny issue - whenever I mass-delete objects
moved a rails app of mine onto a new server and had to install
After some virus activity I'm unable to connect to a MySQL db on my
I am building an app which uses a mysql and a postgres database. I'm

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.