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
16 views
SQL SELECT … WHERE IN with separate LIMIT,OFFSET clause
I have simple SQL query:
SELECT * FROM t1
WHERE status = 1 AND user_id = ? AND some_field NOT IN (?, ?, ..., ?)
ORDER BY createdAt DESC, rating DESC
LIMIT 10 OFFSET 0;
But I want to perform ...
0
votes
0answers
8 views
Postgres Mac OS X and Lunchy
I installed postgres and lunchy.
I got no errors and now when I run lunchy start postgres, I get:
-bash: lunchy: command not found
with gem list it returns the lunchy 0.7.0 version I installed.
...
0
votes
2answers
19 views
Getting results between two dates in PostgreSQL including those two dates
I have two dates , I want to display all records in those two dates including those dates.
How can i write query in PostgreSQL,
I have found
SELECT *
FROM mytable
WHERE (start_date, end_date) ...
2
votes
1answer
39 views
Model Auto Increment Number Issue.. After 1,000 Records
Please help me to fix this issue as i am getting it from today morning... After doing some research i have found the issue...
I have a table called... "fmb_form_item_answer"
currently this table ...
0
votes
2answers
24 views
Psql query using perl
I am writing a perltk gui which interacts with a database. I would like a certain condition on my query that the field myo_maps_study should match the regex MYO[0-9]*\$ if the myo_maps_study exists. ...
0
votes
1answer
35 views
ERROR: 42601: syntax error at or near “21”
if (rdGrab != null && rdRev!=null)
{
rdGrab.Read();
rdRev.Read();
NpgsqlCommand cmdIssue = new NpgsqlCommand("INSERT ...
0
votes
2answers
34 views
How can i return '0' from query in pgsql, if the row doesn't exist?
How can i return '0' from query in pgsql, if the row doesn't exist?
Like
SELECT IF EXISTS(field) THEN field ELSE 0 FROM table
-2
votes
0answers
26 views
Losing value from PostgreSQL database. Value replaced with ' ' [on hold]
I'm trying to realize a simple php platform connected to a PostgreSQL database. I can't explain why, in only one case, my database loses the value I previously stored and replaces it with ''. I've ...
0
votes
0answers
12 views
Saving postgresql array datatype in cakephp ignores all array datatype fields
Saving model data fails to insert any of array datatype fields. Data array to store.
array(
'catalog_id' => '14',
'foreign_model[1]' => 'Catalog',
'foreign_model_key[1]' => (int) ...
0
votes
1answer
8 views
Postgres ts_rank_cd: No function matches the given name and argument type
I am using Postgres 9.1 and trying to get fulltext ranking working.
I am following
http://www.postgresql.org/docs/9.1/static/textsearch-controls.html#TEXTSEARCH-RANKING
nutrition=> SELECT title, ...
1
vote
0answers
20 views
Yii CDbException.. invalid input syntax for integer: “1,075”
i started reciving this error from a production site since this morning and wondering how i dont get the same in UAT or developer environment..
Is any one familiar with an error like this ?
...
1
vote
0answers
10 views
Incomplete output with psycopg2 and cswriter in python
I wrote the following python code that would write a portion of a postgresql table to a csv file using psycopg2 and python's csvwriter. The problem that I am having is that I get an incomplete csv ...
1
vote
2answers
43 views
sql compare entries with differents parameters
Here we are comparing entries in table
CREATE TABLE a
(id INT PRIMARY KEY,
p1 INT, p2 INT, p3 INT, .. , p15 INT)
p(n) takes the value from 0 to 2
I have to get all entries with unique combinations ...
0
votes
1answer
22 views
Conditionally add a new column in conjunction with UNION ALL in PostgreSQL
I am combining two tables that have the same columns. They are from two different sources, like treatment and control groups. I want to know where each row came from.
Is it possible to do so by ...
0
votes
1answer
30 views
When should PostgreSQL timestamps be created without a time zone?
I have an application where the goal is to have all timestamps in the databes in GMT format should those time stamps be created without a timezone like so update_ts timestamp without time zone or is ...