Timo Roessner wrote:
and if i try something like:
alter table fragment alter column x type numeric(15,2)
i get an syntax error, so this seems to be no feature in 7.4.1 (didnt
find anything like that in the docs too)
what can i do to solve this? there must be some way in postgresql 7.4.1
2005/5/20, Andrew Hammond <[EMAIL PROTECTED]>:
> The solution to your problem is locking (or concurrency control if you
> prefer). While we're at it, we might as well optimize your statement a
> little too using ORDER BY with LIMIT instead of min().
>
> SELECT id INTO _contacto_id
> FROM contacto
Dear Gurus,
Sorry for upping a 13-month-old thread; please tell if I should've opened
another one.
Here I come again, with another silly join. Please forgive me, but our
queries are built from blocks :)
VERSION: 7.4.6, 7.4.8, 8.0.0rc4 (sorry, no newer installed right now)
ABSTRACT: The fol
Rafa Couto wrote:
2005/5/20, Andrew Hammond <[EMAIL PROTECTED]>:
The solution to your problem is locking (or concurrency control if you
prefer). While we're at it, we might as well optimize your statement a
little too using ORDER BY with LIMIT instead of min().
SELECT id INTO _contacto_id
FRO
Dear Gnanavel,
(please reply to the lists...)
Indeed it works!
Still, I think it's a bug.
As for this solution being a workaround, it's a bit of pain, since the
subselect names (effectively, the included subselects) are not constant.
As for my workaround, I used a condition to not include t
Rafa Couto wrote:
I have got a plpgsql function:
-- BEGIN;
SELECT min(id) INTO _contacto_id FROM contactos
WHERE contactos.operadora_id IS NULL AND contactos.actividad_id
= _actividad_id;
UPDATE contactos SET operadora_id = _operadora_id WHERE id = _contacto_id;
-- COMMI
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Rafa Couto wrote:
> I understand "FOR UPDATE" clause is locking while is selecting rows
> only. It does not secure atomic execution from 'SELECT' to 'UPDATE' in
> next statement. Is not it?
Locks adhere until the transaction ends. I included links to
PostgreSQL 7.4 ...
I'm trying to find a way to drop a table via SQL if it contains 0 rows. Here
was my thought:
CREATE OR REPLACE FUNCTION dropif(text, bool)
RETURNS bool AS
'DECLARE
tblname ALIAS FOR $1;
condition ALIAS FOR $2;
BEGIN
IF (condition) THEN
EXECUTE(\'DROP TABLE "\' || tb
On 5/23/05, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> I am restructuring my DB schema and need help migrating data from 1
> column of an existing table to two new tables. I have some Java code
> that can do this for me, but it's very slow, and I am now hoping I can
> migrate this data with so
This tip was at the end of a message (from Szűcs Gábor).
TIP 9: the planner will ignore your desire to choose an index scan if your
joining column's datatypes do not match
it looks very important, but I cannot understand it. Sound as a small
and easy mistake that can make things go sour
On Tue, 2005-05-24 at 13:26, Alain wrote:
> This tip was at the end of a message (from Szűcs Gábor).
>
> > TIP 9: the planner will ignore your desire to choose an index scan if your
> > joining column's datatypes do not match
>
> it looks very important, but I cannot understand it. Sound as
=?ISO-8859-2?Q?Sz=FBcs_G=E1bor?= <[EMAIL PROTECTED]> writes:
> ABSTRACT: The following query fails.
> SELECT * FROM
> (SELECT a,b FROM cdqp WHERE a=1 AND b=2) AS aa
> NATURAL FULL JOIN
> (SELECT a,b FROM cdqp WHERE a=1 and b=2) AS bb
> WHERE a+b = 3;
Thanks for
Hi.
How can I delete the duplicated records with "DELETE FROM TABLE WHERE..."
clause??
The problem is becouse I have imported data from Dbase (dbf) file, and this
function have not built the Constraint (unique, primary key, ...), and this
function is usually executed.
select * from table1; --id m
How can I delete the duplicated records with "DELETE FROM TABLE WHERE..."
clause??
The problem is becouse I have imported data from Dbase (dbf) file, and
this
function have not built the Constraint (unique, primary key, ...), and
this
function is usually executed.
If you have no primary
The following function takes a table name as a parameter and drops
the table and returns true if there are zero rows (otherwise, it
returns false):
CREATE OR REPLACE FUNCTION dropzero( varchar ) RETURNS bool AS '
DECLARE
zerotable ALIAS FOR $1;
zerocurs refcursor;
rowc
am 24.05.2005, um 17:59:31 -0300 mailte [EMAIL PROTECTED] folgendes:
> Hi.
> How can I delete the duplicated records with "DELETE FROM TABLE WHERE..."
> clause??
Please read http://www.gtsm.com/oscon2003/deletetid.html
Its a very good article about this problem.
Regards, Andreas
--
Andreas Kr
16 matches
Mail list logo