2013/5/18 Brian Sherwood :
> I am running postgresql 9.2.
>
> I am assuming it would be a function of psql to right justify text, but I
> can't find any way to do this.
>
> Is there a way to right justify just one text column?
If you mean have the psql client right-justify a particular text column
the column type info can be found in information_schema.column view.
jov
在 2013-5-17 下午11:27,"Brian Sherwood" 写道:
> I am running postgresql 9.2.
>
> I am assuming it would be a function of psql to right justify text, but I
> can't find any way to do this.
>
> Is there a way to right justify just
I am running postgresql 9.2.
I am assuming it would be a function of psql to right justify text, but I
can't find any way to do this.
Is there a way to right justify just one text column?
Thanks
Brian
:13 PM
To: pgsql-sql@postgresql.org
Subject: [SQL] How to split an array-column?
Hi,
I've got a table to import from csv that has an array-column like:
import ( id, array_col, ... )
Those arrays look like ( 42, ";4941;4931;4932", ... )
They can have 0 or any number of elements separated b
Andreas [maps...@gmx.net]
Sent: Monday, March 18, 2013 12:13 PM
To: pgsql-sql@postgresql.org
Subject: [SQL] How to split an array-column?
Hi,
I've got a table to import from csv that has an array-column like:
import ( id, array_col, ... )
Those arrays look like ( 42, ";4941;4931;4932&qu
Hi,
I've got a table to import from csv that has an array-column like:
import ( id, array_col, ... )
Those arrays look like ( 42, ";4941;4931;4932", ... )
They can have 0 or any number of elements separated by ;
So I'd need a result like this:
42, 4941
42, 4931
42, 4932
How would I get this?
Quoth maps...@gmx.net (Andreas):
> Am 17.02.2013 19:20, schrieb Andreas Kretschmer:
> > Andreas hat am 17. Februar 2013 um 18:02 geschrieben:
> >> I need to store data that has a valid timespan with start and enddate.
> >>
> >> objects ( id, name, ... )
> >> object_data ( object_id referencs objec
Am 17.02.2013 19:20, schrieb Andreas Kretschmer:
Andreas hat am 17. Februar 2013 um 18:02 geschrieben:
I need to store data that has a valid timespan with start and enddate.
objects ( id, name, ... )
object_data ( object_id referencs objects(id), startdate, enddate, ... )
nothing special, yet
Andreas hat am 17. Februar 2013 um 18:02 geschrieben:
> Hi,
>
> I need to store data that has a valid timespan with start and enddate.
>
> objects ( id, name, ... )
> object_data ( object_id referencs objects(id), startdate, enddate, ... )
>
> nothing special, yet
>
> How can I have PG reject a
Hi,
I need to store data that has a valid timespan with start and enddate.
objects ( id, name, ... )
object_data ( object_id referencs objects(id), startdate, enddate, ... )
nothing special, yet
How can I have PG reject a data record where the new start- or enddate
lies between the start- or
2013/1/31 Nei Rauni Santos :
> Thank you Pavel,
>
> I could do that like this:
>
>
> select p.id,
>
> ( select array_accum ((
> room_name, room_id, room_group_name, room_group_id, room_order,
> availability_min, price_amount, price_min, price_avg, price_balcony_amount,
> price_balcony_avg, capacity
Thank you Pavel,
I could do that like this:
select p.id,
( select array_accum ((
room_name, room_id, room_group_name, room_group_id, room_order,
availability_min, price_amount, price_min, price_avg, price_balcony_amount,
price_balcony_avg, capacity, deposit_required, breakfast_included,
room_mi
Hello
select (fce(..)).column from ...
or select column from fce()
Regards
Pavel Stehule
2013/1/31 Nei Rauni Santos :
> Hi,
>
> The problem is, I'm working in a list of hotels which should have
> availability of rooms and list the hotel and its rooms on the application.
>
> I have this functio
Hi,
The problem is, I'm working in a list of hotels which should have
availability of rooms and list the hotel and its rooms on the application.
I have this function which already is used to get the rooms available
select cms.sp_get_supplier_availability(2, '2013-02-01', '2013-02-02',
'pt_BR', 1
Andreas writes:
> SELECT some_fct( some_id ) FROM some_other_table;
> How can I split this up to look like a normal table or view with the
> column names that are defined in the RETURNS TABLE ( ... ) expression of
> the function.
The easy way is
SELECT (some_fct(some_id)).* FROM some_o
Hi
I've got functions that return a TABLE.
If I call it with constant parameters like:
SELECT * FROM some_fct( 42 );
I get a table with column names as the result as intended.
When I rather call it with the parameter coming from another table I get
a set of records where I don't know how to a
On 01/08/2013 01:53 PM, Emi Lu wrote:
Hello,
May I know how to generate drop table cascade when pg_dump a schema please?
E.g.,
pg_dump -h db_server -E UTF8 -n schema_name -U schema_owner --clean
-d db_name >! ~/a.dmp
In a.dmp, I'd like to get:
drop table t1 cascade;
drop table t2 cascade;
Hello,
May I know how to generate drop table cascade when pg_dump a schema please?
E.g.,
pg_dump -h db_server -E UTF8 -n schema_name -U schema_owner --clean
-d db_name >! ~/a.dmp
In a.dmp, I'd like to get:
drop table t1 cascade;
drop table t2 cascade;
... ...
Only dropping constraints wi
From: saikiran mothe [mailto:saikiran.mo...@gmail.com]
Sent: Saturday, November 10, 2012 10:14 PM
To: pgsql-sql@postgresql.org
Subject: How to compare two tables in PostgreSQL
Hi,
How can i compare two tables in PostgreSQL.
Thanks,
Sai
Here is simple sql to show data in table1, but not in ta
ad of
> creating files and compare them. (got that from Joe Celko ;) )
>
>
>
> --
> Date: Mon, 12 Nov 2012 11:00:32 +0300
> Subject: Re: [SQL] How to compare two tables in PostgreSQL
> From: kamaual...@gmail.com
> To: pgsql-sql@postgresql.o
Hi,
On Sun, 2012-11-11 at 08:43 +0530, saikiran mothe wrote:
> How can i compare two tables in PostgreSQL.
http://pgfoundry.org/projects/pg-comparator/
Open source, under active development.
Regards,
--
Devrim GÜNDÜZ
Principal Systems Engineer @ EnterpriseDB: http://www.enterprisedb.com
Postg
According to Dr Google, this tool may suit your needs:
http://www.sqlmanager.net/en/products/postgresql/datacomparer?gclid=CImMsbmLybMCFQRc3godNgQAdQ
For business use only $133.
Date: Mon, 12 Nov 2012 11:00:32 +0300
Subject: Re: [SQL] How to compare two tables in PostgreSQL
From
I would try to stick to SQL solutions as much as possible, instead of creating
files and compare them. (got that from Joe Celko ;) )
Date: Mon, 12 Nov 2012 11:00:32 +0300
Subject: Re: [SQL] How to compare two tables in PostgreSQL
From: kamaual...@gmail.com
To: pgsql-sql@postgresql.org
If you would like to compare their contents perhaps this may help.
Write a select statement containing the fields for which you would like to
compare data for, you may want to leave out fields whose values are
provided by default for example fields populated from sequence object
and/or timestamp fi
On 11/10/2012 08:13 PM, saikiran mothe wrote:
Hi,
How can i compare two tables in PostgreSQL.
Thanks,
Sai
Compare their content or their definition?
--
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sq
Hi,
How can i compare two tables in PostgreSQL.
Thanks,
Sai
> -Original Message-
> From: pgsql-sql-ow...@postgresql.org [mailto:pgsql-sql-
> ow...@postgresql.org] On Behalf Of air
> Sent: Saturday, October 06, 2012 8:48 AM
> To: pgsql-sql@postgresql.org
> Subject: [SQL] How to make this CTE also print rows with 0 as count?
>
I have a CTE based query, to which I pass about 2600 4-tuple
latitude/longitude values using joins - these latitude longitude 4-tuples
have been ID tagged and held in a second table called coordinates. These top
left and bottom right latitude / longitude values are passed into the CTE in
order to d
On 2012-09-23, Abhijit Prusty -X (abprusty - UST Global at Cisco)
wrote:
> --_000_8A2A33BFAA5E2F408D0BBB80844412720487D0xmbalnx03ciscocom_
> Content-Type: text/plain; charset="us-ascii"
> Content-Transfer-Encoding: quoted-printable
>
> Hi,
>
> I have a query in oracle like this mentioned below
>
Hi,
I have a query in oracle like this mentioned below
Insert into TEST
(TEMPLATE_ID, TEMPLATE_NAME, CREATED_BY, CREATED_DT, UPDATED_BY,
UPDATED_DT, TEMPLATE_KEY)
Values
(1, UNISTR('\D3C9\BA85\B3C4 \B514\C2A4\D50C\B808\C774'), 'dmin', SYSDATE,
'admin',
SYSDATE ,'FLOOR');
Now the o
On Wed, Jun 27, 2012 at 7:26 PM, David Johnston wrote:
> On Jun 27, 2012, at 21:07, Andreas wrote:
>
>
> You should look and see whether the hstore contrib module will meet your
> needs.
>
> http://www.postgresql.org/docs/9.1/interactive/hstore.html
>
>
hstore is certainly an option, as are the
On Jun 27, 2012, at 21:07, Andreas wrote:
> Hi
>
> I do keep a table of objects ... let's say companies.
>
> I need to collect flags that express yes / no / don't know.
>
> TRUE / FALSE / NULL would do.
>
>
> Solution 1:
> I have a boolean column for every flag within the companies-table.
Hi
I do keep a table of objects ... let's say companies.
I need to collect flags that express yes / no / don't know.
TRUE / FALSE / NULL would do.
Solution 1:
I have a boolean column for every flag within the companies-table.
Whenever I need an additional flag I'll add another column.
This
2012/6/24 Craig Ringer :
> As far as I know PostgreSQL does not currently offer native facilities for
> row-level access control (except possibly via SEPostgreSQL
> http://wiki.postgresql.org/wiki/SEPostgreSQL_Introduction).
Yes. Row-level access was in SEPostgreSQL's drafts but after many discuss
On 06/22/2012 07:36 PM, Andreas wrote:
Hi,
is there a way to limit access for some users only to certain records?
e.g. there is a customer table and there are account-managers.
Could I limit account-manager #1 so that he only can access customers
only acording to a flag?
What you describe is
Andreas writes:
> Hi,
>
> is there a way to limit access for some users only to certain records?
>
> e.g. there is a customer table and there are account-managers.
> Could I limit account-manager #1 so that he only can access customers
> only acording to a flag?
Maybe something like the followin
HI,
>
> is there a way to limit access for some users only to certain records?
>
> e.g. there is a customer table and there are account-managers.
> Could I limit account-manager #1 so that he only can access customers
> only acording to a flag?
>
> Say I create a relation cu_am ( customer_id,
no,I think there is no such way.
what about create view for the user you want to limit,and revoke select
privilege from the base table ?
2012/6/22 Andreas
> Hi,
>
> is there a way to limit access for some users only to certain records?
>
> e.g. there is a customer table and there are account-ma
Andreas wrote:
> Hi,
>
> is there a way to limit access for some users only to certain records?
>
> e.g. there is a customer table and there are account-managers.
> Could I limit account-manager #1 so that he only can access customers
> only acording to a flag?
Yea, it's possible.
Write funct
Hi,
is there a way to limit access for some users only to certain records?
e.g. there is a customer table and there are account-managers.
Could I limit account-manager #1 so that he only can access customers
only acording to a flag?
Say I create a relation cu_am ( customer_id, account_manage
On 06/13/2012 08:46 AM, John Fabiani wrote:
I have tried to use a user defined data type I created within a schema.
But I could not figure it out.
CREATE OR REPLACE FUNCTION xchromasun._chromasun_totals(date)
RETURNS SETOF xchromasun.weekly_mpr AS
CREATE OR REPLACE FUNCTION xchromasun._chrom
I have tried to use a user defined data type I created within a schema.
But I could not figure it out.
CREATE OR REPLACE FUNCTION xchromasun._chromasun_totals(date)
RETURNS SETOF xchromasun.weekly_mpr AS
CREATE OR REPLACE FUNCTION xchromasun._chromasun_totals(date)
RETURNS SETOF "xchromasu
Hi Sergey
Thats exacly what i was looking for, thanks a million !
Best regards
Jan Eskilsson
2012/6/5 Sergey Konoplev :
> On Mon, Jun 4, 2012 at 4:08 PM, Jan Eskilsson wrote:
>> My problem is that i would like to be able to retrieve a group of
>> records from the hstore table and present them
On Mon, Jun 4, 2012 at 4:08 PM, Jan Eskilsson wrote:
> My problem is that i would like to be able to retrieve a group of
> records from the hstore table and present them in a grid so I would
> like to convert the hstore records back to the original table format.
> In the manual i found an example
Hi all
I log data in a table using a hstore field.
My problem is that i would like to be able to retrieve a group of
records from the hstore table and present them in a grid so I would
like to convert the hstore records back to the original table format.
In the manual i found an example how to c
Hi-
With respect similarity, its a costly operation on CPU based on the cycles
of checking the keyword.
Two words are said to be similar when atleast 2 or more consecutive
characters are at the same. The more the consecutive characters are the
same the more level of similarity.
It would look sim
Hi,
I'm trying to get an idea about pg_trgrm.
I created a GIST index on a text column in a table.
Now I can filter the table with similarity().
How would I group the table so that it shows groups that have similarity
() > x ?
Lets say the table looks like this:
id, txt
1, aa1
2, bb1
3,
On 2012-04-10, JORGE MALDONADO wrote:
> --000e0ce0d2ee43edb104bd553408
> Content-Type: text/plain; charset=ISO-8859-1
>
> I have a table with a varchar field, such a field is HTML ENCODED. So, for
> example, the string "PLAIN WHITE T'S" is saved as "PLAIN WHITE
> T''S" (double quotes are not part
Hello
see
http://postgres.cz/wiki/PostgreSQL_SQL_Tricks#Function_for_decoding_of_url_code
Regards
Pavel Stehule
2012/4/10 JORGE MALDONADO :
> I have a table with a varchar field, such a field is HTML ENCODED. So, for
> example, the string "PLAIN WHITE T'S" is saved as "PLAIN WHITE T''S"
> (dou
I have a table with a varchar field, such a field is HTML ENCODED. So, for
example, the string "PLAIN WHITE T'S" is saved as "PLAIN WHITE
T''S" (double quotes are not part of the string, I use them for
clarity only). I need to perform a SELECT statement on this table and get
the values HTML DECODED
Hello
use a refcursors
http://www.postgresql.org/docs/9.1/static/plpgsql-cursors.html
Regards
Pavel Stehule
2012/4/4 La Chi :
> hi every one
>
> i have created this simple function which returns a column of table , i have
> used simple SELECT statement , i simply want to know how can i achieve
hi every one
i have created this simple function which returns a column of table , i have
used simple SELECT statement , i simply want to know how can i achieve the same
task with the help of cursor
CREATE OR REPLACE FUNCTION foo(id int)
returns table(cust_id int) as
$BODY$
BEGIN
retur
Hello everyone,
i have created this function in which i simply want to display a column values
through a cursor , but unfortunately i am not getting the column values , this
function is showing me simple column name but not the fields in column.
CREATE OR REPLACE FUNCTION foo(id int) returns t
, March 26, 2012 9:08 PM
*Subject:* Re: [SQL] how to concatenate in PostgreSQL
On 03/24/2012 04:43 AM, Rehan Saleem wrote:
hi ,
how can we concatinate these lines and execute sql command
In what? Psql? A PL/pgSQL function. C/Java/PHP/Python/Perl/Erlang/Lua?
setsql = 'select user,use
On 03/24/2012 04:43 AM, Rehan Saleem wrote:
hi ,
how can we concatinate these lines and execute sql command
In what? Psql? A PL/pgSQL function. C/Java/PHP/Python/Perl/Erlang/Lua?
setsql = 'select user,username, firstname '
set sql += ' lastname, cardno from table1 where userid=' +
Hi,
Probably you're looking for these set of articles.
http://wiki.postgresql.org/wiki/Converting_from_other_Databases_to_PostgreSQL#Microsoft_SQL_Server
The second article (by Ethan) has good small hints for things such as
the query that you ask in this thread, when migrating from MSSQL to
P
On 3/24/12, Andreas Kretschmer wrote:
> Rehan Saleem wrote:
>
>> hi ,
>> how can we concatinate these lines and execute sql command
>>
>>set sql = 'select user,username, firstname '
>> set sql += ' lastname, cardno from table1 where userid=' + 5
>
> sql = sql || ' bla fasel';
>
> ||
Rehan Saleem wrote:
> hi ,
> how can we concatinate these lines and execute sql command
>
>set sql = 'select user,username, firstname '
> set sql += ' lastname, cardno from table1 where userid=' + 5
sql = sql || ' bla fasel';
|| is the concat - Operator.
Andreas
--
Really, I
hi ,
how can we concatinate these lines and execute sql command
setsql ='select user,username,
firstname '
set sql +=' lastname, cardno from table1where userid='+ 5
exec(sqi)
where 5 is the userid from table1
thanks
On Fri, Mar 2, 2012 at 3:49 AM, Philip Couling wrote:
> Hi Rehan
>
> I suggest attempting to drop the table before you create the temp table:
> DROP TABLE IF EXISTS table1;
>
> See:
> http://www.postgresql.org/docs/current/static/sql-droptable.html
>
>
> Also if you're using an actual TEMP table,
2012/2/29 Pavel Stehule :
> Hello
>
> the most similar tool in pg is "VACUUM FULL" statemet;
Hello,
From: http://wiki.postgresql.org/wiki/VACUUM_FULL "Many people, either
based on misguided advice on the 'net or on the assumption that it
must be "better", periodically run VACUUM FULL on their tab
Hi Rehan
I suggest attempting to drop the table before you create the temp table:
DROP TABLE IF EXISTS table1;
See:
http://www.postgresql.org/docs/current/static/sql-droptable.html
Also if you're using an actual TEMP table, PostgreSQL can automatically
drop the table or just empty it once the t
hi everyone ,
how can i create temp table say table1 with three column of types varchar , int
and int, inside the function body and if that same table already exist it
should drop that already existing table(table1) , and on every run this process
should run. and how can i insert values from pos
Hello
the most similar tool in pg is "VACUUM FULL" statemet;
Regards
Pavel Stehule
2012/2/29 Rehan Saleem :
> hi ,
> how can i shrink database in postgresql here is a MS-SQL store procedure
> which shrinks the database. how same task can be achieved in postgresql.
>
> ALTER PROCEDURE [dbo].[sp_
hi ,
how can i shrink database in postgresql here is a MS-SQL store procedure which
shrinks the database. how same task can be achieved in postgresql.
ALTER PROCEDURE [dbo].[sp_CleanUpDB]
AS
declare @db nvarchar(50)
select @db = db_name()
DBCC SHRINKDATABASE (@db, 10)
thanks
Tirsdag 28. februar 2012 12.56.46 skrev Rehan Saleem :
> hi ,
> whats wrong with this function , i am getting syntax error which is syntax
> error at or near "+=" LINE 13: set sql += ' bpoverlap, centredistance
You can't concatenate that way in plpgsql. Instead of "set sql +=" try with
just "||
ce<>'')
set sql += ' and (centredistance<=' + centre_distance + ' or ' +
centre_distance + '=1) '
set sql += ' order by chr_u, start_u'
exec(sql)
end;
$BODY$
language plpgsql;
Fr
;
$BODY$
language plpgsql;
From: Filip Rembiałkowski
To: Rehan Saleem
Cc: "pgsql-sql@postgresql.org"
Sent: Tuesday, February 28, 2012 3:36 PM
Subject: Re: [SQL] How to convert SQL store procedure to Postgresql function
On Tue, Feb 28, 2012 at
On Tue, Feb 28, 2012 at 9:50 AM, Rehan Saleem wrote:
> hi ,
> how can i convert this sql store procedure to postgresql function , i shall
> be very thankful to you, as i am new to postgresql and i dont know how to
> handle this kind of store procedure in postgresql
Most people handle this with u
hi ,
how can i convert this sql store procedure to postgresql function , i shall be
very thankful to you, as i am new to postgresql and i dont know how to handle
this kind of store procedure in postgresql
thanks
ALTERPROCEDURE [dbo].[sp_GetUserByID]
@UserId varchar(50),
@KBId varch
On 2012-02-20, Andreas wrote:
> Hi,
> is there a way to split up phone numbers?
several. I wouldn't trust a computer to do any of them.
> I know that's a tricky topic and it depends on the national phone number
> format.
> I'm especially interested in a solution for Germany, Swizerland and Aust
(anonymous) wrote:
> is there a way to split up phone numbers?
> I know that's a tricky topic and it depends on the national
> phone number format.
> I'm especially interested in a solution for Germany, Swizerland and Austria.
> I've got everything in a phone number column that makes hardly sense
At 2012-02-20 15:50, Andreas wrote:
Hi,
is there a way to split up phone numbers?
I know that's a tricky topic and it depends on the national phone
number format.
I'm especially interested in a solution for Germany, Swizerland and
Austria.
I've got everything in a phone number column that mak
Hi,
is there a way to split up phone numbers?
I know that's a tricky topic and it depends on the national phone number
format.
I'm especially interested in a solution for Germany, Swizerland and Austria.
I've got everything in a phone number column that makes hardly sense like:
+49432156780
004
On 01/22/2012 06:09 AM, Rehan Saleem wrote:
hi , i have created this function
CREATE OR REPLACE FUNCTION totaloverlapcount(user_id integer , bg
integer ,center_distance integer)
RETURNS varchar AS $$
DECLARE percentage record;
BEGIN
select fname, lname, count(userid) totalcount
,100.00*co
Hello
2012/1/22 Rehan Saleem :
> hi , i have created this function
>
> CREATE OR REPLACE FUNCTION totaloverlapcount(user_id integer , bg integer
> ,center_distance integer)
> RETURNS varchar AS $$
>
> DECLARE percentage record;
> BEGIN
>
>
>
> select fname, lname, count(userid) totalcount
> ,100.0
hi , i have created this function
CREATE OR REPLACE FUNCTION totaloverlapcount(user_id integer , bg integer
,center_distance integer)
RETURNS varchar AS $$
DECLARE percentage record;
BEGIN
select fname, lname, count(userid) totalcount
,100.00*count(useriddetails)/totaluser into percentage
On Thu, Jan 19, 2012 at 1:57 AM, Rehan Saleem wrote:
> hi ,
>
> how can i return the whole user table from this function not just the id .
> thanks
>
> Chapter 39, specifically 39.3, of the postgresql documentation provides
all of the information necessary to answer this question. If, after
rea
hi ,
how can i return the whole user table from this function not just the id .
thanks
CREATE TABLE users(id serial PRIMARY KEY, first_name varchar(10), last_name
varchar(10)); CREATE OR REPLACE FUNCTION new_user(fname varchar, lname varchar)
RETURNS int AS $$
DECLARE r int;
BEGIN -- custom except
I wonder how to implement Aggregate Awareness or Transparent Aggregate
Navigation in PostgreSQL?
Simply put, when Transparent (to the reporting tool) Aggregate Navigator
recognizes that a query would execute faster using aggregates, it automatically
rewrites the query so that the database hits
-
From: pgsql-sql-ow...@postgresql.org [mailto:pgsql-sql-ow...@postgresql.org] On
Behalf Of Olgierd Michalak
Sent: Monday, November 07, 2011 1:25 PM
To: Craig Ringer
Cc: pgsql-sql@postgresql.org
Subject: Re: [SQL] How to implement Aggregate Awareness?
> Simply put, when Transparent (to the re
> Simply put, when Transparent (to the reporting tool) Aggregate Navigator
> recognizes that a query would execute faster using aggregates, it
> automatically rewrites the query so that the database hits the smaller
> aggregates rather than larger detail tables upon which the small
> aggregates are
On 11/05/2011 05:03 AM, Olgierd Michalak wrote:
Simply put, when Transparent (to the reporting tool) Aggregate Navigator
recognizes that a query would execute faster using aggregates, it
automatically rewrites the query so that the database hits the smaller
aggregates rather than larger detail t
I wonder how to implement Aggregate Awareness or Transparent Aggregate
Navigation in PostgreSQL?
Simply put, when Transparent (to the reporting tool) Aggregate Navigator
recognizes that a query would execute faster using aggregates, it automatically
rewrites the query so that the database hits
On Oct 25, 2011, at 7:12 AM, alan wrote:
> I'm new to postgres and was wondering how to use EXPLAIN ANALYZE
>
> Can I use the output from ANALYZE EXPLAIN to estimate or predict the
> actual time
> it would take for a given query to return?
>
> I ask because I'm writing a typical web app tha
I need write a query like this
select coalesce_agg(col order by col asc) from some_table group by other_col
clearly the col column is nullable.
which is the best way (in terms of performance too) to obtain this?
Are there any built-in aggregate function or should I write a new aggregate
function
I'm new to postgres and was wondering how to use EXPLAIN ANALYZE
Can I use the output from ANALYZE EXPLAIN to estimate or predict the
actual time
it would take for a given query to return?
I ask because I'm writing a typical web app that allows the user to
build and submit a query
to my DB.
On 19/10/11 22:08, Rich wrote:
> I have a mumps database with an ODBC connection so I can write queries
> from other databases. How can I write a sql in Postgresql to access
> this table to use in my Postgresql reports?
Use dbi-link to make an ODBC connection to the other database. Either
copy th
I have a mumps database with an ODBC connection so I can write queries from
other databases. How can I write a sql in Postgresql to access this table
to use in my Postgresql reports?
On 10/21/2011 09:36 PM, Emi Lu wrote:
Good morning,
Is there a way to temporally disabled foreign key constraints something
like
SET FOREIGN_KEY_CHECKS=0
When population is done, will set FOREIGN_KEY_CHECKS=1
If you really, really want to do this you can do it by disabling the
triggers tha
Emi Lu wrote on 21.10.2011 15:36:
Good morning,
Is there a way to temporally disabled foreign key constraints something like
SET FOREIGN_KEY_CHECKS=0
When population is done, will set FOREIGN_KEY_CHECKS=1
Thanks a lot!
Emi
You can define the FKs as "DEFERRABLE INITIALLY IMMEDIATE".
Then a
evedo Cristina wrote:
Something like
ALTER TABLE t_yourtable DROP CONSTRAINT
and then
ALTER TABLE t_yourtable ADD FOREIGN KEY
?
Best,
Oliveiros
- Original Message - From: "Emi Lu"
To:
Sent: Friday, October 21, 2011 2:36 PM
Subject: [SQL] how to temporally disable foreign key co
Something like
ALTER TABLE t_yourtable DROP CONSTRAINT
and then
ALTER TABLE t_yourtable ADD FOREIGN KEY
?
Best,
Oliveiros
- Original Message -
From: "Emi Lu"
To:
Sent: Friday, October 21, 2011 2:36 PM
Subject: [SQL] how to temporally disable foreign key constraint che
Good morning,
Is there a way to temporally disabled foreign key constraints something
like
SET FOREIGN_KEY_CHECKS=0
When population is done, will set FOREIGN_KEY_CHECKS=1
Thanks a lot!
Emi
--
Emi Lu, ENCS, Concordia University, Montreal H3G 1M8
em...@encs.concordia.ca+1 514 848-242
I have references to dblink. I just installed 9.1.1.1 on windows server
2008 R2 and did a search on the file dblink.sql and cannot find it. I used
the one click installer from enterprisedb.
1. Where is the dblink.sql file or does it not exist anymore and the
integration into postgresql has chan
Hi.
If you have 9.1, then exist foreign wrapper odbc_fdw, you may try it.
2011/10/19, Rich :
>>
>> I have a mumps database with an ODBC connection so I can write queries
>> from
>> this database. How can I write a sql in Postgresql to access this
>> database
>> to use in my Postgresql reports?
>
On Wed, Oct 19, 2011 at 9:19 AM, Rich wrote:
>> I have a mumps database with an ODBC connection so I can write queries
>> from this database. How can I write a sql in Postgresql to access this
>> database to use in my Postgresql reports?
dblink lets one pg server access another via SQL, dbilink
>
> I have a mumps database with an ODBC connection so I can write queries from
> this database. How can I write a sql in Postgresql to access this database
> to use in my Postgresql reports?
>
On 09/26/2011 06:31 PM, Andreas wrote:
How could I calculate differences of timestamps in a log-table?
Table log ( user_id integer, login boolean, ts timestamp )
So login = true would be a login-event and login = false a logout.
Is there a way to find the matching login/logout to calculate the
(anonymous) wrote:
> How could I calculate differences of timestamps in a log-table?
> Table log ( user_id integer, login boolean, ts timestamp )
> So login = true would be a login-event and login = false a logout.
> Is there a way to find the matching login/logout to
> calculate the difference?
1 - 100 of 1254 matches
Mail list logo