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
3 views
How to set encoding to PostgreSQL data base?
I cant see cyrillic symbols in PostgreSQL 9.1 on Linux Mint. So i want to create new bd with cyrillic encoding. I says:
CREATE DATABASE ekb_1 ENCODING 'CP1251' TEMPLATE postgistemplate;
but get ...
0
votes
0answers
4 views
postgres string type compatibility: varchar and character
On my postgresql database, i've declared all String field as
character(n)
Now i have some function that takes string argument as
carchar(n)
are this two datatype compatible or should i change ...
2
votes
2answers
31 views
SQL: do we need ANY/SOME and ALL keywords?
I'm using SQL (SQL Server, PostgreSQL) over 10 years and still I'm never used ANY/SOME and ALL keywords in my production code. All situation I've encountered I could get away with IN, MAX, MIN, ...
0
votes
0answers
9 views
How to write a function in postgresql that returns text or integer values?(postgresql)
i'm using postgresql 9.2.4
postgres=# select version();
version
-------------------------------------------------------------
PostgreSQL 9.2.4, compiled by Visual C++ ...
0
votes
2answers
24 views
How do I Swap a set of FK's in a query
I need to swap 1 set of number with another set of numbers.
y z pk x
------ ------ ------ -----
1 2 1 5
1 3 2 5
1 ...
0
votes
1answer
7 views
column spree_preferences.key does not exist
When I run
rake db:migrate
I get the following error message.
PG::Error: ERROR: column spree_preferences.key does not exist`
Anyone can please tell me how to fix this error.
0
votes
0answers
8 views
Postgre SQL incorrect syntaxt near If
I'm trying to create function but it's having error at If statement don't know what's the problem with it.
CREATE FUNCTION uspgetcountrylistwithpagenumber(IN "PageNumber" integer, IN "PageSize" ...
-1
votes
2answers
17 views
“query has no destination for result data” in PL/PgSQL function
I need to show the Tree_Nodes table data
CREATE OR REPLACE FUNCTION sample()
RETURNS TABLE() AS
$BODY$
BEGIN
select * from "Tree_Nodes";
END;
$BODY$
LANGUAGE ...
0
votes
0answers
6 views
Need help to review Postgre SQL query
I have following Postgre SQL Query
declare
_sql varchar varying(50);
_whereClause varchar varying(50);
_whereClause:='and 1=1'
execute 'SELECT count(*) FROM test t WHERE 1=1' || ...
0
votes
0answers
19 views
Have Postgresql accept 1 and 0 as true and false for boolean [migrated]
I have a large file of dumped sql data to load in to postgresl (600mb+). In that dump, fields that are boolean true and false are expessed as 1 and 0 without quotes. Trying to load them in to ...
2
votes
0answers
43 views
Update and delete queries in a transaction
I have two queries (update and delete) in a transaction. The queries are open queries. I am using SQL server to connect to postgresql by creating a linked server.
here is my code:
cn_pg.Open();
...
0
votes
0answers
6 views
Subtract product_qty of a product, in a confirmed purchase.order (stock.move) - to a custom module
I need to subtract the product_qty of a choosen product in a purchase.order.line (for this i made a boolean type field) So if you click at this boolean field, it tells my custom module that this ...
0
votes
1answer
15 views
input date validation check calling to_date
I'm using postgreSQL-9.1.6 on CENTOS.
I have issue on to_date function like...
postgres=# select to_date('20130229','yyyymmdd');
to_date
------------
2013-03-01
(1 row)
so I'm trying to add ...
-2
votes
1answer
10 views
COmmunication between windows host and centos guest through vbox
I am trying to access the db which is there on my windows 7 machine through centos mounted on oracle virtual box. I am using python as the language, using Django.
I have made the following changes ...
-2
votes
0answers
12 views
Rails Postgresql Merge into one query
I have two queries.
Task.where('name not in (?)',tags)
Task.where("actions -> '#{Date.today}' > '0'")
name is string
action is hstore Postgresql
Please, help me to merge into one query.