Thread
-
Re: disabling OIDs?
Mark Dexter <mdexter@dexterchaney.com> — 2004-12-13T20:13:27Z
I don't know why they use OID's for cursors. But I do know that if you run a trace the SQL that creates the cursor uses OID's, so it doesn't work if the table is created without OID's. Also, if you want to have updateable cursors against views (i.e., a view with rules for INSERT, UPDATE, and DELETE), you must name the OID and CTID as columns in the view. Again, we learned this the hard way. Mark Dexter -----Original Message----- From: gsstark@mit.edu [mailto:gsstark@mit.edu] Sent: Monday, December 13, 2004 12:06 PM To: Mark Dexter Cc: pgsql-general@postgresql.org; gsstark@mit.edu Subject: Re: disabling OIDs? "Mark Dexter" <MDEXTER@dexterchaney.com> writes: > > For what it's worth, OIDs are required if you ever want to use > > updateable cursors with the ODBC driver. We discovered this the > > hard way. Mark Dexter That's unfortunate. Is it because it's difficult to track down the primary key of the table? Is it any easier to track down the primary key of the table in 8.0? It would be much better if it checked the primary key and used that instead of OIDs. Though I'm unclear implementing "updateable cursors" in the client-end is really a good idea. I suppose it's nice if you understand the limitations inherent. -- greg
-
Re: SELECTing on age
Kall, Bruce A. <kall@mayo.edu> — 2004-12-13T21:15:46Z
I'm attempting to select records from my postgresql database using php based on whether someone is at least 17 years old on the date of a particular visit. My sql is: $db_sql = "SELECT * from list WHERE ((visit_date - birth_date) >= 17)'" $db_result = db_exec($db_sql) $num = pg_num_rows($db_result); for($i = 0; $i < $num; $i++) { $data = pg_num_rows($db_result,$i) $visit_date = $data["visit_date"]; $birth_date = $data["birth_date"]; echo "Visit date[$visit_date] Birth date[$birth_date]"; } The problem I'm having is that the the query is returning results for some people with ages < 17 (most of them are correct, just a couple of incorrect ones interspersed with the correct ones that are over 17)? For example, my output contains: Visit date[2004-07-14] Birth date[2004-02-19] and Visit date[2004-08-11] Birth date[2003-04-21] which are clearly people who are < 17. Any suggestions on how to track down this problem or rework the query so it always works correctly? If I reverse the query and look for people < 17, I don't get any that are older than 17. Thanks, Bruce -
Re: SELECTing on age
Scott Marlowe <smarlowe@g2switchworks.com> — 2004-12-13T21:39:25Z
On Mon, 2004-12-13 at 15:15, Kall, Bruce A. wrote: > I'm attempting to select records from my postgresql database using php > based on whether someone is at least 17 years old on the date of a > particular visit. > > My sql is: > > $db_sql = "SELECT * from list WHERE ((visit_date - birth_date) >= 17)'" > $db_result = db_exec($db_sql) > $num = pg_num_rows($db_result); > for($i = 0; $i < $num; $i++) > { > $data = pg_num_rows($db_result,$i) > $visit_date = $data["visit_date"]; > $birth_date = $data["birth_date"]; > echo "Visit date[$visit_date] Birth date[$birth_date]"; > } > > The problem I'm having is that the the query is returning results for > some people with ages < 17 (most of them are correct, just a couple of > incorrect ones interspersed with the correct ones that are over 17)? > > For example, my output contains: > > Visit date[2004-07-14] Birth date[2004-02-19] > and > Visit date[2004-08-11] Birth date[2003-04-21] > > which are clearly people who are < 17. Check out what this query tells you: postgres=# select ('2004-07-31'::date-'2004-07-01'::date); ?column? ---------- 30 Notice how the output of subtracting one date from another is an int for the number of days? A better way would be: select * from table1 where dt <now()-'17 years'::interval; -
increasing max_connections on freebsd
Hengki Suhartoyo <hengman03@yahoo.com> — 2004-12-14T10:46:44Z
Hello... I want to increase my max_connections up to 128 connections, but I got that I need to recompile my kernel. I'm newbie in postgresql and freebsd. How to increase max_connections and recompile freebsd kernel. Help Me please..... Thank's __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com
-
Re: increasing max_connections on freebsd
Frank D. Engel, Jr. <fde101@fjrhome.net> — 2004-12-14T15:01:47Z
You might want to check some of these sites: http://www.silverwraith.com/papers/freebsd-kernel.php http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/ kernelconfig.html Anyone have a clue why he would need to recompile his kernel for this, though? On Dec 14, 2004, at 5:46 AM, Hengki Suhartoyo wrote: > Hello... > > I want to increase my max_connections up to 128 > connections, but I got that I need to recompile my > kernel. I'm newbie in postgresql and freebsd. How to > increase max_connections and recompile freebsd kernel. > > Help Me please..... > > Thank's > > __________________________________________________ > Do You Yahoo!? > Tired of spam? Yahoo! Mail has the best spam protection around > http://mail.yahoo.com > > ---------------------------(end of > broadcast)--------------------------- > TIP 3: if posting/reading through Usenet, please send an appropriate > subscribe-nomail command to majordomo@postgresql.org so that your > message can get through to the mailing list cleanly > > ----------------------------------------------------------- Frank D. Engel, Jr. <fde101@fjrhome.net> $ ln -s /usr/share/kjvbible /usr/manual $ true | cat /usr/manual | grep "John 3:16" John 3:16 For God so loved the world, that he gave his only begotten Son, that whosoever believeth in him should not perish, but have everlasting life. $ ___________________________________________________________ $0 Web Hosting with up to 120MB web space, 1000 MB Transfer 10 Personalized POP and Web E-mail Accounts, and much more. Signup at www.doteasy.com
-
Re: increasing max_connections on freebsd
Michael Fuhr <mike@fuhr.org> — 2004-12-14T16:53:39Z
On Tue, Dec 14, 2004 at 10:01:47AM -0500, Frank D. Engel, Jr. wrote: > On Dec 14, 2004, at 5:46 AM, Hengki Suhartoyo wrote: > > > >I want to increase my max_connections up to 128 > >connections, but I got that I need to recompile my > >kernel. I'm newbie in postgresql and freebsd. How to > >increase max_connections and recompile freebsd kernel. > > You might want to check some of these sites: > > http://www.silverwraith.com/papers/freebsd-kernel.php > http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/ > kernelconfig.html > > Anyone have a clue why he would need to recompile his kernel for this, > though? The error probably says something about not having enough shared memory or semaphores. On FreeBSD some IPC settings can be configured via sysctl but others might need to be built into the kernel. For example, on FreeBSD 4, trying to set kern.ipc.semmni or kern.ipc.semmns with sysctl fails, saying that the OID is read-only. -- Michael Fuhr http://www.fuhr.org/~mfuhr/
-
Re: increasing max_connections on freebsd
Christian Kratzer <ck-lists@cksoft.de> — 2004-12-14T17:34:05Z
On Tue, 14 Dec 2004, Michael Fuhr wrote: > On Tue, Dec 14, 2004 at 10:01:47AM -0500, Frank D. Engel, Jr. wrote: [snipp] > The error probably says something about not having enough shared > memory or semaphores. On FreeBSD some IPC settings can be configured > via sysctl but others might need to be built into the kernel. For > example, on FreeBSD 4, trying to set kern.ipc.semmni or kern.ipc.semmns > with sysctl fails, saying that the OID is read-only. At least on FreeBSD 5.x there is no need to build a customer kernel. The following can be set in /boot/loader.conf # defaults for FreeBSD are as follows # SEMMNI=10, # of semaphore identifiers # SEMMNS=60, # of semaphores in system # SEMUME=10, max # of undo entries per process # SEMMNU=30, # of undo structures in system kern.ipc.semmni=40 kern.ipc.semmns=240 kern.ipc.semume=40 kern.ipc.semmnu=120 these will be set on boot. Greetings Christian -- Christian Kratzer ck@cksoft.de CK Software GmbH http://www.cksoft.de/ Phone: +49 7452 889 135 Fax: +49 7452 889 136
-
Re: increasing max_connections on freebsd
Michael Fuhr <mike@fuhr.org> — 2004-12-14T18:15:40Z
On Tue, Dec 14, 2004 at 06:34:05PM +0100, Christian Kratzer wrote: > > At least on FreeBSD 5.x there is no need to build a customer kernel. > The following can be set in /boot/loader.conf I forgot about /boot/loader.conf. If I get a chance I'll check if the settings you posted also work in FreeBSD 4. Thanks. -- Michael Fuhr http://www.fuhr.org/~mfuhr/
-
Re: increasing max_connections on freebsd
Vivek Khera <khera@kcilink.com> — 2004-12-22T17:18:11Z
>>>>> "MF" == Michael Fuhr <mike@fuhr.org> writes: MF> On Tue, Dec 14, 2004 at 06:34:05PM +0100, Christian Kratzer wrote: >> >> At least on FreeBSD 5.x there is no need to build a customer kernel. >> The following can be set in /boot/loader.conf MF> I forgot about /boot/loader.conf. If I get a chance I'll check if MF> the settings you posted also work in FreeBSD 4. Thanks. Yes, they do. You can also bump maxfiles if necessary via a sysctl. -- =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Vivek Khera, Ph.D. Khera Communications, Inc. Internet: khera@kciLink.com Rockville, MD +1-301-869-4449 x806 AIM: vivekkhera Y!: vivek_khera http://www.khera.org/~vivek/