On 05/01/2009 11:55 AM, John Zhang wrote:
Hi Nicholas,
The query is across database query. dblink is needed for that task.
Hope it helps,
John
On Thu, Apr 30, 2009 at 3:07 PM, Edward W. Rouse
mailto:ero...@comsquared.com>> wrote:
Can’t you use this?
select name from database2.s
On 04/02/2009 03:32 PM, Tom Lane wrote:
Tony Cebzanov writes:
What I want to do is update the assoc_count field in the dataset table
to reflect the count of related records in the assoc field. To do so, I
added the following trigger:
CREATE OR REPLACE FUNCTIO
FROM D WHERE D.da =
10) as b where tkey = ;
Thanks
Wei
On 03/17/2009 05:43 PM, Wei Weng wrote:
Hi all.
I have the following scenario:
A table T (int t1; int t2; ... int t10; int tkey)
A table D (int da; int db),
And I have the following query
update T set t1 = b.aa FROM (select COUNT(1) as
Hi all.
I have the following scenario:
A table T (int t1; int t2; ... int t10; int tkey)
A table D (int da; int db),
And I have the following query
update T set t1 = b.aa FROM (select COUNT(1) as aa FROM D WHERE D.da =
) as b where tkey = ;
update T set t2 = b.aa FROM (select COUNT(1) as aa FR
On Monday 25 June 2007 15:22, Susan Young wrote:
> Hi Wei,
> That's OK - Enjoy!
> Susan
>
> Wei Weng wrote:
> > Can I take next week off?
> >
> > Thanks!
> >
> > Wei
hi, susan, a change of plan. :)
Instead of the whole week, I just wanted
On Friday 22 June 2007 12:23, Alexandre Parizot wrote:
> Wei, Can you check the database error messages in the message "Main
> Log". You can find the system information in the email "System Info 7.1".
>
>
>
> Alex.
This is the script that caused the error in 7.1.0.0. (Fixed already)
The script in
Hi all.
How do I write a query that converts an interger to the interval type?
Like convert integer 10 to INTERVAL '10 seconds'?
The integer is a column in a table though, so it is more like convert
integer tbl.theInteger to INTERVAL 'tbl.theInteger seconds".
Thanks!
Wei
Say if I want to add a small snip of code in front of the sql script
generated by the pg_dump, to check for something then if the condition
doesn't match, the script terminates right away. (Without actually doing the
restoring stuff that the following large chunk is supposed to do)
Can I do tha
I have a table with column filepath with contents that look like the following:
filepath
==
/var/log/foo
/var/log/bar
/var/cache/foo
/var/cache/bar
/var/foo
/var/bar
Is there anyway to retrieve the directory information only regarding those
filepaths?
So that I can get
/var/log
/var/c
I have a table
create table temp
(
tempdatetimestamp,
tempnamevarchar(10)
);
And I tried to insert the following:
insert into table temp (tempname, tempdate)
select distinct 'tempname', null from some_other_relevant_table;
And I got an error that says "column "tempda
Bruno Wolff III wrote:
On Tue, Oct 26, 2004 at 16:23:20 -0400,
Wei Weng <[EMAIL PROTECTED]> wrote:
In the following query
SELECT Parent FROM Channels ORDER BY Parent ASC;
If I have a couple of (NULL)s in the field [Parent], they will be listed at
the bottom of the query result.
Is it b
In the following query
SELECT Parent FROM Channels ORDER BY Parent ASC;
If I have a couple of (NULL)s in the field [Parent], they will be listed at
the bottom of the query result.
Is it because PostgreSQL considers (NULL) as the biggest value? If I run the
same query under MSSQL Server 2000, I g
Tom Lane wrote:
Wei Weng <[EMAIL PROTECTED]> writes:
But if I choose to use string comparison, instead of 4 escape characters, I
only need 2.
Why is that?
Backslash is an escape character for LIKE.
regards, tom lane
What about in regular strings? I do need
I used the following SQL code to match '\foo\bar'
SELECT text FROM test WHERE text LIKE 'foo%'
But if I choose to use string comparison, instead of 4 escape characters, I
only need 2.
SELECT text FROM test WHERE text = '\\foo\\bar'
Why is that?
I am using PostgreSQL 7.4, and the SQL code
Michael Glaesemann wrote:
On Dec 30, 2003, at 10:05 AM, beyaRecords - The home Urban music wrote:
Hi,
can anyone recommend a good editor for postgreSQl wich wil enable me
to create functions/stored procedures?
I am currently running version 7.4.1 on OS X 10.3
If you're looking for an editor to
Sai Hertz And Control Systems wrote:
Dear Martin Marques ,
In mathematics I would have written it something like
A = antilog (3·3234) = 2144
As I can understand, this is a 10 base log, so that what you want is
10^(3.3234)?
For that you have the exponential operator ^.
Nope
select exp(3
Geoffrey wrote:
How does one check for an unset value in an integer field?
I've tried such things as:
select . where intnumber = ''
select .. where intnumber = ?
select . where intnumber = NULL
Thanks.
It is actually WHERE intnumber IS NULL. You don't use operator = to
compare wi
I want to convert an interval (from substraction between two timestamps) into
a integer that represents how many seconds that interval has. How do I do
that?
I am using postgresql 7.3.1
Thanks
Wei
---(end of broadcast)---
TIP 5: Have you chec
On Sat, 11 Oct 2003, Christopher Kings-Lynne wrote:
>
> > I have two very similar queries which I need to execute. They both have
> > exactly the same from / where conditions. When I execute the first, it takes
> > about 16 seconds. The second is executed almost immediately after, it takes
> > 13
I need to create triggers on a number of tables that have full text search
capability. The trigger, basically, needs to call select
set_curcfg('default') first to set the locale , then call tsearch2
function on the text columns in the table to update the index. How can I
implement a trigger that d
How do I create one, such as the tsearch2 function in tsearch2 module. It
takes arbitrary number of parameters. The only difference is that it is
writtein in C, instead of PL/pgsql.
I looked into the doc, doesn't say much about it.
Thanks
Wei
---(end of broadcast)---
Shouldn't that be "UPDATE my_table SET field1 = 'new_value', field2 =
'different_value' WHERE my_table_id = 'key';"?
Wei
On Fri, 3 Oct 2003, John B. Scalia wrote:
> All,
>
>
>
> I'm not certain if what I'm trying to do is legal, but if I execute a
> statement like:
>
>
>
> UPDATE my_tab
George:
Have you tried psql {whatever operations} 2> error_output ?
(for Bash)
Thanks
Wei
On Fri, 26 Sep 2003, George Weaver wrote:
> Hi Josh,
>
> Thanks for the reply.
>
> What I am trying to achieve is to have errors go to a file, rather than show
> up on the screen.
>
> Is this possibl
When I ran psql testdb < untsearch2.sql
I got the following error message:
psql:untsearch2.sql:15: ERROR: RemoveAggregate: aggregate stat(tsvector)
does not exist
I didn't really do anything before this. Only dropped the trigger and gist
index I created (in order to use tsearch2), and alter t
When I run psql < tsearch2.sql, is psql going to substitute $libdir
internally with what $libdir really is (in my case, it would be
/usr/lib/pgsql)?
Thanks
Wei
On Fri, 26 Sep 2003, Tom Lane wrote:
> Wei Weng <[EMAIL PROTECTED]> writes:
> > But then when I do a psql
On Thu, 25 Sep 2003, Tom Lane wrote:
> Wei Weng <[EMAIL PROTECTED]> writes:
> > In my tsearch2.sql there are statements like :
> > --dict interface
> > CREATE FUNCTION lexize(oid, text)
> > returns _text
> > as '$libdir/tsearch2'
> >
In my tsearch2.sql there are statements like :
--dict interface
CREATE FUNCTION lexize(oid, text)
returns _text
as '$libdir/tsearch2'
language 'C'
with (isstrict);
I don't think $libdir is the real value that we want. Do I need to set
some special parameters wit
try psql -f filename
On Mon, 22 Sep 2003, Suresh Basandra wrote:
> Hi,
>
> I would like to do the following using files:
>
> 1. put create database, create tables sql statements in a file and
> execute through prompt
> 2. insert or update data that is put in a file
>
> Please let me know i
#x27;text' columns in the table?
Thanks
Wei
On Mon, 22 Sep 2003, Richard Huxton wrote:
> On Monday 22 September 2003 16:02, Wei Weng wrote:
> > Hi all.
> >
> > I have been doing a little research on how to do full text search under
> > postgresql, and GiST seems
Hi all.
I have been doing a little research on how to do full text search under
postgresql, and GiST seems to be the way to go. But the documentation on
this is pretty lacking and I wonder if there are better sources that
describe the details on how to implement full text search with GiST.
Tha
Where can I find a more detailed doc on how to write module for extended
datatype? There isn't much about it on techdoc.postgresql.org.
(I need to write one for UNIQUEIDENTIFIER.)
Thanks!
Wei
---(end of broadcast)---
TIP 5: Have you checked
> The format of the hba.conf file changed between 7.1 and 7.2. It looks like
> you are using an old one. After the database field, there is now a user
> field. To get the same effect as before, use 'all' for the user.
I installed PostgreSQL rpm on a fresh installed Redhat 7.3. There is no
PostgreS
It is a query that looks like
SELECT target1, target2... targetn, SUN(t.qty)
FROM Table t
GROUP BY target1
HAVING SUM(t.qty)>=10
You can replace SUM(t.qty)>=10 with other aggregate constraints.
- Original Message -
From: Christoph Haller
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Does PostgreSQL optimizer handle iceberg queries well?
Thanks
Wei
---(end of broadcast)---
TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]
Since which version PostgreSQL is able to do Vacuum Analyze
even in the middle of a transaction, namely, insert, delete,
update?
Thanks
Wei
It would be better if you could provide the source of that trigger and involved
table schemas?
Wei
- Original Message -
From: "Tony Simbine" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, January 29, 2003 8:29 AM
Subject: [SQL] help: triggers
> hello,
>
> I'm trying to up
What about a UNIQUEIDENTIFIER type?
Is the only way casting it to a CHAR(38)? (Create a domain for it)
And does the performance suffer if I do the Domain/create my own data type
tricks?
Thanks!
Wei
- Original Message -
From: "Tom Lane" <[EMAIL PROTECTED]>
To: "Guy Fraser" <[EMAIL PRO
Or if you are so paranoid about the stability of crond, you can probably do a
check to see whether crond is up when you update the database.
If crond is up then
update
else
mail root the error
reject the update
end
This is going to affect the performance dramatically though.
- Or
Can I use a SQL statement to rename database?
e.g Rename Database Bank to Database Bank_backup
Thanks!
Wei
I want to select some data out of database A, and insert them
into database B. Is it possible to do in one SQL query?
Thanks
Wei
Is there a bugzilla kind of thing for Postgresql?
I would like to help out on the development, but have no idea where to
start...
Thanks
Wei
---(end of broadcast)---
TIP 2: you can get off all lists at once with the unregister command
(send
Is there a bugzilla kind of thing for Postgresql?
I would like to help out on the development, but have no idea where to
start...
Thanks
Wei
---(end of broadcast)---
TIP 5: Have you checked our extensive FAQ?
http://www.postgresql.org/users-lo
Thanks, I noticed that sweet addon and will try to integrate it into our
system once 7.3 is officially released. :)
btw, do we have a release date yet?
Thanks
Wei
At 11:08 PM 11/3/2002 -0500, you wrote:
Wei Weng <[EMAIL PROTECTED]> writes:
> Since I need to use a GUID as the prima
COUNT(ID) FROM test
should be valid while SELECT COUNT(DISTINCT ID) FROM test otherwise.
while in fact, both are valid.
Is there any difference between this two queries?
Thanks!
--
Wei Weng
Network Software Engineer
KenCast Inc.
---(end of broa
e).
> This way you don't need to worry about retrying.
>
> regards, tom lane
>
> ---(end of broadcast)---
> TIP 6: Have you searched our list archives?
>
> http://archives.postgresql.org
--
Wei Weng <[EMAIL PROTECTED]
lect data2 into @out from test where data1 = 'pooh'
2: select data1 from test where data2 = @out and data = 3
What do I do?
Thanks!
--
Wei Weng
Network Software Engineer
KenCast Inc.
---(end of broadcast)---
TIP 3: if posting/reading
> TIP 5: Have you checked our extensive FAQ?
>
> http://www.postgresql.org/users-lounge/docs/faq.html
>
--
Wei Weng
Network Software Engineer
KenCast Inc.
---(end of broadcast)---
TIP 3: if posting/reading through Usenet, please s
ce with the unregister command
> > (send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])
> --
> Kevin Old <[EMAIL PROTECTED]>
>
>
> ---(end of broadcast)---
> TIP 5: Have you checked our extensive FAQ?
>
> http://www.postgresql.org/users-lounge/docs/faq.html
>
--
Wei Weng
Network Software Engineer
KenCast Inc.
---(end of broadcast)---
TIP 5: Have you checked our extensive FAQ?
http://www.postgresql.org/users-lounge/docs/faq.html
nt to be able
to see the *real* sql error messages)
Thanks
--
Wei Weng
Network Software Engineer
KenCast Inc.
---(end of broadcast)---
TIP 5: Have you checked our extensive FAQ?
http://www.postgresql.org/users-lounge/docs/faq.html
usernames. And do
it in a way that is the most portable to MS SQL server.
Is there anyway?
Thanks
--
Wei Weng
Network Software Engineer
KenCast Inc.
---(end of broadcast)---
TIP 2: you can get off all lists at once with the unregister command
-
> I cannot think why the whole bed of the ocean is
> not one solid mass of oysters, so prolific they seem. Ah,
> I am wandering! Strange how the brain controls the brain!
> -- Sherlock Holmes in "The Dying Detective"
>
> ---(end of broadcast)-
t; was an old user I created for the database *before* I
wiped out everything and reinstalled the RPMs. It is already gone from
my /etc/password. (since I was using IDENT)
What could have gone wrong? I must have left the trace of user foobar
somewhere in my system but I couldn't find it.
Than
On Wed, 2002-08-14 at 10:49, Richard Huxton wrote:
> On Wednesday 14 Aug 2002 3:20 pm, Wei Weng wrote:
> > On Wed, 2002-08-14 at 05:18, Richard Huxton wrote:
> > > On Tuesday 13 Aug 2002 9:39 pm, Wei Weng wrote:
>
> [30 connections is much slower than 1 connection
On Wed, 2002-08-14 at 05:18, Richard Huxton wrote:
> On Tuesday 13 Aug 2002 9:39 pm, Wei Weng wrote:
> > I have a testing program that uses 30 concurrent connections
> > (max_connections = 32 in my postgresql.conf) and each does 100
> > insertions to a simple table with inde
ne and the
extension library that supports postgresql serializes the queries by
simply locking when a query manipulates a PGconn object and unlocking
when it is done. (And similiarly, it creates a PGconn object on the
stack for each concurrent queries.)
Thanks
--
Wei Weng
Network Software Engineer
K
On Mon, 2002-08-12 at 23:58, Weiping He wrote:
> Wei Weng wrote:
>
> >I am not sure if this is the right mailing list I talk to. Please let me
> >know if I had violated any unwritten rules. :)
> >
> >I have a global variable PGconn* m_pgconn that is the connection h
I am using C++ and libpq.
Thanks
Wei
-ÓʼþÔ¼þ-
·¢¼þÈË: Robert Treat [mailto:[EMAIL PROTECTED]]
·¢ËÍʱ¼ä: Monday, August 12, 2002 8:10 PM
ÊÕ¼þÈË: Wei Weng
³ËÍ: [EMAIL PROTECTED]
Ö÷Ìâ: Re: [SQL] Is this valid?
I'm going to ask the crazy question of what language/interface ar
a thread that does some insertion
through this handle/database connection(m_pgconn) and also another
thread that do some insertion *on the same table* through this
handle(m_pgconn), will that break?
Thanks
--
Wei Weng
Network Software Engineer
KenCast Inc.
---(end of
Why can't postmaster run VACUUM ANALYZE automatically every once in a
while? Since it is a very useful feature...
--
Wei Weng
Network Software Engineer
KenCast Inc.
---(end of broadcast)---
TIP 5: Have you checked our extensive FAQ?
On Fri, 2002-08-02 at 14:24, Stephan Szabo wrote:
> On 2 Aug 2002, Wei Weng wrote:
>
> > I am running postgresql as database backend, and I have some scripts
> > dealing with constant incoming data and then insert these data into the
> > database, in a quite complex wa
Forgot to mention, the version of postgresql I am running is 7.1.3.
On Fri, 2002-08-02 at 12:16, Wei Weng wrote:
> I am running postgresql as database backend, and I have some scripts
> dealing with constant incoming data and then insert these data into the
> database, in a quite co
?
Thanks
--
Wei Weng
Network Software Engineer
KenCast Inc.
---(end of broadcast)---
TIP 6: Have you searched our list archives?
http://archives.postgresql.org
;s of potentially unlimited length.
>
> --
> -Josh Berkus
>
>
I noticed that it is a characteristics of MS SQL Server, but I did
successfully create unique index based on a TEXT field in Postgresql
7.2, while that failed in MS SQL Server (7).
Or do they behave the same in this aspect
Is there any disadvantage of using TEXT datatype as opposed to a VARCHAR
datatype with a maximum length, especially when I do searches on them?
Thanks
--
Wei Weng
Network Software Engineer
KenCast Inc.
---(end of broadcast)---
TIP 3: if
Does ON DELETE CASCADE attribute you specify in CREATE TABLE statement
actually create triggers for every foreign key it refers to?
Thanks!
--
Wei Weng
Network Software Engineer
KenCast Inc.
---(end of broadcast)---
TIP 5: Have you checked
Hi there. I wrote a simple postgresql sql function as follows:
create function test() returns integer as '
begin
fixed_path := translate (''/text'', ''\\'', ''/'');
raise notice ''fixed_path:'', fixed_path;
return 1;
end
' language 'plpgsql';
And when I ran it as
pgsql>select test();
I got:
This should be really easy to implement in a function yourself. And I don't
think there is already something similar in pgsql.
======
Wei Weng
Network Software Engineer
KenCast Inc.
> -Original Message-
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]]On Behal
I would use
SELECT id FROM table ORDER BY id LIMIT 0, 3;
in order to get the top 3 results. The key is "Limit" keyword.
======
Wei Weng
Network Software Engineer
KenCast Inc.
> -Original Message-
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]]On Beh
_
> Do You Yahoo!?
> Get your free @yahoo.com address at http://mail.yahoo.com
>
>
> ---(end of broadcast)---
> TIP 6: Have you searched our list archives?
>
> http://www.post
Will increasing kernel shared memory size (in linux by doing "echo
134217728 >/proc/sys/kernel/shmall; echo 134217728
>/proc/sys/kernel/shmmax) help with the speed of a complicated query
with a large return set? (average 2 or more entries in return)
Thanks
--
Wei Weng
Netwo
How can I control that?
Where is the setting I can tweak? I checked the doc at
http://www.archonet.com/pgdocs/tweak-perf.html. Couldn't find any
reference to it.
Thanks!
--
Wei Weng
Network Software Engineer
KenCast Inc.
---(end of broa
Is there any gain on performance if you choose to create a view over a
very complex query instead of running the query itself directly?
Thanks!
--
Wei Weng
Network Software Engineer
KenCast Inc.
---(end of broadcast)---
TIP 4: Don't
traut wrote:
> Wei Weng writes:
>
> > Does that mean if I used
> > DECLARE
> > ...
> > BEGIN
> > DO_STUFF
> > END;
> >
> > the DO_STUFF will not be interrupted (maintain atomicity) even when
> > multiple threads use the function concurr
Does that mean if I used
DECLARE
...
BEGIN
DO_STUFF
END;
the DO_STUFF will not be interrupted (maintain atomicity) even when
multiple threads use the function concurrently?
On 06 Jul 2001 18:13:37 +0200, Peter Eisentraut wrote:
> Wei Weng writes:
>
> > If it is not, is it possibl
If it is not, is it possible to acquire a lock on a row ? how about a
lock on a table?
Thanks a lot!
--
Wei Weng
Network Software Engineer
KenCast Inc.
---(end of broadcast)---
TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]
as select test(); it broke down with an error message " Unterminated " "
Can anyone help me on this?
Thanks!
--
Wei Weng
Network Software Engineer
KenCast Inc.
---(end of broadcast)---
TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]
_NULL function in
pl/pgsql?
--
Wei Weng
Network Software Engineer
KenCast Inc.
---(end of broadcast)---
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to [EMAIL PROTECTED] so that your
message ca
INSERT. Does anyone know
What do you mean by "dump that uses INSERT"?a
> of a way I could undump my db?
>
--
Wei Weng
Network Software Engineer
KenCast Inc.
---(end of broadcast)---
TIP 3: if posting/reading through Usen
-
> TIP 6: Have you searched our list archives?
>
> http://www.postgresql.org/search.mpl
>
--
Wei Weng
Network Software Engineer
KenCast Inc.
---(end of broadcast)---
TIP 6: Have you searched our list archives?
http://www.postgresql.org/search.mpl
tatement should
> work.
> ( http://www.postgresql.org/idocs/index.php?queries.html#QUERIES-FROM )
>
> Any help would be appreciated. TIA
> kakerjak
>
>
>
> ---(end of broadcast)---
> TIP 4: Don't 'kill -9' the postmaster
>
--
Wei Weng
Network Software Engineer
KenCast Inc.
---(end of broadcast)---
TIP 4: Don't 'kill -9' the postmaster
7;table_a_id_seq'), 'test');
}
COMMIT
But as we know, you can't use control structure in a transaction block.
And I can't use a function either, because in the real application,
there are way too many parameters needed to be passed in order to do the
"insert" or "u
I have a table that has a serial for primary key. Is it possible to get
the new available primary key right after I insert a row of new entry?
Thanks
Wei
---(end of broadcast)---
TIP 4: Don't 'kill -9' the postmaster
I know this is not do-able, but is there any way to simulate the
following in Postgresql 7.1?
select id from
(select id, recv_date as date from table1
union
select id, send_date as date from table2) AS subtable
order by date;
Thanks a lot
Wei
---(end of broadcast)
Suppose I have a table
create table test
(
id integer,
name text
);
And I want to get the names of the largest 10 "id"s. How can I do that in
sql?
Thanks!
---(end of broadcast)---
TIP 2: you can get off all lists at once with t
84 matches
Mail list logo