I have the following case: a simple table
drop table test_data;
create table test_data (
id bigserial not null primary key,
content varchar(50),
processed varchar(1)
);
My function doing the inserts
CREATE OR REPLACE FUNCTION populate_test_data(IN nr_records BIGINT, IN proc_nr
BIGINT) RETURNS i
Hi to all,
I have a table:
create table hoy(
id serial,
pass varchar(40),
pass_md5 varchar(40);
Now, I want to write a trigger function that
automatically updates the pass_md5 with the md5 function of the pass.
I tried this:
CREATE FUNCTION update_pass(integer) RETURNS
integer AS
Hi,
I have a table:CREATE TABLE werke1(id SERIAL,id_hr int4 NOT NULL,id_wk int4 NOT NULL);
CREATE TABLE contact(id SERIAL,type
varchar(20),
);
Now id_hr and id_wk are all referencing the same
table contact(id). In the contact table I have another column called type.
How can I write
gards,
Andy.
- Original Message -
From: "Greg Stark" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Cc: "Richard Huxton" ; "Andrei Bintintan"
<[EMAIL PROTECTED]>; ;
Sent: Tuesday, January 25, 2005 8:28 PM
Subject: Re: [PERFORM] [SQL] OFFSET imp
DIGGING for solutions.
Andy.
- Original Message -
From: "Ragnar Hafstað" <[EMAIL PROTECTED]>
To:
Cc: "Andrei Bintintan" <[EMAIL PROTECTED]>;
Sent: Thursday, January 20, 2005 9:23 PM
Subject: Re: [PERFORM] [SQL] OFFSET impact on Performance???
On Thu, 2005-01-
If you're using this to provide "pages" of results, could you use a
cursor?
What do you mean by that? Cursor?
Yes I'm using this to provide "pages", but If I jump to the last pages it
goes very slow.
Andy.
- Original Message -
From: "Richard Huxt
Hi to all, I have the following 2 examples. Now,
regarding on the offset if it is small(10) or big(>5) what is the impact
on the performance of the query?? I noticed that if I return more
data's(columns) or if I make more joins then the query runs even
slower if the OFFSET is bigger. Ho
chael Fuhr" <[EMAIL PROTECTED]>
To: "Andrei Bintintan" <[EMAIL PROTECTED]>
Cc:
Sent: Thursday, January 20, 2005 11:33 AM
Subject: Re: [SQL] SQL timestamp to date cast
On Thu, Jan 20, 2005 at 10:52:50AM +0200, Andrei Bintintan wrote:
SELECT DISTINCT(nummer)
FROM user_action
Hi,
I have the following query:
SELECT DISTINCT(nummer) FROM user_action WHERE
datetime::date='11/11/2004' AND id_action IN (5,6,9)
Now, datetime has the type timestamp. How can I
make an index or write different this query so that it runs faster? It really
takes some time sometimes.
EMAIL PROTECTED]>; "Theodore Petrosky" <[EMAIL PROTECTED]>; "Andrei
Bintintan" <[EMAIL PROTECTED]>; "sad" <[EMAIL PROTECTED]>
Sent: Wednesday, November 10, 2004 12:58 PM
Subject: Re: [SQL] A transaction in transaction? Possible?
> O Mich
Hi to all, I have the problem that:
select lower('MöBÜEL') or select upper('MöBÜEL')
are not working well.
I read on some forums that there is some locale
setting that needs to be done here, but could not fix this.
I am using the ASCII encoding.
Please advice.
Thakx.Andy.
Is it possible
to have another transatction in a transaction??? In the following example the
last ROLLBACK is totally ignored(transaction1).
//connect to
database$database
=
dbConnect($dbhost, $dbuser, $dbpass, $dbname);dbExec($database, "BEGIN");
//transaction1//*
dbExec($databa
> 2)if two ore more record have the same value of the maxim value of the
"ora"
> to select oly one of them
At this point you really have to decide which criteria you use for this
deciding.
I strongly suggest to use a uniqe ID for each row in the table(in your case
it is important):
CREATE TABLE
Hi to
all,
I have a database, where in the tables I have
around 100 constrains (link to other tables) that don't have a name
"" or they have a name like "$1" "$2". Now, I have a module which
bases on the same structure, but I get some query errors from a
"" constraint. I really don't know
"Is it safe to use "select max(table1_id) from table1" after the insert?"
Yes it is safe, but ONLY if you use it inside a transaction.(BEGIN/COMMIT).
BR.
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
On Behalf Of mixo
Sent: Wednesday, June 09, 2004 9:24 AM
To: [EM
Hi to all,
I have the following
tables:
CREATE TABLE t1(id serial PRIMARY KEY,active boolean NOT NULL DEFAULT 'y',num int4 NOT NULL,);CREATE
UNIQUE INDEX t1_uniqueidx ON t1(num) WHERE active;
CREATE TABLE t2(id serial PRIMARY KEY,active boolean NOT NULL DEFAULT 'y',num int4 NOT
NULL,);CR
Hi,
I have a
problem.
Let's say I have the
following table:
CREATE
TABLE rekl_element(id
serial PRIMARY KEY,active boolean NOT NULL DEFAULT 'y',num int4 NOT NULL,text
varchar(10));
Now I want that
"num" column is "unique" but only for those columns that have active='y'. For
the col
Hi,
Use the Offset and Limit in the SQL query.
http://developer.postgresql.org/docs/postgres/queries-limit.html
For example:
SELECT select_list
FROM table_expression
WHERE condition
Let's supose that this query returnes normaly 3 elements.
SELECT select_list
FROM table_expressi
Hi Stef,
Your problem depends on what interface/programming language you're using.
In a Begin End transaction you will have to verify if the returned data is
good for you so then you decide if you run at the end "COMMIT" or
"ROLLBACK".
In php (and where is compatible) I suggest this:
//this is p
But... search the forums, or hope that somedoby else answers also.
Best regards,
Andy.
- Original Message -
From: "Theodore Petrosky" <[EMAIL PROTECTED]>
To: "Andrei Bintintan" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Thursday, May 06, 2004 2:46
I suggest to store the images on the disc and write in the db only the path.
I am using the same solution. The only problem is that I have to make the
backups separately(in my case). Also this helps more in accessing the
images, you don't have to access for each image the database, you just have
to
I would go for the second one. I think the size of the table is not a
problem. You will have just to write the right indexes for easy joins.
OBS: " For one assessment, I'll store 60 rows with only two useful integers
in it" ... why? Better make a "lab_test" table where you have the tab tests
and y
You say that you're running Suse 8.
You can also start the process with that Yast.
Start Yast2 -> System -> Runlevel Editor-> and then you can select the
runlevel when you want that postgre starts. I start it at runlevel 3.
If you installed postgre it manually you have a little work to do, probabl
Hi to all,
I have a big question.
Can I write a query/function/agregate function
(whatever) so that I can return the result of a query in a single line? I
don't know if this is possible to be made and please if it is not possible
please say.
I better give an example:
table (id, nam
Hi!
Is it possible to use lo_write in SQL? If so, how?
---(end of broadcast)---
TIP 4: Don't 'kill -9' the postmaster
25 matches
Mail list logo