Rails 3 - heroku PGError: ERROR: type modifier is not allowed for type "text" - ruby-on-rails-3

I am a newbie on Rails and doing ok so far. I wanted to find out what schema file is uploaded when you do heroku rake db:setup. Because even though I have deleted a table it keeps trying to create it on heroku and gives error.
I even tried recreating the table but it keeps remembering the old setting and errors out.
PGError: ERROR: type modifier is not allowed for type "text" LINE 1:
"trainings" ("id" serial primary key, "content" text(255),...
It's trying to create table trainings with content column text but I no longer have that setting and I think the setting is saved somewhere.
I even tried deleting my app and restarting it but no luck.
Any clues?
Thanks.

the default database on heroku is postgresql. And the text type in postgresql does not accept a size: it is unlimited.
See http://www.postgresql.org/docs/9.1/static/datatype-character.html

Related

HIVE_METASTORE_ERROR persists after removing problematic column from schema

I am trying to query my CloudTrail logging bucket through the use of Athena. I already deployed a crawler into the bucket and managed to populate a few tables. When I tried running a simple "preview table" query, I get the following error:
HIVE_METASTORE_ERROR:
com.amazonaws.services.datacatalog.model.InvalidInputException: Error: : expected at the position 121 of 'struct<roleArn:string,roleSessionName:string,durationSeconds:int,keySpec:string,keyId:string,encryptionContext:struct<aws\:cloudtrail\:arn:string,aws\:s3\......
I narrowed down the column name in question and removed it completely from my schema.
After removing it from the schema in AWS Glue and rerunning the preview table query I still get the same error at the same position. I tried again in a different browser but I get the same error. How can this be, am I missing something?
Please provide any advice.
Thanks in advance!

Issue storing images in Postges database - permission denied

I have a small database in which I want to store images in a separate table. I have been reading different methods and believe due to the small size of the DB there is no issue in physically storing the image within the DB.
I have been reading and trying to get the sql code correct in order to upload one image into a new table. However I am running into "SQL Error [42501]: ERROR: could not open file.... for reading: Permission denied".
I have tried to change permission access by clicking Command + I on the folder and at the bottom adding "postgres" with "Read & Write" privileges. I closed DBeaver and still not luck.
Is my approach and sql code correct for uploading and image? How do I get around permissions?
create table category (
"id_category" SERIAL,
"category_name" TEXT,
"category_image" bytea,
constraint id_cat_pkey primary key ("id_category"))without oids;
insert into category (category_name,category_image) values('MANGO', pg_read_binary_file('tmp/IMG_2405.jpeg')::bytea)
I was able to upload the image to postgres. I had to move the picture to a folder with in the same directory as postgres. I am still working how to give permission to folders outside of postgres.

SSAS corrupt string store data file for one of the table columns error

I'm getting error on SSAS when redeploy the project. The error is;
The JSON DDL request failed with the following error: Error happened while loading table data. Possible cause is: corrupt string store data file for one of the table columns.Error happened while loading table data.A duplicate value has been detected in the Unique Value store associated with the dictionary.Database consistency checks (DBCC) failed while checking the data segments.Error happened while loading table '', file '1245.H$Countries (437294994)$Country (437295007).POS_TO_ID.0.idf'.Database consistency checks (DBCC) failed while checking the data segments.Error happened while loading table '', file '1245.H$Countries (437294994)$City ....
I checked the table Countries but there is no duplicated data.
Is there anybody who can help please?
As the error implies, the model has some corrupted data (not to be confused with duplicated data).
Microsoft has some resolutions for there kinds of errors here: https://learn.microsoft.com/en-us/analysis-services/instances/database-consistency-checker-dbcc-for-analysis-services?view=asallproducts-allversions#common-resolutions-for-error-conditions
TL:DR:
Depending on the error, the recommended resolution is to either
reprocess an object, delete and redeploy a solution, or restore the
database.

BigQuery return Unknown error after create table name with '_ads` suffix

I try both API and GUI to create this empty table and they both failed.
I create many tables via API just fine but only this name organizes_ads has a problem.
Same create process and schema can create organizes_ads_0 but not organizes_ads.
If I try to get this table via API it will return.
{"error":{"code":-1,"message":"A network error occurred, and the request could not be completed."}}
I tend to use this name because it's a replicated table name from other source, so it will be weird if I have to hard code to use other name for workaround.
[UPDATE] I also found that any table name with suffix _ads will be broken (so nothing wrong with schema).
This error could be caused by an AdBlocker.
I created a table with _ads suffix and when enabled the AdBlocker I got the same error: Unknown error response from the server.

Heroku rake db:migrate aborted with 'PG::Error:'

I'm trying to run my app on Heroku, and I can't get past the 'rake db:migrate' command.
I keep getting this error:
rake aborted!
An error has occurred, this and all later migrations canceled:
PG::Error: ERROR: must be owner of extension plpgsql
Any idea?
p.s.
this is the full error log: http://pastebin.com/iYeiMD2y
It's attempting to populate the database from you schema. The problem is that it's trying to add comments to a postgresql extension that your database user does not own. These 3 lines will cause problems:
COMMENT ON EXTENSION plpgsql IS 'PL/pgSQL procedural language';
COMMENT ON EXTENSION pg_trgm IS 'text similarity measurement and index searching based on trigrams';
COMMENT ON EXTENSION unaccent IS 'text search dictionary that removes accents';
In order to comment on any database object, you need to be the owner of that object. See the PostgreSQL documentation for more information.
Heroku also doesn't allow you to create or modify extensions. They provide a list of available extensions and text-search dictionaries that are available for use and all of the extensions in your schema dump are listed.
Remove or comment out the lines code in the schema dump that are creating extensions and creating comments on extensions and that should get you past that error.