Re: [SQL] [NOVICE] Install two different versions of postgres which should run in parallel
On 8/13/07, Tom Lane <[EMAIL PROTECTED]> wrote: > > "Loredana Curugiu" <[EMAIL PROTECTED]> writes: > > For installing I am running the "configure" script as follows: > > > ./configure --prefix=/usr/local/pgsql-7.4.5 --with-java > --with-pgport=6947 > > > Although I specify a different port than the default one, the postgres > it is > > installed with the default port. > > On what grounds do you conclude that? I use --with-pgport every day. > It works fine. For me it didn't work. I had to specify in postgresql.conf the port and after that it worked. Thank you for the replys. Were very usefull. Greetings, Loredana
Re: [SQL] Authentification failed
Judith wrote: > Hello everybody!! > > I'm trying in SUSE to connect to a postgres db and this is the error: > > Ident Authentification failed for user <> > > I'm already created the user with createuser root, but the error > persist, I would aprecciate some help, thanks in advanced ...or just cheat and get in as the postgres root user: psql -U postgres Which on SUSE has no password. -- Visit http://www.obviously.com/ ---(end of broadcast)--- TIP 9: In versions below 8.0, the planner will ignore your desire to choose an index scan if your joining column's datatypes do not match
Re: [SQL] Authentification failed
Connecting as root may be ill advised (doing stuff as root is a bad idea unless one HAS to). All that notwithstanding, you need to setup the correct permissions to allow the connections you want in pg_hba.conf, usually is /var/lib/pgsql/data/pg_hba.conf Terry Terry Fielder [EMAIL PROTECTED] Associate Director Software Development and Deployment Great Gulf Homes / Ashton Woods Homes Fax: (416) 441-9085 Bryce Nesbitt wrote: Judith wrote: Hello everybody!! I'm trying in SUSE to connect to a postgres db and this is the error: Ident Authentification failed for user <> I'm already created the user with createuser root, but the error persist, I would aprecciate some help, thanks in advanced ...or just cheat and get in as the postgres root user: psql -U postgres Which on SUSE has no password.
Re: [SQL] Best Fit SQL query statement
De: hubert depesz lubaczewski [mailto:[EMAIL PROTECTED] >>On Fri, Aug 10, 2007 at 04:40:34PM -0300, Fernando Hevia wrote: >> Found your query is shorter and clearer, problem is I couldn't have it use >> an index. Thought it was a locale issue but adding a 2nd index with >> varchar_pattern_ops made no difference. >> In result, it turned out to be too slow in comparison to the function. Am I >> missing something? >> rd=# explain select prefijo >> rd-# FROM numeracion >> rd-# WHERE '3514269565' LIKE prefijo || '%' >> rd-# ORDER BY LENGTH(prefijo) DESC >> rd-# LIMIT 1; > unfortunatelly this query will be hard to optimize. > i guess that functional approach will be the fastest, but you can try > with something like this: > > select prefijo > from numeracion > where prefijo in ( > select substr('3514269565',1,i) > from generate_series(1, length('3514269565')) i > ) > order by length(prefijo) desc LIMIT 1; > >it should be faster then the previous approach, but it will most >probably not be as fast as function. Actually, I find this variant nearly as fast as the function. The generate_series can be limited to known minimum and maximum prefix lengths in order to speed up the query a bit more. Works quite well. Cheers, Fernando. ---(end of broadcast)--- TIP 7: You can help support the PostgreSQL project by donating at http://www.postgresql.org/about/donate
[SQL] When is a shared library unloaded?
I have a shared library loaded into postgresql using CREATE FUNCTION medbevent() RETURNS trigger as '/usr/lib/pgsql/libmedbevent.so' language 'C'; I'm randomly having issues with my triggers not firing (it turns out they are getting removed) and when i turned INFO logs on i saw the following 2007-08-14 13:41:44.740305500 LOCATION: _fini, medbevent_init.c:129 2007-08-14 13:41:45.790850500 INFO: 0: medbeventlib -Unloading library _fini() is called Could someone please explain when a shared library gets loaded/unloaded and how this all works? I'm getting the above logs when i wouldn't expect to see the library be unloaded which is causing me problems. Could the library get unloaded in this manner due to an internal error in the library? Thanks, Jon. ---(end of broadcast)--- TIP 7: You can help support the PostgreSQL project by donating at http://www.postgresql.org/about/donate
Re: [SQL] When is a shared library unloaded?
"Jon Horsman" <[EMAIL PROTECTED]> writes: > I'm randomly having issues with my triggers not firing (it turns out > they are getting removed) and when i turned INFO logs on i saw the > following > 2007-08-14 13:41:44.740305500 LOCATION: _fini, medbevent_init.c:129 > 2007-08-14 13:41:45.790850500 INFO: 0: medbeventlib -Unloading > library _fini() is called > Could someone please explain when a shared library gets > loaded/unloaded and how this all works? Are you sure the above doesn't just occur during server process termination? AFAIK Postgres never unloads a library, except when you specifically command it to load an updated version via the LOAD command. regards, tom lane ---(end of broadcast)--- TIP 2: Don't 'kill -9' the postmaster
Re: [SQL] populate value of column
I believe they are standard PostgreSQL functions not sure what version they appeared in though. I learnt about them by RTM Cheers, ~p -Original Message- From: Ronald Rojas [mailto:[EMAIL PROTECTED] Sent: Tuesday, 14 August 2007 18:00 To: Phillip Smith Subject: Re: [SQL] populate value of column Hi philipp, How do i get those built-in function like LPAD, GENERATE_SERIES in postgresql? is there a query where I can list down those? Thanks in advance. Ronald On Wed, 2007-08-08 at 15:37 +1000, Phillip Smith wrote: -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of novice Sent: Wednesday, 8 August 2007 15:31 To: pgsql-sql@postgresql.org Subject: [SQL] populate value of column > How can I generate the following result? > > meter_id | bay > --+ > 1001 | 01 > 1001 | 02 > 1001 | 03 > 1001 | 04 > 1012 | 01 > 1012 | 02 > 1012 | 03 > 1012 | 04 > 1012 | 05 > 1012 | 06 I even tested this one too ;) SELECT meter_id, LPAD(GENERATE_SERIES(1,area_no),2,'0') FROMmeter; Works on 8.2.4 - you didn't say what version you were using. ***Confidentiality and Privilege Notice*** The material contained in this message is privileged and confidential to the addressee. If you are not the addressee indicated in this message or responsible for delivery of the message to such person, you may not copy or deliver this message to anyone, and you should destroy it and kindly notify the sender by reply email. Information in this message that does not relate to the official business of Weatherbeeta must be treated as neither given nor endorsed by Weatherbeeta. Weatherbeeta, its employees, contractors or associates shall not be liable for direct, indirect or consequential loss arising from transmission of this message or any attachments THINK BEFORE YOU PRINT - Save paper if you don't really need to print this e-mail. ---(end of broadcast)--- TIP 9: In versions below 8.0, the planner will ignore your desire to choose an index scan if your joining column's datatypes do not match == Ronald Rojas Systems Administrator Linux Registered User #427229 == MSDOS didn't get as bad as it is overnight -- it took over ten years of careful development. -- [EMAIL PROTECTED] THINK BEFORE YOU PRINT - Save paper if you don't really need to print this ***Confidentiality and Privilege Notice*** The material contained in this message is privileged and confidential to the addressee. If you are not the addressee indicated in this message or responsible for delivery of the message to such person, you may not copy or deliver this message to anyone, and you should destroy it and kindly notify the sender by reply email. Information in this message that does not relate to the official business of Weatherbeeta must be treated as neither given nor endorsed by Weatherbeeta. Weatherbeeta, its employees, contractors or associates shall not be liable for direct, indirect or consequential loss arising from transmission of this message or any attachments e-mail. ---(end of broadcast)--- TIP 6: explain analyze is your friend