getting error function lo_manage() does not exist [duplicate] - postgresql

This question already has answers here:
How to use (install) dblink in PostgreSQL?
(7 answers)
How do I import modules or install extensions in PostgreSQL 9.1+?
(7 answers)
Closed 4 years ago.
Currently i am using PostgreSQL Plus Advance Server 9.3 and i just created a table which has a column of blob type and i am using oid data type to store blob value.
Now i want to create a BEFORE UPDATE AND DELETE TRIGGER to remove the orphan data from pg_largeobject table of postgresql using:
CREATE TRIGGER DEL_OID BEFORE UPDATE OR DELETE ON INFO_LOB
FOR EACH ROW EXECUTE PROCEDURE lo_manage (BLOB_VALUE_);
But when i am trying to execute this trigger,
Getting error:
ERROR: function lo_manage() does not exist
SQL state: 42883
so i am not able to understand that what is the mistake that i am doing. can somebody please help me? thanks

Related

Create table in Postgressql [duplicate]

This question already has answers here:
Dataclip Error ERROR: cannot execute INSERT in a read-only transaction [duplicate]
(1 answer)
`ERROR: cannot execute TRUNCATE TABLE in a read-only transaction` in Heroku PostgreSQL
(3 answers)
Closed 10 months ago.
I'm trying to create a data table in Postgress in Heroku.
While creating a table I'm getting ERROR: cannot execute CREATE TABLE in a read-only transaction error.
Select commands are working fine, but creating table not working.
What permission I'm missing?
I'm trying to do this using Dataclips and https://app.popsql.com/
Hello salesforce developper,
You seem to have a problem with the credentials of your user. If you read the documentation you will see that the default user credential allow only
Run SELECT on tables in the database
INSERT new data
UPDATE data
DELETE data from tables
On Postgres 10 and above, view some usage statistics and monitoring data
So you need to go to the Credentials tab, find the credential you want to configure, and select one of the permission levels. The levels are:
No permissions — no access privileges on any table in the database
Read-only permissions — read access on every table in the database
Read-write permissions — read and write access on every table in the database, including the ability to delete data, plus the ability to generate values from sequences
Configuring permissions on an existing credential```
More information at:
https://devcenter.heroku.com/articles/heroku-postgresql-credentials#creating-a-new-credential

Is there a way to determine creation time of a PostgreSQL database? [duplicate]

This question already has answers here:
Get database creation date on PostgreSQL
(3 answers)
Closed 3 years ago.
I have a PostgreSQL server with several databases on it.
Is it possible to determine when each database on a database server was created?
SELECT (pg_stat_file('base/'||oid ||'/PG_VERSION')).modification, datname FROM pg_database;
You can find answer here.

Unable to insert data in table in Postgres sql commands [duplicate]

This question already has answers here:
Cannot simply use PostgreSQL table name ("relation does not exist")
(18 answers)
Closed 5 years ago.
This is my query
INSERT INTO EForms_M_FormTypeMaster (FormTypeId,FormTypeCode,FormTypeName)
VALUES ('12','FM','Form');
Getting this error
Error Message relation "eforms_m_modulemaster" does not exist
Please help to solve the issue
Where is the table? If it is in public then you must aware about case insensitive. That means if your table realname is EForms_M_FormTypeMaster you must put it between "
INSERT INTO "EForms_M_FormTypeMaster" ("FormTypeId","FormTypeCode","FormTypeName")
VALUES ('12','FM','Form');

postgresql migrating JSON to JSONB [duplicate]

This question already has answers here:
Upgrade PostgreSQL JSON column to JSONB?
(2 answers)
Closed 6 years ago.
In postgresql 9.4 the new JSONB was incorporated.
On a live DB in postgresql 9.3 I have a JSON column.
I want to migrate it to JSONB.
Assuming I migrated the DB first to 9.4 (using pg_upgrade). What do I do next?
ALTER TABLE table_with_json
ALTER COLUMN my_json
SET DATA TYPE jsonb
USING my_json::jsonb;
In the context of Rails, here is an ActiveRecord migration alternative:
def change
reversible do |dir|
dir.up { change_column :models, :attribute, 'jsonb USING CAST(attribute AS jsonb)' }
dir.down { change_column :models, :attribute, 'json USING CAST(attribute AS json)' }
end
end
I don't know how this compares to the accepted answer performance-wise, but I tested this on a table with 120 000 records, each record having four json columns and it took me about a minute to migrate that table. Of course, I guess it depends on how complex the json structure is.
Also, notice that if your existing records have a default value of {}, you have to add to the above statements default: {}, because otherwise you'll have jsonb columns, but the default value will remain as '{}'::json.

Copy (or USE) data from two tables in different databases [duplicate]

This question already has answers here:
Closed 12 years ago.
Possible Duplicate:
Possible to perform cross-database queries with postgres?
I don-t know how to use one table from one database and second table from another databse at the same time or copy data from table in one database to table from another databse.
I tried following query:
select * into NewTable from existingdb.dbo.existingTable;
But it doesnt't work.
In existing table name, specify the full path. that's database name and table table to be copied. In New table also specify the database name and table name or make sure the console is in same database.
Also verify both the tables have same table structure.
What is the exact error message? It would not work if NewTable already exists. Then you should type insert into NewTable select * from ExistingDb.dbo.ExistingTable.