In response to Vincenzo Romano :
> 2010/1/29 ?? :
> > Hi!
> >
> > In C Language, there is a way to format float numbers into a hex string by
> > using "%a" in printf.
> > eg:
> > the value: 1.2345 can be expressed as '0x1.3c083126e978dp+0' which is the
> > hex representation of a float number.
2010/1/29 Pierre Chevalier :
> Pavel Stehule claviota:
>>>
>>> Nut... Idea! (careful...) what about if we do, just like in a VIEW, a
>>> CREATE
>>> OR REPLACE, systematically when we do this kind of function? The only
>>> drawback I can think of is that we can't have anything dependant on the
>>> V
2010/1/29 沈雷 :
> Hi!
>
> In C Language, there is a way to format float numbers into a hex string by
> using "%a" in printf.
> eg:
> the value: 1.2345 can be expressed as '0x1.3c083126e978dp+0' which is the
> hex representation of a float number.
>
> I have tried this in Postgres:
> SELECT '0x1.3c08
Andy Colson claviota:
...
> be happy to post a little "get you started" code if you wanted.
here's some code, its based on Pavel's example, and dumps csv to stdout:
Hmm, pretty cryptic to my eyes...
Thanks for not writing everything on one line!
#!/usr/bin/perl
use strict;
use warnings;
use
Andy Colson claviota:
Ach! Too bad... Oh but... I used to program in C, long time ago, on
HP-UX...
How do you feel about a little perl?
Hm, I am not too familiar with perl. That's the least I can say. But,
after all, why not?
It would be pretty simple, and could generate a csv
Actually,
The following query's all work fine,
select distinct zoa_metar_xml.stn_id, zoa_metar_xml.metar_txt,
zoa_metar_xml.time, zoa_metar_xml.flt_cat, zoa_metar_xml.cld_cvr,
zoa_metar_xml.cld_base, zoa_metar_xml.lonlat, zoa_metar_xml.geom from
zoa_metar_xml;
select distinct id, kml, type, min_hgt, max_hg
On Jan 28, 4:32 pm, Nick wrote:
> The following query's all work fine,
>
> select distinct zoa_metar_xml.stn_id, zoa_metar_xml.metar_txt,
> zoa_metar_xml.time, zoa_metar_xml.flt_cat, zoa_metar_xml.cld_cvr,
> zoa_metar_xml.cld_base, zoa_metar_xml.lonlat, zoa_metar_xml.geom from
> zoa_metar_xml;
>
>
Pavel Stehule claviota:
Nut... Idea! (careful...) what about if we do, just like in a VIEW, a CREATE
OR REPLACE, systematically when we do this kind of function? The only
drawback I can think of is that we can't have anything dependant on the VIEW
we generate.
no, you cannot do it. You cann
Hi!
In C Language, there is a way to format float numbers into a hex string by
using "%a" in printf.
eg:
the value: 1.2345 can be expressed as '0x1.3c083126e978dp+0' which is the
hex representation of a float number.
I have tried this in Postgres:
SELECT '0x1.3c083126e978dp+0'::float;
float8
---
select ts_rewrite(
to_tsquery('java:A & cola & java:AB'),
'java:AB'::tsquery,
'java:AB'::tsquery);
ts_rewrite
'cola' & 'java':AB & 'java':AB
Is this the expected (documented) result?
I found this while looking for a way to build up a tsquery directly
in it
Vijay Sharma wrote:
> How can i update all the fields of a view from a table(this is table
> different from the table which has created the view)?
> I don't want to specify the name of the columns in the commands
> e.g i want to do something like this
>
> UPDATE any_view SET (SELECT * FROM any_vie
To reproduce the problem, here is some simple steps to follow :
(1) create database named "tutorial"
(2) perform the following SQL query :
CREATE TABLE impressions_by_day (
advertiser_id SERIAL NOT NULL,
day DATE NOT NULL DEFAULT CURRENT_DATE,
impressions INTEGER NOT NULL
Sorry. I didn't get all your points.
"defining a primary key constraint implicitly creates an index" - Yup. I agree
on this. But what is the purpose, for author to explicitly define index for day?
CREATE INDEX impressions_by_day_y2012m3ms2_day ON impressions_by_day_y2012m3ms2
(day);
Isn't the
How can i update all the fields of a view from a table(this is table
different from the table which has created the view)?
I don't want to specify the name of the columns in the commands
e.g i want to do something like this
UPDATE any_view SET (SELECT * FROM any_view) = (SELECT * FROM
another_ta
On Thu, 2010-01-28 at 22:45 +, Mike Bresnahan wrote:
> I can understand that I will not get as much performance out of a EC2 instance
> as a dedicated server, but I don't understand why top(1) is showing 50% CPU
> utilization.
One possible cause is lock contention, but I don't know if that exp
I have a problem with fetching from cursors sometimes taking an
extremely long time to run. I am attempting to use the
statement_timeout parameter to limit the runtime on these.
PostgreSQL 8.2.4
Linux 2.6.22.14-72.fc6 #1 SMP Wed Nov 21 13:44:07 EST 2007 i686 i686
i386 GNU/Linux
begin;
set searc
Greg Smith 2ndquadrant.com> writes:
> Looks to me like you're running into a general memory bandwidth issue
> here, possibly one that's made a bit worse by how pgbench works. It's a
> somewhat funky workload Linux systems aren't always happy with, although
> one of your tests had the right co
Scott Ribe writes:
> Given that t2.id is the primary key, grouping by any other column of t2 is
> really redundant. I know *what* SQL won't allow me to do, I'm interested in
> knowing if there's some reason *why* other than historical...
SQL92 says so. More recent versions of the SQL spec descri
> -Original Message-
> From: pgsql-general-ow...@postgresql.org [mailto:pgsql-general-
> ow...@postgresql.org] On Behalf Of Scott Ribe
> Sent: Thursday, January 28, 2010 2:10 PM
> To: Thom Brown
> Cc: pgsql-general
> Subject: Re: [GENERAL] SQL question re aggregates & joins
>
> > You can't
On Thursday 28 January 2010 2:23:26 pm Frank Church wrote:
> I have to this to extract formated times from timestamps, but I
> suspect there is something much better, even if it uses a stored
> procedure. The lpad command to is also funny because I have to
> concatenate it with an empty quote to c
I have to this to extract formated times from timestamps, but I
suspect there is something much better, even if it uses a stored
procedure. The lpad command to is also funny because I have to
concatenate it with an empty quote to convert the output to a string.
select lpad(extract(hour from calld
> You can't include an aggregate in the select if you don't group by
> non-aggregates, so it should be:
>
> select max(t1."When"), t1."Pt_Id", t2."DateOfBirth"
> from "PtStaffAccess" t1, "Person" t2
> where t1."Pt_Id" = t2.id
> group by t1."Pt_Id", t2."DateOfBirth";
I was aware that I could alter
Mike Bresnahan wrote:
I have deployed PostgresSQL 8.4.1 on a Fedora 9 c1.xlarge (8x1 cores) instance
in the Amazon E2 Cloud. When I run pgbench in read-only mode (-S) on a small
database, I am unable to peg the CPUs no matter how many clients I throw at it.
In fact, the CPU utilization never drop
On 28 January 2010 21:32, Scott Ribe wrote:
> OK, this does not work:
>
> select max(t1."When"), t1."Pt_Id", t2."DateOfBirth"
> from "PtStaffAccess" t1, "Person" t2
> where t1."Pt_Id" = t2.id
> group by t1."Pt_Id";
>
> But this does:
>
> select max(t1."When"), t1."Pt_Id", min(t2."DateOfBirth")
>
OK, this does not work:
select max(t1."When"), t1."Pt_Id", t2."DateOfBirth"
from "PtStaffAccess" t1, "Person" t2
where t1."Pt_Id" = t2.id
group by t1."Pt_Id";
But this does:
select max(t1."When"), t1."Pt_Id", min(t2."DateOfBirth")
from "PtStaffAccess" t1, "Person" t2
where t1."Pt_Id" = t2.id
gro
Jim Mlodgenski gmail.com> writes:
> Let's start from the beginning. Have you tuned your postgresql.conf file? What
do you have shared_buffers set to? That would have the biggest effect on a test
like this.
shared_buffers = 128MB
maintenance_work_mem = 256MB
checkpoint_segments = 20
--
Sent v
On 01/28/2010 08:57 AM, Andy Colson wrote:
>>
>> How do you feel about a little perl? It would be pretty simple, and
>> could generate a csv based on any resultset (any number of columns). I'd
>> be happy to post a little get you started code if you wanted.
If you're going to go through all that,
On 1/28/2010 9:11 AM, Andy Colson wrote:
On 1/27/2010 3:49 AM, Pierre Chevalier wrote:
Pavel Stehule claviota:
...
But what I would like to do is to redirect the output of the function
(that
is, the 'result' cursor) to a view, which will be used in other
places. I
thought something like FETCH I
So how can emedded SQL in C to get the record type which returning from
plpgsql function?
I have tested as following code:
CREATE OR REPLACE FUNCTION test4(IN a integer, OUT b int,OUT c int)
AS
$BODY$
Declare
begin b:=100;
c:=200;
return;
END $BODY$
LANGUAGE 'plpgsql' VOLATILE
Hi,
an XATMI C API should be added to the PostgresQL C client, so one could run
XA transactions under control of a TX monitor. An interesting usecase would
be to use PostgresQL together with the LGPL open source JBoss Blacktie
transaction manager (http://www.jboss.org/blacktie.html)
c.f.
http://
any other clue about this problem ?? Have anybody seen the same problem ??
Greg Stark-5 wrote:
>
> On Fri, Dec 18, 2009 at 6:59 PM, tamanna madaan
> wrote:
>> I am using postgres-8.1.2 and slony-1.1.5 for replication.
>>
>
> I don't know about your Slony problems but the current bug-fix rele
On Thu, Jan 28, 2010 at 11:36:55AM +0600, AI Rumman wrote:
>I am getting the error:
>
>
>LINE 1: select dblink_connect('dbname=postgres');
> ^
>HINT: No function matches the given name an
=?GB2312?B?1cW6o7fl?= writes:
> And i call function a by jdbc:
> ...
> conn.setAutoCommit(false);
> CallableStatement cs = conn.prepareCall("{ call a( ?, ? ) }");
> cs.registerOutParameter(1, Types.INTEGER);
> cs.registerOutParameter(2, Types.OTHER);
> cs.execute();
That's not the approved syntax
On 1/27/2010 3:49 AM, Pierre Chevalier wrote:
Pavel Stehule claviota:
...
But what I would like to do is to redirect the output of the function
(that
is, the 'result' cursor) to a view, which will be used in other
places. I
thought something like FETCH INTO would do the trick, but it doesn't.
Actually, the real function name is t_outer and t_inner, a and b is
just for convenience.
So you can see them as
CREATE OR REPLACE FUNCTION a (out ...
and
CREATE OR REPLACE FUNCTION b (out ...
And i call function a by jdbc:
...
conn.setAutoCommit(false);
CallableStatement cs = conn.prepareCall("{
Would it be possible without writing a very long tsquery to exploit
the index to retrieve the tsvectors that contain at least N lexemes?
If not exploiting the index... any suggestion to improve performance
of such a query?
computing rank still requires retrieving a lot of tsvectors and
compute th
On 28/01/2010 07:32, 张海峰 wrote:
> i have 2 functions, naming a and b, both outputing a resultset(cursor)
> and a integer.
> a calls b
>
> a:
> CREATE OR REPLACE FUNCTION "public"."t_outer" (out o_rs
> "pg_catalog"."refcursor", out o_i integer) RETURNS record AS
> ...
> select t_inner(o_rs, o_i);
>
On 28 Jan 2010, at 2:10, Yan Cheng Cheok wrote:
>>> EXECUTE 'CREATE TABLE ' ||
>> quote_ident(measurement_table_name) || '
>>> (
>>> CONSTRAINT
>> pk_measurement_id_' || measurement_table_index || ' PRIMARY
>> KEY (measurement_id),
>>> CONSTRAINT
>> fk_unit_id_'
38 matches
Mail list logo