Re: Changing the Datatype from Bit to Boolean. - Mailing list pgsql-admin

From Mark Smith
Subject Re: Changing the Datatype from Bit to Boolean.
Date
Msg-id SA3PR18MB53700EAF6CCDFECB2AD2ACC3C8C02@SA3PR18MB5370.namprd18.prod.outlook.com
Whole thread Raw
In response to Changing the Datatype from Bit to Boolean.  (Gambhir Singh <gambhir.singh05@gmail.com>)
List pgsql-admin
Hi Benjamin

Thanks for your help. The script to upload *.sql worked well.

Mark

From: Benjamin Acquaye <benjaminacquaye2@gmail.com>
Sent: Sunday, February 23, 2025 9:01:44 AM
To: Mark Smith <mark@zoneget.com>
Subject: Re: Changing the Datatype from Bit to Boolean.
 
Bro, this issue you're encountering with pg_restore could stem from a few different factors, 
and some of the common reasons and solutions.

1. Database Format Mismatch
The backup file you're trying to restore might not be in the right format. 
PostgreSQL supports several backup formats:

Custom format (.backup): This is often created with pg_dump.
=============
Plain SQL format (.sql): This is a plain text file containing SQL commands.
=================
Directory format: A directory structure, also generated by pg_dump.
=================

Solution:
=========
If you're trying to restore from a .sql file, you should use psql instead of pg_restore. 
==========================================================================================
==>psql -U your_user -d your_db_name -f backup.sql

If it's a .backup or directory format, you should use pg_restore. Example:
==========================================================================
==>pg_restore -U your_user -d your_db_name your_backup_file.backup

Solution: 
Make sure the user you're logged in as has the appropriate permissions to create objects in the database.

==>GRANT ALL PRIVILEGES ON DATABASE your_db_name TO your_user;

On Sun, Feb 23, 2025 at 9:46 AM Mark Smith <mark@zoneget.com> wrote:
I am new to PostgreSQL. I am trying to restore a db downloaded from GitHub. Pg_restore is coming with error when tried using pgAdmin.  Can you tell what the reason could be?

Thanks for your help.

Mark

From: hellen jiang <hellenjiang99@gmail.com>
Sent: Sunday, February 23, 2025 8:13:05 AM
To: Gambhir Singh <gambhir.singh05@gmail.com>
Cc: pgsql-admin@lists.postgresql.org <pgsql-admin@lists.postgresql.org>
Subject: Re: Changing the Datatype from Bit to Boolean.
 

you can add one new column(boolean) and then remove the BIT column。

On Sun, Feb 23, 2025, 12:58 AM Gambhir Singh <gambhir.singh05@gmail.com> wrote:

Hi,

Aurora PostgreSQL DB has a table in which one column has the datatype BIT(1). Now the requirement is that I have to change the datatype of that column from BIT to BOOLEAN. There are only a few rows in the table.

--
Thanks & Regards
Gambhir Singh

pgsql-admin by date:

Previous
From: Ron Johnson
Date:
Subject: Re: Question about pg_dump + pg_restore + pg_toast
Next
From: Edwin UY
Date:
Subject: V12 to V16 Upgrade -- does size matters?