Re: [GENERAL] select unique items in db

2006-09-13 Thread Stijn Vanroye
a schreef: select unique id - i found this line in google search but i want to make select * as unique select unique * is or select distinct pls point out how to select unique items from a list of million items Maybe select distinct fieldlist from ... or select distinct on (field1,field2)

[GENERAL] Template1 oops

2006-09-13 Thread Alban Hertroys
I found an oops in one of our template1 databases; tables and stuff were apparently loaded into the wrong database (namely template1). I found this page describing a solution: http://techdocs.postgresql.org/techdocs/pgsqladventuresep1.php But, this looks kind of risky to me. I'd prefer not to

Re: [GENERAL] berkley sockets

2006-09-13 Thread Chris Mair
On Wed, 2006-09-13 at 01:51 -0400, J S B wrote: I don't want to connect to the postgres database. The scenario is something like this. Postgres database has to initiate some deamon process running is another server. The only way i could think of doing this was openeing a socket

Re: [GENERAL] [NOVICE] INSERT does not finish except if it is carried out a

2006-09-13 Thread Brandon Aiken
Why drop and recreate the table? Why not TRUNCATE it? -- Brandon Aiken CS/IT Systems Engineer -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Matthieu Guamis Sent: Wednesday, September 13, 2006 6:15 AM To: [EMAIL PROTECTED] Subject: Re: [NOVICE] INSERT

Re: [GENERAL] [NOVICE] Question About Aggregate Functions

2006-09-13 Thread Brandon Aiken
Ah, I did not know what was in your fields, so I did not assume they were Boolean values. It looked to me like you were trying to use IS TRUE to substitute for the lack of a GROUP BY, so I didnt know what to do. Yes, count() will include all non-NULL values. Sorry if I sounded unclear

Re: [GENERAL] Template1 oops

2006-09-13 Thread Michael Fuhr
On Wed, Sep 13, 2006 at 10:56:41AM +0200, Alban Hertroys wrote: I found an oops in one of our template1 databases; tables and stuff were apparently loaded into the wrong database (namely template1). I found this page describing a solution:

[GENERAL] Problems with date configuration

2006-09-13 Thread Fabi Avilés
Hi, I had an application in which I used postgres 7.4, and then only thing refering to date was: datestyle = 'ISO,European'everything else was commented. Now I have had to change the OS and I've installed postgres 8.1.3, but this configuration is different, it's something like: lc_monetary =

Re: [GENERAL] Template1 oops

2006-09-13 Thread Berend Tober
On Wed, Sep 13, 2006 at 10:56:41AM +0200, Alban Hertroys wrote: I found an oops in one of our template1 databases; tables and stuff were apparently loaded into the wrong database (namely template1). I found this page describing a solution:

Re: [GENERAL] Template1 oops

2006-09-13 Thread Alban Hertroys
Berend Tober wrote: On Wed, Sep 13, 2006 at 10:56:41AM +0200, Alban Hertroys wrote: I'm humble (or naive) enough to admit that I've used the approach outlined there by Josh Berkus, and it worked fine. More than once, even. I'm quite certain that approach can be made more bullet-proof by

Re: [GENERAL] Template1 oops

2006-09-13 Thread Andrew - Supernews
On 2006-09-13, Alban Hertroys [EMAIL PROTECTED] wrote: I'm quite certain that approach can be made more bullet-proof by wrapping it inside a transaction. I saw no mention of that on his page. It's quite amazing what PostgreSQL can handle inside transactions :) Some of the few things that pg

Re: [GENERAL] Template1 oops

2006-09-13 Thread Scott Marlowe
On Wed, 2006-09-13 at 10:05, Alban Hertroys wrote: Berend Tober wrote: On Wed, Sep 13, 2006 at 10:56:41AM +0200, Alban Hertroys wrote: I'm humble (or naive) enough to admit that I've used the approach outlined there by Josh Berkus, and it worked fine. More than once, even. I'm quite

[GENERAL] Garbage data sent by Windows 98 client

2006-09-13 Thread Andrus
I use ODBC driver to access PostgresSQL 8.1 servers from Windows 98 computer from Microsoft Visual FoxPro 9 application. In a number of client and servers, it is not possible to send data to server. PostgreSQL log file shows shows that garbage characters are received. Server responds to

Re: [GENERAL] [NOVICE] Question About Aggregate Functions

2006-09-13 Thread Don Parris
On 9/13/06, Brandon Aiken [EMAIL PROTECTED] wrote: Ah, I did not know what was in your fields, so I did not assume they were Boolean values. It looked to me like you were trying to use IS TRUE to substitute for the lack of a GROUP BY, so I didn't know what to do.That was in the

Re: [GENERAL] serial, sequence, and COPY FROM

