1
vote
5answers
49 views

Efficient way of counting a large content from a cloumn or a two in a database using selected time period

I need to list number of column1 that have been added to the database over the selected time period (since the day the list is requested)-daily, weekly (last 7 days), monthly (last 30 days) and ...
1
vote
1answer
28 views

Conversion of Int value to words

Kindly let me Know is there any way to convert integer value to Words in postgresql.. as am trying to convert integer value "10" to "TEN". Thank You.
1
vote
2answers
37 views

SQL query to report duration untill next log entry

I'm working with PostgreSql and trying to build reporting query for my logs, but unfortunately unsuccessfully... Basically I have LOG table which logs status changes of other entity. So for the sake ...
1
vote
2answers
35 views

alter column from time with time zone to timestamp

I am having trouble changing a column called end_date in a table called key_request from time with time zone to timestamp in my Postgres database . I have tried using the following code: alter table ...
0
votes
2answers
21 views

PostgreSQL concatenate different attributes together to return a single value

Table: CREATE TABLE venue (id INTEGER DEFAULT NEXTVAL('venue_id_seq'), building_code building_code, floorNo int, roomNo int, width int, length int); The function: CREATE or REPLACE FUNCTION ...
1
vote
1answer
36 views

PostgreSQL function to check for an enum value in an array

Types: CREATE TYPE equipment AS ENUM ('projector','PAsystem','safe','PC','phone'); CREATE TYPE building_code AS ENUM ('IT','EMS','HSB','ENG'); Tables: CREATE TABLE venue ( id INTEGER DEFAULT ...
0
votes
0answers
18 views

postgresql full text search ispell dictionary (dict and affix files): ERROR: wrong affix file format for flag

I am quite new to postgresql full text search and I am setting up the configuration as following (exactly as in docs): CREATE TEXT SEARCH DICTIONARY english_ispell ( TEMPLATE = ispell, ...
4
votes
1answer
32 views

Passing a ResultSet into a Postgresql Function

Is it possible to pass the results of a postgres query as an input into another function? As a very contrived example, say I have one query like SELECT id, name FROM users LIMIT 50 and I want to ...
0
votes
1answer
26 views

postgresql trigger (strategy) to update table based on entries of another table

I am fairly new to PostgreSQL (spoilt by django ORM!), and I would like to create a trigger which updates a table based on entries of another table. So, I have the following table on my schema: ...
0
votes
0answers
15 views

Connection to Postgresql refused

I've created superuser, set his password and created a database. Now I'd like to connect remotely to postgresql, but I'm getting Connection refused. Check that the hostname and port are correct and ...
0
votes
1answer
24 views

Full text search on PostgreSQL

Now I'm learning about full text search in PostgreSQL 9.2.3. However, I have a problem. I run this example: CREATE TABLE messages (title text,body text,tsv tsvector); CREATE TRIGGER tsvectorupdate ...
1
vote
1answer
20 views

Get repeated values

I have table like this: I need get numbers, wich is repeated in different citys and also get these citys quantity for each number. That is from this table, I need result: number | repeated citys ...
0
votes
2answers
42 views

PostgreSQL: Find shared beginning of string with SQL

How can I determine the shared beginning of two or more strings using SQL? For example, say I have 3 URIs: 'http://www.example.com/service/1' 'http://www.example.com/service/2' ...
1
vote
2answers
31 views

Postgres: 'role does not exist' using dblink, but it does

So this is super strange. I'm trying to do a simple select using dblink as such: SELECT * FROM dblink('dbname=my_db_name, user=my_user, password=password, hostaddr=127.0.0.1', 'SELECT action, ...
0
votes
2answers
20 views

How to set superaccount when installing postgres 9.2 as extract-only

I am trying to install postgres enterprise db on windows. I give an option file with parameters for installation. But instead of installing as a windows application, I want to just extract the ...

1 2 3 4 5 19
15 30 50 per page