> How do I pull a random sample of either 100 records or 5% of the
> population of a table?
SELECT table.* FROM table
ORDER BY random()
LIMIT n;
Yours,
Laurenz Albe
---(end of broadcast)---
TIP 9: In versions below 8.0, the planner will ignore your
OK, but, how do I set this up to do what I need? I want an insert that would
create a dupe key to be rolled back, and inserts that would not create dupe
keys to be committed.
Tom Lane-2 wrote:
>
> novnov <[EMAIL PROTECTED]> writes:
>> Any clue re my question?
>
> You've placed the INSERT ins
I understand that this has been discussed before, but I was hoping
that somebody might have some fresh ideas on the problem.
I'm using Postgres for my web app, I users that interface with the
database through the app. All records are classified with an industry
and an occupation. Currently permis
novnov <[EMAIL PROTECTED]> writes:
> Any clue re my question?
You've placed the INSERT inside the BEGIN/EXCEPTION block, ergo it's
part of the work to be rolled back on exception.
regards, tom lane
---(end of broadcast)---
T
It's an after trigger.
Any clue re my question?
Alvaro Herrera-7 wrote:
>
> novnov escribió:
>>
>> Inching closer; the following handles the dupe key error but doesn't
>> insert
>> the rows it should either. So, the exception is ending the insert, and
>> not
>> continuing to insert for rows t
novnov escribió:
>
> Inching closer; the following handles the dupe key error but doesn't insert
> the rows it should either. So, the exception is ending the insert, and not
> continuing to insert for rows that don't violate the unique key restraint.
> Is there a way around this or will I need to
"Andrus" <[EMAIL PROTECTED]> writes:
>> I've yet to see a real-world case where a
>> non-merge-joinable full-join condition was really needed.
> I need to eliminate rows containing null value in left side table in full
> join.
> create table iandmed ( ametikoht integer );
> insert into iandmed v
Inching closer; the following handles the dupe key error but doesn't insert
the rows it should either. So, the exception is ending the insert, and not
continuing to insert for rows that don't violate the unique key restraint.
Is there a way around this or will I need to take a different approach?
So, I may have hammered out the basic trigger function. The error trapping
part is a complete mystery to me. I'll post the trigger function below in
the hopes that someone will at least comment on the error handling part.
The error, as expected is 'duplicate key violates unique contraint blah
bla
"madhtr" <[EMAIL PROTECTED]> writes:
> I want to trap an exception and return a -1 no matter WHAT it is ... what do
> i need to replace with?
OTHERS
regards, tom lane
---(end of broadcast)---
TIP 4: Have you searched our l
On Sun, 20 May 2007, madhtr wrote:
How do use hex numbers in psql? I.E.
instead of:
select 16
I want to do
select 0x10
See 4.1.2.3: "SELECT x'1FF'::int"
http://www.postgresql.org/docs/8.2/static/sql-syntax-lexical.html#SQL-SYNTAX-CONSTANTS
Kris Jurka
---(en
> - dblink would allow you to open another connection concurrently
This suggestion worked perfectly, thank you very much.
---(end of broadcast)---
TIP 1: if posting/reading through Usenet, please send an appropriate
subscribe-nomail co
Ben wrote:
> On May 20, 2007, at 3:01 AM, Thomas Lopatic wrote:
> The problem comes when the primary is cannot replicate to the secondary
> but can, for whatever reason, still talk to clients. If a client is told
> something is committed but that commit isn't replicated, you have a
> problem.
Righ
Thomas Lopatic wrote:
>> So what happens in those cases where the primary node gets in trouble
>> but isn't actually dead yet?
>
> Hmmm. Is this really a problem? Couldn't the secondary DRBD node simply
> stop accepting replicated data from the primary node before firing up
> postmaster? Then the
On May 20, 2007, at 3:01 AM, Thomas Lopatic wrote:
So what happens in those cases where the primary node gets in trouble
but isn't actually dead yet?
Hmmm. Is this really a problem?
The problem comes when the primary is cannot replicate to the
secondary but can, for whatever reason, still
sry, one more question ...
I want to trap an exception and return a -1 no matter WHAT it is ... what do
i need to replace with?
create or replace function clrsplit(int4) returns unknown as
$$
BEGIN
delete from split where tkid=$1;
EXCEPTION
WHEN
return -1;
update tk set dtchksp=null wher
hi group :)
How do use hex numbers in psql? I.E.
instead of:
select 16
I want to do
select 0x10
like in c++
I tried doing what this website said
http://www.faqs.org/docs/ppbook/c12119.htm
but it does not work
TY :)
---(end of broadcast)--
On Sun, May 20, 2007 at 12:01:46PM +0200, Thomas Lopatic wrote:
> Hmmm. Is this really a problem? Couldn't the secondary DRBD node simply
> stop accepting replicated data from the primary node before firing up
> postmaster? Then the postmaster on the primary DRBD node would only
> write locally and
> So what happens in those cases where the primary node gets in trouble
> but isn't actually dead yet?
Hmmm. Is this really a problem? Couldn't the secondary DRBD node simply
stop accepting replicated data from the primary node before firing up
postmaster? Then the postmaster on the primary DRBD n
19 matches
Mail list logo