PostgreSQL is an open-source, object-relational database management system (ORDBMS) available for many platforms including Linux, UNIX, MS Windows and Mac OS X. Please mention your PostgreSQL version when asking questions.
0
votes
0answers
5 views
Selecting an object by it's id using django with heroku postgresql
I've got an app running on heroku with django, the local DB I use mysqllite, but on heroku the app uses postgresql.
I'm having a problem and I've no idea why is happening. Let me explain myself:
I ...
0
votes
1answer
8 views
Ranking rows according some number
I have table like this
id | name
----------
1 | A
2 | B
5 | C
100 | D
200 | E
201 | F
202 | G
I need ranking rows from 1 to 3 order by id, that is, I need result:
...
0
votes
3answers
19 views
fetching monthwise data from a database with a year's record in postgres
I am having a table with a years data with the following columns:
Table "myData" ((
"Status" character varying,
"Project" character varying,
"Product" character varying,
...
-1
votes
1answer
12 views
encoding php postgres json_encode
I have a problem with my encoding...
Everything is UTF-8 configured, namely my database (postgres) and my php files.
when I execute this script:
$eleves = $serviceManager->getAll('Eleve');
echo ...
0
votes
0answers
11 views
Can't select by id using django with postgresql
I've got an app running on heroku, locally I use mysqllite, but on heroku the app is using postgresql.
I'm having a problem and I've no idea why is happening. Let me explain myself:
I select an ...
1
vote
1answer
31 views
Why can't postgres understand a reference to a derived column?
So I have this query:
select
id,
unnest(suppliers) as suppliercode
from table1 t1
left join table2 t2
on t1.suppliercode = t2.suppliercode
Postgres can't understand what is meant by:
on ...
-6
votes
1answer
17 views
What keyword to use in place of table in postgres
CREATE Proc [dbo].[AbnormalODoMeterReading]
as
begin
set nocount on
Declare @TableDevice table
1
vote
1answer
15 views
Joining a postgresql table of type “VarChar Array”?
Until about 5 minutes ago I didn't even know you get a type VARCHAR that is also an array. How would I join these tables:
PEOPLE
ID | PERSON | GROUPS
1 | John | {ONE,TWO}
2 | Jack | {TWO}
3 | ...
0
votes
0answers
15 views
Capturing meta data about how data was collected in a database
I have information I'm going to put in a database, but there I need to store meta-data about where the data came from (whether the data was measured or calculated).
I have several attributes that ...
0
votes
1answer
26 views
PostgreSQL, complex query for calculating ingredients by recipe
I have to calculate food and ingredients of used food stored in PostgreSQL tables:
table1 'usedfood'
food food used used
code name qty meas
...
1
vote
2answers
46 views
Select count of users registered in each month
Having a very simple table:
CREATE TABLE users (
name VARCHAR(50) NOT NULL,
registered TIMESTAMP NOT NULL,
CONSTRAINT users_pk PRIMARY KEY (name)
);
How to select the number of user ...
0
votes
1answer
32 views
display time from different table
I'm new to the site and hope someone can guide me on the right path. I'm using PostgreSQL and php. right now I need to display time start and time end. but for some reason it doesn't display right. ...
0
votes
1answer
22 views
Accessing catalog views from Perl DBI scripts - PostGreSQL
I am writing a perl script that uses DBD::Pg (the PostGres driver for the DBI module). This is something I've done many times before but this time round I am wanting to quer one of the system ...
1
vote
0answers
16 views
Rails 3 Saving User Searches DataModel
I am working on a piece of my app where the client is wanting the ability for user searches to be saved (these searches are completed by the user completing a set of dropdowns and then entering in a ...
0
votes
1answer
20 views
What takes the time when doing a Rails CSV import to Postgres?
I have a CSV with 950 rows that I'm importing into Postgres via Rails using the following controller code:
io = params[:file]
trade_plans = []
CSV.foreach(io.tempfile, { :col_sep => "|" }) do ...