2006-09-13 Thread rloefgren
Thanks for all the help, it works and I've learned some more about COPY, which is treated thinly in Douglas's first edition of PostgreSQL (which was my source.) r ---(end of broadcast)--- TIP 4: Have you searched our list archives?

[GENERAL] Load myLib.so error cannot load obj file...

2006-09-13 Thread didier tanti
Hello,i am desesperate to get this resolved, you are my only hope here is the issue:i am compiling a .so using:gcc -shared libxx.so -lpcre,then in my DB, i am trying:LOAD '/myPath/libxx.so',it keeps returning me :ERROR: could not load library "/myPath/libxx.so": libpcre.so : cannot open shared

Re: [GENERAL] Load myLib.so error cannot load obj file...

2006-09-13 Thread Tom Lane
didier tanti [EMAIL PROTECTED] writes: ERROR: could not load library /myPath/libxx.so: libpcre.so : cannot open shared object file: No such file or directory. the problem is that the libpcre.so does exist and is in my LD_LIBRARY_PATH, But is it in the postmaster's LD_LIBRARY_PATH? That's

Re: [GENERAL] [NOVICE] Question About Aggregate Functions

2006-09-13 Thread Brandon Aiken
I think I mistakenly sent this to General instead of Novice. Oops. Yeah, I either skipped over or forgot the bit in the OP about bools. Mea culpa. You should be able to use OR instead of AND in any logical _expression_. Well this sounds more like what I want. Given t2.fielda,

[GENERAL] Kill specific connection

2006-09-13 Thread snacktime
What's a safe way to kill a specific connection to the database? I'm testing some code that reconnects if a connection has timed out or gone bad and I need to simulate a connection that has gone away. Chris ---(end of broadcast)--- TIP 9: In

Re: [GENERAL] Kill specific connection

2006-09-13 Thread Tom Lane
snacktime [EMAIL PROTECTED] writes: What's a safe way to kill a specific connection to the database? I'm testing some code that reconnects if a connection has timed out or gone bad and I need to simulate a connection that has gone away. Disconnecting a network cable might be the easiest test.

Re: [GENERAL] berkley sockets

2006-09-13 Thread Tony Caduto
J S B wrote: I don't want to connect to the postgres database. The scenario is something like this. Postgres database has to initiate some deamon process running is another server. The only way i could think of doing this was openeing a socket connection between postgres database and the

Re: [GENERAL] Kill specific connection

2006-09-13 Thread Steve Crawford
snacktime wrote: What's a safe way to kill a specific connection to the database? I'm testing some code that reconnects if a connection has timed out or gone bad and I need to simulate a connection that has gone away. There are various ways. The two easiest are to use iptables to block

Re: [GENERAL] berkley sockets

2006-09-13 Thread J S B
Thanks alot Tony. just wondering if the same can be done with C ~Jas On 9/13/06, Tony Caduto [EMAIL PROTECTED] wrote: J S B wrote: I don't want to connect to the postgres database. The scenario is something like this. Postgres database has to initiate some deamon process running is another

Re: [GENERAL] remote duplicate rows

2006-09-13 Thread Ron Johnson
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 09/13/06 19:36, ljb wrote: [EMAIL PROTECTED] wrote: hI i have a bad situation that i did not have primary key. so i have a table like this colname1colname2 1 apple 1

Re: [GENERAL] Issue with order by for type varchar

2006-09-13 Thread Simon_Kelly
Thanks Martijn. Simon Kelly Java Developer Information Systems Development Information Technology Shared Services Ministry of Health DDI: Mobile: http://www.moh.govt.nz mailto:[EMAIL PROTECTED] [EMAIL PROTECTED] wrote on 13/09/2006 01:33:15 a.m.: On Tue, Sep 12, 2006 at 09:51:20AM +1200,

[GENERAL] remote duplicate rows

2006-09-13 Thread Junkone
hI i have a bad situation that i did not have primary key. so i have a table like this colname1colname2 1 apple 1 apple 2 orange 2 orange It is a very

[GENERAL] oracle listener intercept

2006-09-13 Thread David Link
Hi,I'm looking at replacing an Oracle database that only has a few tables, but that is accessed by many programs in the company via oracle jdbc drivers, oracle odbc drivers and python database interface. Is there a way to intercept the calls to the oracle listener and redirect to postgres without

Re: [GENERAL] select unique items in db

2006-09-13 Thread a
this doesnt work SELECT DISTINCT on link *, rank(ts_vec, to_tsquery('default', $qtxt)) FROM feed_entry WHERE ts_vec @@ to_tsquery('default', $qtxt) ORDER BY rank(ts_vec, to_tsquery('default', $qtxt)) DESC LIMIT 5 OFFSET 0 can you tell me how to get the DISTINCT elements in LINK thanks Stijn