Questions tagged [postgresql-9.1]

for PostgreSQL questions specific to version 9.1.

PostgreSQL 9.1 is the version of PostgreSQL released in September of 2011, with expected end-of-life in September of 2016.

While the generic tag should probably be used with all PostgreSQL-related questions, this tag should also be used if the question pertains to features added in version 9.1, or if the question is about a problem seen while running version 9.1.

1821 questions
0
votes
1 answer

org.jboss.jca.adapters.jdbc.jdk6.WrappedConnectionJDK6 cannot be cast to org.postgresql.PGConnection

Within a Stateless bean I m trying to insert into a table which has an OID field. Please find the snippet below: DataSource dataSource = (DataSource) context.lookup(JNDI_NAME); Connection connection = dataSource.getConnection(); PreparedStatement…
0
votes
1 answer

trigger to silently preempt insertion in a table

Is it possible for a trigger to be defined in such a way that the row that was to be inserted is not inserted, without raising an exception? My use case is that I want to simplify the exception handling for the client library: the client library…
Marcus Junius Brutus
  • 26,087
  • 41
  • 189
  • 331
0
votes
1 answer

create a trigger on a view

I have a time-dependent view that uses the now() function and hence changes values with the passage of time. Simplistic code below: DROP VIEW IF EXISTS av; DROP TABLE IF EXISTS A; CREATE TABLE A (when_epoch_seconds INTEGER, x VARCHAR); INSERT INTO…
Marcus Junius Brutus
  • 26,087
  • 41
  • 189
  • 331
0
votes
1 answer

Retrieve the inserted/updated/deleted record in same function in postgres

I am using a function to insert values into a table in postgres. Is it possible to retrieve the inserted/updated/deleted record in same function. I am new to postgres, so would appreciate if someone could guide or explain how to do this. Here is my…
0
votes
0 answers

Permission denied for relation table outbox

i want to instal gammu-smsd but i got error Thu 2014/11/20 06:04:17 gammu-smsd[31457]: Error: ERROR: permission denied for relation outbox Thu 2014/11/20 06:04:17 gammu-smsd[31457]: SQL failure: 2 Thu 2014/11/20…
kputri
  • 63
  • 1
  • 5
  • 18
0
votes
1 answer

Postgresql format() function alternative

Hi My question is already asked here But i haven't found any answer there in that link. I don't want any tool to acheive my requirement. I am looking for a simple procedure or query. In that link someone answered about search_columns() procedure.…
soft4time
  • 1
  • 4
0
votes
3 answers

What is the best way to replace a string with another string on entire table?

My question is similar to below but I want to replace it for any column: postgresql - replace all instances of a string within text field for instance - replace all instances of cat with dog in entire table(all rows) I am expecting something like…
akhi
  • 664
  • 2
  • 10
  • 23
0
votes
1 answer

WSO2 Identity Server 5.0.0 with Postgres registry database

I tried WSO2 - Identity Server 5.0.0 using postgresql-9.1 as a registry database and had the following troubles : First i got some troubles setting up the registry database : in the file ${CARBON_HOME}/dbscripts/identity/postgresql.sql at line 199…
user2441141
  • 27
  • 1
  • 5
0
votes
1 answer

How to enable access to one schema and public schema in Postgres

Postgres 9.1 database contains public, firma1 and firma6 and other schemas. How to allow access to public and firma6 schemas only for specific user. I tried revoke all on schema firma1 from public; revoke all on all tables in schema firma1 from…
Andrus
  • 26,339
  • 60
  • 204
  • 378
0
votes
0 answers

Running a postgres query between two databases with conditions

I have two postgres databases on a single server. I need to extract records from one database and put them into another. This is my working query. insert into "tblInvInfo" select "iiInvNum", "iiItemCode","iiUnitMeasure", "iiUnitQuantity",…
itsols
  • 5,406
  • 7
  • 51
  • 95
0
votes
2 answers

pass variable from PHP to Ubuntu shell script

I have a shell script like this (in /usr/local/bin/esm-script/import-master.php): #! /bin/bash echo "this is the file name $1." script -c 'PGPASSWORD="pwd123" /usr/bin/psql --host localhost --port 5432 --username "postgres" --no-password --quiet…
itsols
  • 5,406
  • 7
  • 51
  • 95
0
votes
1 answer

PostgreSQL query inside a function with tables and other parameters

I try to update a table based on some criteria, but unfortunately the table names can change so I created a function which go trough 2 arrays and updates table according the arrays and the other table values. Basically I wan't to fix the country…
flatronka
  • 1,061
  • 25
  • 51
0
votes
1 answer

Convert oracle code into PostgreSQL

I have below code as part of oracle procedure ,Need help in converting into PostgreSQL procedure- -- logic to send e-mail to multiple To'd users separated by ';' v_temp := replace(p_recepient,' ',''); IF ( instr(v_temp,';') = 0) OR…
0
votes
0 answers

Performance issue - Process postgres database

Good morning!  I have a web application connected to a postgres database in Ubuntu.  I have the problem that there is a process within my database which consumes 100% of the CPU time.  How can I locate that process, how can I identify the…
0
votes
1 answer

How to get values from different table using association in rails?

I've two tables in my Postgres database structures given below: CREATE TABLE tables( id serial NOT NULL, name character varying(255), table_state_id integer, table_type integer, CONSTRAINT tables_pkey PRIMARY KEY (id) ) AND CREATE TABLE…
user3252359