Sent from my iPhone
İ
On 16 Tem 2013, îat 08:24, Tom Lane wrote:
> Stefan Sylla writes:
>> Now I want to use a trigger function to automatically update the column
>> 'id_test1_poly' in tabel 'test1_point':
>
>> /**/
>> create or replace function test1_point_get_id_test1_poly() returns
>> tr
> -Original Message-
> From: pgsql-sql-ow...@postgresql.org [mailto:pgsql-sql-
> ow...@postgresql.org] On Behalf Of ssylla
> Sent: Tuesday, July 16, 2013 3:58 AM
> To: pgsql-sql@postgresql.org
> Subject: Re: [SQL] update column based on postgis query on anther table
&
Hi Tom,
I tried changing the trigger to be BEFORE instead of AFTER:
create trigger test1_point_get_id_test1_poly
before insert or update on test1_point for each row execute procedure
test1_point_get_id_test1_poly();
But the problem persits, the column id_test1_poly remains empty.
Stefan
--
Stefan Sylla writes:
> Now I want to use a trigger function to automatically update the column
> 'id_test1_poly' in tabel 'test1_point':
> /**/
> create or replace function test1_point_get_id_test1_poly() returns
> trigger as $$
> begin
> new.id_test1_poly=test1_point_get_id_test1
Dear list,
This might be a postgis-specific question, but I could not get access to
the postgis mailing list so I will have a try here as my problem might
be related to SQL:
I need to update a column of a table based on a postgis-query function
that involves another table as follows:
Assum
Luca Vernini wrote
> 2013/7/8 David Johnston <
> polobo@
> >
>
>>
>> This may be a pl/pgsql limitation but you should probably provide a
>> complete
>> self-contained example with your attempt so that user-error can be
>> eliminated.
>>
>> David J.
>>
>>
> All right. Here you are a complete exam
2013/7/8 David Johnston
>
> This may be a pl/pgsql limitation but you should probably provide a
> complete
> self-contained example with your attempt so that user-error can be
> eliminated.
>
> David J.
>
>
All right. Here you are a complete example. Just tested it.
Sorry for the long email.
CR
Luca Vernini wrote
> I'm writing a system with havy use of composite types.
> I have a doubt.
>
> I'm writing all in functions with language plpgsql.
> When I read a field from a composite type I must write something like
> this:
> status = ((in_customer.customer_data).customer_status).status_id
>
I'm writing a system with havy use of composite types.
I have a doubt.
I'm writing all in functions with language plpgsql.
When I read a field from a composite type I must write something like this:
status = ((in_customer.customer_data).customer_status).status_id
And this works fine. I need to en
Ben Morrow writes:
> Quoth jorgemal1...@gmail.com (JORGE MALDONADO):
>> I am building an UPDATE query at run-time and one of the fields I want to
>> include in the WHERE condition may repeat several times, I do not know how
>> many.
>>
>> UPDATE table1
>> SET field1 = "some value"
>> WHERE (field
Quoth jorgemal1...@gmail.com (JORGE MALDONADO):
>
> I am building an UPDATE query at run-time and one of the fields I want to
> include in the WHERE condition may repeat several times, I do not know how
> many.
>
> UPDATE table1
> SET field1 = "some value"
> WHERE (field2 = value_1 OR field2 = va
I am building an UPDATE query at run-time and one of the fields I want to
include in the WHERE condition may repeat several times, I do not know how
many.
UPDATE table1
SET field1 = "some value"
WHERE (field2 = value_1 OR field2 = value_2 OR .OR field2 = value_n)
I build such a query using a
Thanks Tom. I'll try it out soon.
Thanks, that makes sense.
On Fri, Feb 22, 2013 at 9:53 PM, Ian Lawrence Barwick wrote:
> 2013/2/23 Ashwin Jayaprakash :
> (...)
> >
> > Q2: What the best way to check if an HSTORE is empty? Is this it
> > "array_length(akeys(data), 1) is null"?
>
> Just a quick answer to your second question: I
Ashwin Jayaprakash writes:
> Hi, here's what I'm trying to do:
>- I have a table that has an HSTORE column
>- I would like to delete some key-vals from it
>- If after deleting key-vals, the HSTORE column is empty, I'd like to
> delete the entire row
> with update_qry as(
> update up
2013/2/23 Ashwin Jayaprakash :
(...)
>
> Q2: What the best way to check if an HSTORE is empty? Is this it
> "array_length(akeys(data), 1) is null"?
Just a quick answer to your second question: I suspect it might be more
efficient to check your HSTORE column against an empty HSTORE, e.g.
WHERE v
Hi, here's what I'm trying to do:
- I have a table that has an HSTORE column
- I would like to delete some key-vals from it
- If after deleting key-vals, the HSTORE column is empty, I'd like to
delete the entire row
I have the sample SQL here and the DML I was trying out. I thought a CTE
Matthias Nagel wrote on 29.09.2012 12:49:
Hello,
is there any way how one can store the result of a time-consuming calculation
if this result is needed more
than once in an SQL update query? This solution might be PostgreSQL specific
and not standard SQL compliant.
Here is an example of what
On 2012-09-29, Matthias Nagel wrote:
> Hello,
>
> is there any way how one can store the result of a time-consuming calculation
> if this result is needed more than once in an SQL update query? This solution
> might be PostgreSQL specific and not standard SQL compliant. Here is a
>
> thank you. The "WITH" clause did the trick. I did not even know that such a
> thing exists. But as it turns out it makes the statement more readable and
> elegant but not faster.
>
> The reason for the latter is that both the CTE and the UPDATE statement
> have the same "FROM ... WHERE ..." p
schrieben:
> > Matthias Nagel wrote on 29.09.2012 12:49:
> > > Hello,
> > >
> > > is there any way how one can store the result of a time-consuming
> > > calculation if this result is needed more
> > >than once in an SQL update query? This
Thomas Kellerer hat am 29. September 2012 um 16:13
geschrieben:
> Matthias Nagel wrote on 29.09.2012 12:49:
> > Hello,
> >
> > is there any way how one can store the result of a time-consuming
> > calculation if this result is needed more
> >than once in an SQL
Matthias Nagel wrote on 29.09.2012 12:49:
Hello,
is there any way how one can store the result of a time-consuming calculation
if this result is needed more
than once in an SQL update query? This solution might be PostgreSQL specific
and not standard SQL compliant.
Here is an example of what
On Sep 29, 2012, at 6:49, Matthias Nagel wrote:
> Hello,
>
> is there any way how one can store the result of a time-consuming calculation
> if this result is needed more than once in an SQL update query? This solution
> might be PostgreSQL specific and not standard SQL compli
Hello,
> Matthias Nagel hat am 29. September 2012 um 12:49
> geschrieben:
> > Hello,
> >
> > is there any way how one can store the result of a time-consuming
> > calculation
> > if this result is needed more than once in an SQL update query? This
> >
Matthias Nagel hat am 29. September 2012 um 12:49
geschrieben:
> Hello,
>
> is there any way how one can store the result of a time-consuming calculation
> if this result is needed more than once in an SQL update query? This solution
> might be PostgreSQL specific and not standar
Hello,
is there any way how one can store the result of a time-consuming calculation
if this result is needed more than once in an SQL update query? This solution
might be PostgreSQL specific and not standard SQL compliant. Here is an example
of what I want:
UPDATE table1 SET
StartTime
Carlos Mennens wrote:
> I'm trying to update a customer record in a table however I need to
> change several values (cust_address, cust_contact, cust_email). My
> question is how do I properly format this into one single command?
>
>
> forza=# SELECT cust_id, cust_name, cust_address, cust_contact
ick example so I can see how this is drawn out via
ANSI SQL?
UPDATE customers
SET cust_address = 'foo',
cust_contact = 'Arthur',
cust_email = 'art...@foo.bar'
WHERE cust_name = 'iamUNIX'
--
Sent via pgsql-sql mailing list (pgsql-sq
I'm trying to update a customer record in a table however I need to
change several values (cust_address, cust_contact, cust_email). My
question is how do I properly format this into one single command?
forza=# SELECT cust_id, cust_name, cust_address, cust_contact, cust_email
forza-# FROM customer
-Original Message-
From: pgsql-sql-ow...@postgresql.org [mailto:pgsql-sql-ow...@postgresql.org]
On Behalf Of ssylla
Sent: Wednesday, February 08, 2012 9:31 PM
To: pgsql-sql@postgresql.org
Subject: [SQL] update column with multiple values
Dear list,
sorry, I already posted this, but it
UPDATE admin
SET parent = SUBSTR(id,1,4);
Doesn't it do what you want?
Best,
Oliveiros
- Original Message -
From: "ssylla"
To:
Sent: Thursday, February 09, 2012 1:58 AM
Subject: [SQL] update column
Dear list,
sorry, I already posted this, but it did not se
Dear list,
sorry, I already posted this, but it did not seem to have been accepted by
the mailing list. So here's my second try:
I need to update all rows of a column ('parent') based on a subquery that
returns me the first four digits of another column ('id'):
UPDATE admin SET parent=(SELECT SU
Dear list,
sorry, I already posted this, but it did not seem to have been accepted by
the mailing list. So here's my second try:
I need to update all rows of a column ('parent') based on a subquery that
returns me the first four digits of another column ('id'):
UPDATE admin SET parent=(SELECT SU
Dear list,
I am trying to update all rows of a column ('parent') based on a subquery
that returns me the first four digits of another column ('id'):
After executing, I get the following error-message:
I am not quite sure about that, but maybe I need to construct a function to
fulfill this ta
-Original Message-
From: pgsql-sql-ow...@postgresql.org [mailto:pgsql-sql-ow...@postgresql.org]
On Behalf Of Carlos Mennens
Sent: Thursday, January 26, 2012 6:59 PM
To: PostgreSQL (SQL)
Subject: [SQL] Update Mass Data in Field?
I'm new to SQL so I'm looking for a way to chan
On 01/26/2012 03:59 PM, Carlos Mennens wrote:
I'm new to SQL so I'm looking for a way to change several email
addresses with one command. For example everyone has a 'holyghost.org'
domain and I need to change a few 100 email addresses in the field
'emp_email'. I need to UPDATE employees table whi
I'm new to SQL so I'm looking for a way to change several email
addresses with one command. For example everyone has a 'holyghost.org'
domain and I need to change a few 100 email addresses in the field
'emp_email'. I need to UPDATE employees table which has a COLUMN
'emp_email' and change %holyghos
On Tue, Jan 17, 2012 at 12:49 AM, Thomas Kellerer wrote:
> Gera Mel Handumon, 17.01.2012 07:31:
>
> What version of postgresql that the update compatibility below will be
>> implemented?
>>
>> UPDATE COMPATIBILITY
>>
>>
>> UPDATE accounts SET (contact_last_name, contact_first_name) =
>> (SELE
Adrian Klaver, 17.01.2012 16:19:
You need to rewrite it to:
UPDATE accounts
SET contact_last_name = s.last_name,
contact_first_name = s.first_name
FROM salesmen s
WHERE s.id = accounts.sales_id
For completeness, you could also do:
UPDATE accounts
SET (contact_last_name,cont
On Tuesday, January 17, 2012 12:49:44 am Thomas Kellerer wrote:
> Gera Mel Handumon, 17.01.2012 07:31:
>
> None as far as I know.
>
> You need to rewrite it to:
>
> UPDATE accounts
>SET contact_last_name = s.last_name,
>contact_first_name = s.first_name
> FROM salesmen s
> WHERE s.i
Gera Mel Handumon, 17.01.2012 07:31:
What version of postgresql that the update compatibility below will be
implemented?
UPDATE COMPATIBILITY
UPDATE accounts SET (contact_last_name, contact_first_name) =
(SELECT last_name, first_name FROM salesmen
WHERE salesmen.id = accounts.sales_
What version of postgresql that the update compatibility below will be
implemented?
UPDATE COMPATIBILITY
UPDATE accounts SET (contact_last_name, contact_first_name) =
(SELECT last_name, first_name FROM salesmen
WHERE salesmen.id = accounts.sales_id);
TIA,
--
Gera Mel E. Handumon
--
Hello
it is possible in 9.1. In older version you have to use a temp table.
Regards
Pavel Stehule
2011/4/14 Steven Dahlin :
> Is it possible to execute an update using recursion? I need to update a set
> of records and also update their children with the same value. I tried the
> following qu
Is it possible to execute an update using recursion? I need to update a set
of records and also update their children with the same value. I tried the
following query but it gave an error at the "update schema.table tbl":
with recursive childTbl( pid,
ppid,
Is it possible to execute an update using recursion? I need to update
a set of records and also update their children with the same value.
I tried the following query but it gave an error at the "update
schema.table tbl":
with recursive childTbl( pid,
ppid,
Thanks for reply,
Em 16/12/2010 17:58, Jasen Betts escreveu:
I need to make update of table1 with data on table2 in the order of id
of table2
that looks like EAV. is it?
Err, I don´t know so much about EAV, so I think that isn´t. I´m just
trying to reproduce a calc in a spreeadsheet.
Ther
> I need to make update of table1 with data on table2 in the order of id
> of table2
that looks like EAV. is it?
> I=B4m trying to do an update like this:
that's not going to work.
perhaps you can rewrite the from part to only return one row for every
table1_fk, this one row will combine seve
Hi,
I have a follow scenario:
CREATE TABLE table1 (
id integer
, vlpr numeric(10,2)
, vlab numeric(10,2)
, vlbx numeric(15,5)
, pct numeric(12,8)
);
CREATE TABLE table2 (
id integer
, fk_table1 integer
, tpop char(2)
, valor numeric(15,5)
);
insert into table1 VALUES ( 1, 200 , 0 , 0
I wonder if this works:
update stock s set s_superceded = true
where s.s_updated < (select max(t.s_updated) from stock t where t.s_vin =
s.s_vin)
On Thu, May 14, 2009 at 7:27 AM, Gary Stainburn <
gary.stainb...@ringways.co.uk> wrote:
> I know I should be able to do this but my brain's mashed
I know I should be able to do this but my brain's mashed today
I have a stock table with
s_stock_no varchar primary key
s_vin varchar
s_updated timestamp
s_supercededboolean
It is possible for the same vin to exist on stock if we have s
O Problema é tem tenho uma tabela muito grande com chave primaria e tudo
mais...
e quando eu vou fazer uma atualização de alguns campos desta tabela o banco
fica devagar estou procurando algum comando que me permita atualizar os
registros aos poucos por exemplo uma tabela com 100 000 atualiza-l
The problem is ...
how to run the SCRIPT to the few?
not all the 5 lines of "update" at the same time.
John Evan Dizaro
2008/11/20 John Dizaro <[EMAIL PROTECTED]>
> I have to execute some times an UPDATE an some times a DELETE to
> register +- 5 , every time when i do that the dat
did you make analyse(vacuum ) in you database?
De: Craig Ringer <[EMAIL PROTECTED]>
Para: John Dizaro <[EMAIL PROTECTED]>
Cc: pgsql-sql@postgresql.org
Enviadas: Quinta-feira, 20 de Novembro de 2008 8:29:55
Assunto: Re: [SQL] UPDATE and DELEte w
John Dizaro wrote:
I have to execute some times an UPDATE an some times a DELETE to
register +- 5 , every time when i do that the database be to slow
do we any way to DELETE or UPDATE by part???
I'm not sure your post really contains enough information to answer your
question.
If
I have to execute some times an UPDATE an some times a DELETE to
register +- 5 , every time when i do that the database be to slow
do we any way to DELETE or UPDATE by part???
Thanks
--
John Evan Dizaro -
am Wed, dem 11.06.2008, um 0:54:55 -0700 mailte Medi Montaseri folgendes:
> Thanks...but a difference seems to be that the rule is not specific to update
> on a particular col but any col of a row getting updated...
>
> Thanks
Okay, but i havn't an idea. A statement level trigger can't see the
Thanks...but a difference seems to be that the rule is not specific to
update on a particular col but any col of a row getting updated...
Thanks
On Tue, Jun 10, 2008 at 10:21 PM, A. Kretschmer <
[EMAIL PROTECTED]> wrote:
> am Tue, dem 10.06.2008, um 18:45:51 -0700 mailte Medi Montaseri folgende
Medi Montaseri wrote:
Hi,
I need to increament a counter such as myTable.Counter of type integer
everytime myTable.status a boolean column is updated. Can you help me
complete this...
create trigger counter_trigger after update on myTable.counter
execute procedure 'BEGIN statement; statement
am Tue, dem 10.06.2008, um 18:45:51 -0700 mailte Medi Montaseri folgendes:
> Hi,
>
> I need to increament a counter such as myTable.Counter of type integer
> everytime myTable.status a boolean column is updated. Can you help me complete
> this...
>
> create trigger counter_trigger after update o
Hi,
I need to increament a counter such as myTable.Counter of type integer
everytime myTable.status a boolean column is updated. Can you help me
complete this...
create trigger counter_trigger after update on myTable.counter
execute procedure 'BEGIN statement; statement; statement END'
Q1- how d
Iam sorry for the previous mail..it was in complete. Please do not
consider it.
I think i could figure out the problem for the updates not happening.
Following is the function that does the update :
BEGIN
IF flag=1 THEN
tempQuery:='UPDATE '||thepartition||' SET
volume='||update
I tried getting the output of the execute statements by printing the
FOUND variable. It is returning the value as false.
However i used PEFORM instead of EXECUTE for the update statement. It
On 6/3/08, samantha mahindrakar <[EMAIL PROTECTED]> wrote:
> Hi
> Iam facing a strange issue
> One
Hi
Iam facing a strange issue
One of the functions in my program is running an update statement. The
statement is running cross-schema. What i mean is that the program
resides in one schema where as it updates a table from another schema.
How ever these scehmas are on the same database.
The
I need to update some records in a table depending on values in another
table:
UPDATE
item SET export_time = now()
WHERE item_pk IN
(
SELECT
item.item_pk AS pk
FROM ITEM
LEFT JOIN product product ON Item.product_fk = product.product_pk
WHERE product.xyz = 't' AND ...
)
Is this the most
On Sat, 3 May 2008, Alexy Khrabrov <[EMAIL PROTECTED]> writes:
> I need to fill two columns of a Rats table from an Offset1 table,
> where for each Id row in Rats we need to fill an average offset and
> the sum of all offset from Offset1 with the same Id. I can create a
> derivative table like thi
I need to fill two columns of a Rats table from an Offset1 table,
where for each Id row in Rats we need to fill an average offset and
the sum of all offset from Offset1 with the same Id. I can create a
derivative table like this:
create table ofrats as (select customer_id as cid,avg(o),sum
On Wed, 2 Apr 2008 23:54:18 -0300
"Osvaldo Kussama" <[EMAIL PROTECTED]> wrote:
> 2008/4/2, Ivan Sergio Borgonovo <[EMAIL PROTECTED]>:
> > I've
> >
> > create table types(
> > typeid int,
> > special boolean not null
> > );
> >
> > create table methods(
> > methodid int,
> > typeid refer
2008/4/2, Ivan Sergio Borgonovo <[EMAIL PROTECTED]>:
> I've
>
> create table types(
> typeid int,
> special boolean not null
> );
>
> create table methods(
> methodid int,
> typeid references types(typeid),
> );
>
> create table orders(
> orderid int
> );
>
> create table order_pay
I've
create table types(
typeid int,
special boolean not null
);
create table methods(
methodid int,
typeid references types(typeid),
);
create table orders(
orderid int
);
create table order_payments(
payid int
orderid references order(orderid),
methodid references method(metho
"Markus Bertheau" <[EMAIL PROTECTED]> writes:
> I'm kind of stuck as to why postgresql doesn't understand what I mean in the
> following queries:
> UPDATE tag_data td SET td.usage_counter = td.usage_counter + 1 FROM
> tag_list_tag_data ltd WHERE ltd.tag_id = td.id AND ltd.id = 102483;
> ERROR: c
I'm kind of stuck as to why postgresql doesn't understand what I mean in the
following queries:
UPDATE tag_data td SET td.usage_counter = td.usage_counter + 1 FROM
tag_list_tag_data ltd WHERE ltd.tag_id = td.id AND ltd.id = 102483;
ERROR: column "td" of relation "tag_data" does not exist
LINE 1:
Hi,
I know this kind of a question is asked earlier, but I couldn't find an
answer there (in the previous round of posting).
Instead of wanting to update the first record in an UPDATE .. ORDER BY
condition, (because of triggers that act downward) what I want is that all
records be updated, but in
Scott Marlowe wrote:
On Jan 15, 2008 3:03 PM, Franklin Haut <[EMAIL PROTECTED]> wrote:
Hi all,
i have a problem with one update sentence sql.
example to produce:
create table temp (num integer primary key, name varchar(20));
insert into temp values (1, 'THE');
insert into temp
On Jan 16, 2008 8:30 AM, Achilleas Mantzios
<[EMAIL PROTECTED]> wrote:
> Στις Tuesday 15 January 2008 23:03:49 ο/η Franklin Haut έγραψε:
> > Hi all,
> >
> > i have a problem with one update sentence sql.
> >
>
> A simple way i use:
>
> foodb=# update temp set num = num*1000 where num >= 5;
> foodb
Στις Tuesday 15 January 2008 23:03:49 ο/η Franklin Haut έγραψε:
> Hi all,
>
> i have a problem with one update sentence sql.
>
A simple way i use:
foodb=# update temp set num = num*1000 where num >= 5;
foodb=# insert into temp values (5, 'NOT');
foodb=# update temp set num = 1 + num/1000 wher
> Franklin Haut wrote:
>
> Hi all,
>
> i have a problem with one update sentence sql.
>
> example to produce:
>
> create table temp (num integer primary key, name varchar(20));
>
> insert into temp values (1, 'THE');
> insert into temp values (2, 'BOOK');
> insert into temp values (3, 'IS');
On Jan 15, 2008 3:03 PM, Franklin Haut <[EMAIL PROTECTED]> wrote:
> Hi all,
>
> i have a problem with one update sentence sql.
>
> example to produce:
>
> create table temp (num integer primary key, name varchar(20));
>
> insert into temp values (1, 'THE');
> insert into temp values (2, 'BOOK');
>
Hi all,
i have a problem with one update sentence sql.
example to produce:
create table temp (num integer primary key, name varchar(20));
insert into temp values (1, 'THE');
insert into temp values (2, 'BOOK');
insert into temp values (3, 'IS');
insert into temp values (4, 'ON');
insert into t
> I tried
>
> UPDATE things JOIN inventory ON things.thing_id = inventory.thing_fk
> SET number = 0
> WHERE color = 'red'
>
use the cool "from" clause in the update
update things t
set number = 0
from inventory i
where t.thing_id = i.thing_fk
and i.color = 'red';
_
--- On Wed, 11/21/07, Andreas <[EMAIL PROTECTED]> wrote:>
> UPDATE inventory
> SET number = 0
> WHERE thing_fk IN (SELECT thing_id FROM things WHERE color
> = 'red')
This is a perfectly acceptable ANSI-SQL update statement.
Here is non-ANSI update statement that
Andreas wrote:
I'd like to update a table efficiently where the relevant select-info
is in another table that is foreign-linked.
Stupid example. 2 tables:
things (thing_id integer, name varchar(100), color varchar(100))
inventory (item_id integer, thing_fk integer references things
(thing_id
Hi,
I'd like to update a table efficiently where the relevant select-info
is in another table that is foreign-linked.
Stupid example. 2 tables:
things (thing_id integer, name varchar(100), color varchar(100))
inventory (item_id integer, thing_fk integer references things
(thing_id), number)
<[EMAIL PROTECTED]> writes:
> Hash Join (cost=10827.45..25950.05 rows=4906 width=1191) (actual
> time=586.251..2852.691 rows=111306 loops=1)
> ...
> Total runtime: 633548.404 ms
So you're worried about the wrong thing entirely. The query is taking
less than 3 seconds, which may be reasonable con
actual time=2.848..6.485 rows=6 loops=19489)"
> "Index Cond: ((""owner"".asin)::text = (detail_dvd.asin)::text)"
> Total runtime: 1039998.325 ms
> ***
>
try to up statististics on table det
tal runtime: 1039998.325 ms
***
Thaks for helping!! Bye the way, we are changing our system from MSSQL2000
to Postgres :-)!
Regards
Reto
-Ursprüngliche Nachricht-
Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Im Auftrag von A. Kr
<[EMAIL PROTECTED]> writes:
> Is there a better way to do this update:
> UPDATE table1 SET column2 = temp_table.column2, column3 =
> temp_table.column3, column4 = CAST(temp_table.column4 AS date) FROM
> (
> SELECT DISTINCT
> table2.column1,
> table2.column2,
> table2.column3,
> table2.column4
Hello
you use corelated subquery and that is slow for thausands rows. Use
PostgreSQL's extension
UPDATE table1 SET column2 = t,colum2,
FROM table2 t
WHERE table1.column1 = t.column1 and t.column4 is not null and ...
http://www.postgresql.org/docs/8.2/interactive/sql-update.html
Regards
Pav
am Mon, dem 29.10.2007, um 10:18:38 +0100 mailte [EMAIL PROTECTED] folgendes:
>
> WHERE table1.column1 = temp_table.column1;
table1.column1 and temp_table.column1 have the same type?
>
>
>
> The select by it?s own takes around 1 second. The Update is around 120?000
> rows. I got an index on
Hello
I have a performance problem with an SQL statement.
Is there a better way to do this update:
UPDATE table1 SET column2 = temp_table.column2, column3 =
temp_table.column3, column4 = CAST(temp_table.column4 AS date) FROM
(
SELECT DISTINCT
table2.column1,
table2.column2,
table2
Hello
I have a query:
update A set...
from B left join C on (C.col1=B.col1 and C.col2=A.col2)
where ...
which gives me an error:
ERROR: invalid reference to FROM-clause entry for table "A"
HINT: There is an entry for table "A", but it cannot be referenced from
this part of the query.
I fo
Hi all,
I want to update the values of a column with the
result of a function that requires information
from another table. Specifically it needs a
minium and maximum value from another table.
How do I perform the update query?
Below is my attempt but it doesn't work. The
"bhlineid" is my prim
On Tue, Apr 03, 2007 at 09:13:00AM +0200, Shavonne Marietta Wijesinghe wrote:
> Thanks. But to do the UPDATE i have to write each column name (for recrd 4)
> and with its column name (for record 2) which is quite alot to write :P
>
> UPDATE MOD48_00_2007 SET te_cognome= te_cognome, te_paternita=
column name = to the column
name.
And i have to do it for echt field? isn't there any other way..
"I hate writting :P"
And Andrew can explain a bit the setval()
Thanks
Shavonne Wijesinghe
From: "Andrew Sullivan" <[EMAIL PROTECTED]>
To:
Sent: Monday, April 02, 2007 5:
On Mon, Apr 02, 2007 at 04:52:46PM +0200, Shavonne Marietta Wijesinghe wrote:
> At a surtain point i need to replace a record with another
>
> For example i have inserted 4 records. (1, 2 , 3 , 4) I need to
> replace all the values from the record 4 to the record 2 but
> keeping the n_gen serial
Hello
I have a table created as the following
CREATE TABLE mod48_00_2007
(
id text,
n_gen serial NOT NULL,
formstore text,
te_cognome text,
te_paternita text,
te_nome text,
te_sesso text,
te_dtnasc text,
te_attnasc text,
te_luonasc text,
te_provstato text,
te_indi text,
Hello
I have a table created as the following
CREATE TABLE mod48_00_2007
(
id text,
n_gen serial NOT NULL,
formstore text,
te_cognome text,
te_paternita text,
te_nome text,
te_sesso text,
te_dtnasc text,
te_attnasc text,
te_luonasc text,
te_provstato text,
te_indi text,
Might be a view and then a rule attached with that can help you out with
doing updates using joins
--
Shoaib Mir
EnterpriseDB (www.enterprisedb.com)
On 1/17/07, Andrew Sullivan <[EMAIL PROTECTED]> wrote:
On Wed, Jan 17, 2007 at 04:50:18PM +0530, Moiz Kothari wrote:
> http://www.pos
On Wed, Jan 17, 2007 at 04:50:18PM +0530, Moiz Kothari wrote:
> http://www.postgresql.org/docs/8.1/interactive/sql-update.html, it is not
> specified if a join can be done between multiple tables to update a table, i
Sure it is:
A list of table expressions, allowing columns from other tables to
a
Guys,
on page this
http://www.postgresql.org/docs/8.1/interactive/sql-update.html, it is not
specified if a join can be done between multiple tables to update a table, i
tried and it worked just fine for me. Something like this :
Infact update can work between multiple tables to... do something
1 - 100 of 295 matches
Mail list logo