> If you are in psql, you can cancel any query with CTRL-C. Otherwise,
> > you can kill the process running the query using the "kill" command. If
> > that doesn't work you can kill (but not -9!) the backend process
> > handling your query.
> >
> > &
On Wednesday 10 March 2004 10:23 am, Jander wrote:
>I have a application with a lof of reports. I need to
> break a report in Run Time. How can I do this?
>
Could you clarify what you mean by "break a report in run time"?
--
Jonathan Gardn
aranteed that the data won't violate the
boss's idea of what the pk should be.
--
Jonathan Gardner
[EMAIL PROTECTED]
---(end of broadcast)---
TIP 6: Have you searched our list archives?
http://archives.postgresql.org
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
On Tuesday 24 February 2004 01:48 pm, Robert Treat wrote:
> On Tue, 2004-02-24 at 12:11, Richard Huxton wrote:
> > On Tuesday 24 February 2004 16:11, Jonathan M. Gardner wrote:
> > > I've written a summary of my findings on implementing and using
> > >
t statement? If not, what is an
> alternative to insert a single row at a time?
>
I'm not too sure on what you want, but I'll guess.
INSERT INTO test_table
(int_id, cust_id, cust_name)
SELECT
1, id, name
FROM customer;
Does this do what you want?
- --
Jonathan Gardner <[
the trigger order), but the
> trigger order is still strange for me:
>
I'd need some solid code to solve this. Can you send the create
statements and the insert statement that started it all? I get the
feeling that you may have more triggers than you really need.
- --
Jonathan Gardner &
e. If a trigger
triggers another trigger, they aren't dependant on the order thereof,
or even the existance of the other trigger.
You may also want to examine PostgreSQL's RULE system (CREATE RULE). I
think some of your triggers may be interchangeable with rules.
- --
Jonathan Gardner
he "How to optimize this query ?"
thread.
If you want more details, check the pgsql-performance archives.
- --
Jonathan Gardner <[EMAIL PROTECTED]>
Live Free, Use Linux!
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.2.1 (GNU/Linux)
iD8DBQE/OlBBWgwF3QvpWNwR
pg_trigger table. The way PostgreSQL
manages the foreign key references is through triggers. You may be able
to identify which triggers are which, and from there, determine which
tables are referencing which tables.
- --
Jonathan Gardner <[EMAIL PROTECTED]
his to the postgresql-performance list. They love taking things
apart and getting it running faster. They'll want:
- - The tables
- - The indexes
- - The queries
- - The results of EXPLAIN and EXPLAIN ANALYZE on the queries
- - What you have already tried and what seems to work and what doesn
ers and altered the table to have the foreign keys to remedy
this.
- --
Jonathan Gardner <[EMAIL PROTECTED]>
Live Free, Use Linux!
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.2.1 (GNU/Linux)
iD8DBQE/M9BAWgwF3QvpWNwRAmrKAKDrkW914nrOqiUm4D9JCYsmD982awCfYh3T
pvdmcoJfo0f/bIFubyMUfbs=
=yzi0
-
?
>
Post this question it the interfaces list. I am sure they would be more
helpful.
- --
Jonathan Gardner <[EMAIL PROTECTED]>
Live Free, Use Linux!
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.2.1 (GNU/Linux)
iD8DBQE/M84pWgwF3QvpWNwRAnOiAKC9t3rZNve8KyOgXyxMG/p75OxkTwCeP+Tv
ZYuv
to group it
by. Note that date_part can give you interesting groupings (all the
Decembers, all the 1st of the months, all the Fridays, etc...)
If you want to run through it several times, you can have a sub-select in the
from clause. You could also save the results in a temp table.
- --
J
he different explain plans that were generated. If you know
what it is, you may also want to attach the relevant statistics from the
pg_stats table. They will be most helpful.
- --
Jonathan Gardner <[EMAIL PROTECTED]>
Live Free, Use Linux!
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.2.1 (G
- column2 (the table/column that is the primary key being
reference)
EXECUTE ''SELECT $3 FROM $2 WHERE $3=NEW.$1'';
IF FOUND
THEN RETURN NEW
RAISE ERROR ''Foreign key violation.'';
RETURN;
END'
LANGUAGE 'plpgsql';
- --
ation 'temp_table'
> already exists.
>
So drop the table when you are done with it.
You may also want to investigate returning a table of data, rather than a
cursor or a single row. I am not too sure on how this would work exactly
because I have never done it. Someone else may b
ert your data over to the new design.
- --
Jonathan Gardner <[EMAIL PROTECTED]>
(was [EMAIL PROTECTED])
Live Free, Use Linux!
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.2.1 (GNU/Linux)
iD8DBQE++HBcWgwF3QvpWNwRAgjPAJ48syjGQahHvU4zi38WVheFbVFC5ACfQw5S
0qO67ZB2ToO
will pass back all the
data you need. You get a free transaction block inside the stored procedure
as well.
- --
Jonathan Gardner <[EMAIL PROTECTED]>
(was [EMAIL PROTECTED])
Live Free, Use Linux!
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.2.1 (GNU/Linux)
iD8
go for a server-side solution (because the application doesn't know
what was last inserted and when), then you'll want to use triggers as I
described in a previous posting.
- --
Jonathan Gardner <[EMAIL PROTECTED]>
(was [EMAIL PROTECTED])
Live Free, Use Linux!
-BEGIN PGP
omer
FOR EACH ROW EXECUTE PROCEDURE notify_on_update();
Now you set up your application to watch for the notification. When it
receives the notification, if can update the displayed information.
Is this a good starting place?
- --
Jonathan Gardner <[EMAIL PROTECTED]>
(was [E
tainly possible with PostgreSQL, it is a bit
more complicated.
And remember, while your database server is small now, it will grow, and grow,
and grow, and grow. It will one day become the bottleneck in your operations.
That is an inevitable fact of any dynamic website.
- --
Jonathan Gardner <
On Monday 02 June 2003 00:49, listrec wrote:
> How about:
>
> select max(transaction_id) from bank_account group by customer_id
>
And if you want the rest of the data in the rows:
SELECT b.*
FROM bank_account b
JOIN (
SELECT max(transaction_id) AS transaction_id
FROM bank_account
FROM bank_account
GROUP BY customer_id
) AS subselect ON subselect.transaction_id=b.transaction_id
;
I use a similar query here at work to find the first time a guy has visited
our site through an advertiser.
--
Jonathan Gardner <[EMAIL PROTECTED]>
(was [EMAIL PROTECTED])
Li
23 matches
Mail list logo