Thanks. That's work pretty well.
--- On Tue, 10/26/10, Alban Hertroys
wrote:
> From: Alban Hertroys
> Subject: Re: [GENERAL] Slow connection once the PC is network connected
> To: "Yan Cheng CHEOK"
> Cc: pgsql-general@postgresql.org
> Date: Tuesday, October 26, 2010, 6:01 PM
> On 26 Oct 2010,
On 31 Oct 2010, at 22:56, Andrus wrote:
> I tried
>
> SELECT (SHOW server_version) AS Contents
postgres=> select version();
version
Hi,
I have two tables (A and B), which are partitioned (A1, A2... B1, B2...) for
easy deletion of old records. They are linked by a bigint column "id", which
is defined as a foreign key in each B partition referencing the
corresponding A partition. Many rows in B1 can reference a single row in A1.
2010/10/31 Andrus :
> I tried
>
> SELECT (SHOW server_version) AS Contents
>
> but got
>
> ERROR: syntax error at or near "server_version" at character 14
>
>
> how to get server version inside select statement ?
>
SELECT current_setting('server_version') AS Contents;
Osvaldo
--
Sent via pgsq
I tried
SELECT (SHOW server_version) AS Contents
but got
ERROR: syntax error at or near "server_version" at character 14
how to get server version inside select statement ?
Andrus.
--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
h
Use the Postgres window functions like rank(); this is what they're for.
http://www.postgresql.org/docs/8.4/interactive/queries-table-expressions.html#QUERIES-WINDOW
-- Darren Duncan
Alexander Farber wrote:
Hello,
I have a card game for each I'd like to introduce weekly tournaments.
I'm going
Hello,
I have a card game for each I'd like to introduce weekly tournaments.
I'm going to save the score (virtual money) won by each player into:
create table pref_money (
id varchar(32) references pref_users,
yw char(7) default to_char(current_timestamp, '
This post is just to record an example of how to use the new window fn's in 8.4
to perform difference-between-row calculations.
To demonstrate, we create a table with 30 rows of data, two columns, one of
which contains the sequence 1..30, the other contains mod(c1,10).
So the table looks like th
On Sun, Oct 31, 2010 at 2:43 AM, AI Rumman wrote:
> I using Postgresql 8.1 and during vacuum at night time, I am getting the
> following log:
> number of page slots needed (2520048) exceeds max_fsm_pages (356656)
> Do I need to increase max_fsm_pages to 2520048? Does it have any bad affect?
No, y
On 31/10/2010 17:28, Alexander Farber wrote:
I've created a function now (below) and can call it as well,
but how can I see it at the psql prompt? Is there a \d command
for that or should I dump the database to see my declarations?
You can do \df public.*, assuming that your function is in the
\df *update*
Alexander Farber wrote:
I've created a function now (below) and can call it as well,
but how can I see it at the psql prompt? Is there a \d command
for that or should I dump the database to see my declarations?
And is my function atomic? I.e. can't it happen, that FOUND
is not true
I've created a function now (below) and can call it as well,
but how can I see it at the psql prompt? Is there a \d command
for that or should I dump the database to see my declarations?
And is my function atomic? I.e. can't it happen, that FOUND
is not true, but then another session calls a INSER
"Paul" writes:
> But there is not such thing in PostgreSQL as empty set as "IN ()" that
> must be
> false, because nothing element may be found in empty set.
> And I thought that instead of "IN ()" I could use "IN (NULL)", but I
> was failed and result was NULL and not FALSE. :(
NULL is
2010/10/31 Paul :
> Tom,
>
> Sunday, October 31, 2010, 9:42:27 PM, you wrote:
>
> TL> Because the SQL standard says so.
>
> But there is not such thing in PostgreSQL as empty set as "IN ()" that
> must be
> false, because nothing element may be found in empty set.
> And I thought that inst
Tom,
Sunday, October 31, 2010, 9:42:27 PM, you wrote:
TL> Because the SQL standard says so.
But there is not such thing in PostgreSQL as empty set as "IN ()" that
must be
false, because nothing element may be found in empty set.
And I thought that instead of "IN ()" I could use "IN (NUL
On 31/10/2010 16:37, Paul wrote:
Please, help me.
Why the condition
SELECT 5 NOT IN (NULL)
returns NULL, but not FALSE (as I thought)?
Because NULL basically means "don't know" - so you don't know whether 5
is there or not.
Ray.
--
Raymond O'Donnell :: Galway :: Ireland
r...@iol.ie
--
Sen
"Paul" writes:
> Why the condition
> SELECT 5 NOT IN (NULL)
> returns NULL, but not FALSE (as I thought)?
Because the SQL standard says so.
If you think of NULL as meaning "unknown", it makes some intuitive
sense: it's unknown whether that unknown value is equal to 5.
re
Please, help me.
Why the condition
SELECT 5 NOT IN (NULL)
returns NULL, but not FALSE (as I thought)?
--
Paul
--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general
On 10/30/2010 4:48 PM, Viktor Bojović wrote:
Hi,
i have very big XML documment which is larger than 50GB and want to
import it into databse, and transform it to relational schema.
When splitting this documment to smaller independent xml documments i
get ~11.1mil XML documents.
I have spent lots o
2010/10/31 Alexander Farber :
> And would a pure SQL-function solution to call
> an INSERT followed by an UPDATE in its body
> and ignoring the error? (don't know how ignore it
> best though, so that I don't ignore other critical errors)
>
You must not ignore errors in SQL - it's not T-SQL :)
Pav
2010/10/31 Alexander Farber :
> Thanks for all the comments.
>
> Do I need to use BEGIN/COMMIT in my plpgsql-function for UPSERT or are
> functions atomic?
If you use a code from documentation, then you don't need explicit
transaction - every SQL run inside outer implicit transaction in
PostgreSQL
[corrected typo, sorry]
And wouldn't a pure SQL-function solution be:
to call an INSERT followed by an UPDATE in its body
and ignoring the error? (don't know how ignore that error
best though, so that I don't ignore other critical errors)
--
Sent via pgsql-general mailing list (pgsql-general@pos
And would a pure SQL-function solution to call
an INSERT followed by an UPDATE in its body
and ignoring the error? (don't know how ignore it
best though, so that I don't ignore other critical errors)
--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your sub
Thanks for all the comments.
Do I need to use BEGIN/COMMIT in my plpgsql-function for UPSERT or are
functions atomic?
Regards
Alex
--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general
Alexander Farber wrote on 31.10.2010 09:22:
Hello Postgres users,
to mimic the MySQL-REPLACE statement I need
to try to UPDATE a record and if that fails - INSERT it.
There is actually an example of this in the PG manual ;)
http://www.postgresql.org/docs/current/static/plpgsql-control-struct
2010/10/31 Dmitriy Igrishin :
> Okay, Pavel, will wait for 9.1 :-)
>
> It is a common case - insert new row if it cannot be updated.
you can find (probably) MERGE statement in 9.1.
Pavel
>
> 2010/10/31 Pavel Stehule
>>
>> Hello
>>
>> 2010/10/31 Dmitriy Igrishin :
>> > Hey Alexander, Pavel
>> >
Okay, Pavel, will wait for 9.1 :-)
It is a common case - insert new row if it cannot be updated.
2010/10/31 Pavel Stehule
> Hello
>
> 2010/10/31 Dmitriy Igrishin :
> > Hey Alexander, Pavel
> >
> > The solution like below should works IMO, but it does not.
> > insert into pref_users(id, first_
Hello
2010/10/31 Dmitriy Igrishin :
> Hey Alexander, Pavel
>
> The solution like below should works IMO, but it does not.
> insert into pref_users(id, first_name, last_name,
> female, avatar, city, last_ip)
> select $1, $2, $3, $4, $5, $6, $7
> where not exists
> (update p
Hey Alexander, Pavel
The solution like below should works IMO, but it does not.
insert into pref_users(id, first_name, last_name,
female, avatar, city, last_ip)
select $1, $2, $3, $4, $5, $6, $7
where not exists
(update pref_users set first_name = $2,
l
2010/10/31 Alexander Farber :
> Thanks Pavel, but I have an SQL procedure and not plpgsql?
it's not possible in sql. But plpgsql is same level like stored
procedures language from mysql.
>
> On Sun, Oct 31, 2010 at 9:34 AM, Pavel Stehule
> wrote:
>>> But how can I detect that the UPDATE has fai
Thanks Pavel, but I have an SQL procedure and not plpgsql?
On Sun, Oct 31, 2010 at 9:34 AM, Pavel Stehule wrote:
>> But how can I detect that the UPDATE has failed in my SQL procedure?
>>
>
> see:
> http://www.postgresql.org/docs/8.4/interactive/plpgsql-control-structures.html
> near to end of p
Hello
2010/10/31 AI Rumman :
> I using Postgresql 8.1 and during vacuum at night time, I am getting the
> following log:
> number of page slots needed (2520048) exceeds max_fsm_pages (356656)
> Do I need to increase max_fsm_pages to 2520048? Does it have any bad affect?
I takes a little more memo
I using Postgresql 8.1 and during vacuum at night time, I am getting the
following log:
number of page slots needed (2520048) exceeds max_fsm_pages (356656)
Do I need to increase max_fsm_pages to 2520048? Does it have any bad affect?
Hello
2010/10/31 Alexander Farber :
> Hello Postgres users,
>
> to mimic the MySQL-REPLACE statement I need
> to try to UPDATE a record and if that fails - INSERT it.
>
> But how can I detect that the UPDATE has failed in my SQL procedure?
>
see:
http://www.postgresql.org/docs/8.4/interactive/pl
Hello Postgres users,
to mimic the MySQL-REPLACE statement I need
to try to UPDATE a record and if that fails - INSERT it.
But how can I detect that the UPDATE has failed in my SQL procedure?
begin transaction;
create table pref_users (
id varchar(32) primary key
35 matches
Mail list logo