[SQL] ERROR: Cannot display a value of type RECORD
I recieve this error when executing the following function: select lookup_journal_entries(to_date('20030125','MMDD'), to_date('20030125','MMDD')); Here is the function itself: create function lookup_journal_entries(date,date) returns setof journal as ' select * from journal where entry_date >= $1 OR entry_date <= $2' language 'SQL'; Normally I would expect to see a pointer # returned from the above select but instead I get this error. ---(end of broadcast)--- TIP 5: Have you checked our extensive FAQ? http://www.postgresql.org/users-lounge/docs/faq.html
Re: [SQL] ERROR: Cannot display a value of type RECORD
I figured out the issue, DH stupid mistake select entry_id, entry_description from lookup_journal_entries(to_date('20030125','MMDD'), to_date('20030125','MMDD')); > I recieve this error when executing the following function: > > select lookup_journal_entries(to_date('20030125','MMDD'), > to_date('20030125','MMDD')); > > Here is the function itself: > > create function lookup_journal_entries(date,date) returns setof journal > as ' select * from journal where entry_date >= $1 OR entry_date <= $2' > language 'SQL'; > > Normally I would expect to see a pointer # returned from the above > select but instead I get this error. > > > > ---(end of broadcast)--- > TIP 5: Have you checked our extensive FAQ? > > http://www.postgresql.org/users-lounge/docs/faq.html ---(end of broadcast)--- TIP 6: Have you searched our list archives? http://archives.postgresql.org
Re: [SQL] Function for adding Money type
On Friday 24 January 2003 19:17, Josh Berkus wrote: > The MONEY type is depreciated, and should have been removed from the > Postgres source but was missed as an oversight. Use NUMERIC instead. Note that not all of us agree. I had to change all of our fields from MONEY to NUMERIC recently because of the lack of support for MONEY but I would prefer to see it improved instead. Now that we have changed we find that we need to create a new table for balances driven by a trigger because calculating balances just went up in cost with that change. The reason is simply that MONEY used nothing but integer arithmetic and NUMERIC has to do a lot more processing in code. This year, my team is planning on improving the MONEY type. Of course, we can always make it a user defined type if PostgreSQL doesn't want it. We will at least put it into contrib. However, if people think that it is useful and want to leave it in the main tree that's good too. What we want to do is a) switch to a 64 bit integer from a 32 bit integer in order to hold amounts of any reasonabe size and b) allow it to be cast to and from more types. Perhaps we can also add the ability to specify the number of decimal places on output but I am not sure if that would affect the primary benefit of using it, speed. -- D'Arcy J.M. Cain| Democracy is three wolves http://www.druid.net/darcy/| and a sheep voting on +1 416 425 1212 (DoD#0082)(eNTP) | what's for dinner. ---(end of broadcast)--- TIP 5: Have you checked our extensive FAQ? http://www.postgresql.org/users-lounge/docs/faq.html
Re: [SQL] Function for adding Money type
On Sun, 26 Jan 2003, D'Arcy J.M. Cain wrote: > This year, my team is planning on improving the MONEY type. Of course, we can > always make it a user defined type if PostgreSQL doesn't want it. We will at > least put it into contrib. However, if people think that it is useful and > want to leave it in the main tree that's good too. What we want to do is a) > switch to a 64 bit integer from a 32 bit integer in order to hold amounts of > any reasonabe size and b) allow it to be cast to and from more types. > Perhaps we can also add the ability to specify the number of decimal places > on output but I am not sure if that would affect the primary benefit of using > it, speed. Hey good news D'Arcy! I prefer using MONEY as well. --- Thomas Good e-mail: [EMAIL PROTECTED] Programmer/Analyst phone: (+1) 718.818.5528 Residential Services fax: (+1) 718.818.5056 Behavioral Health Services, SVCMC-NY mobile: (+1) 917.282.7359 --Geistiges Eigentum ist Diebstahl! -- ---(end of broadcast)--- TIP 2: you can get off all lists at once with the unregister command (send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])
Re: [SQL] Function for adding Money type
On Sun, 2003-01-26 at 13:53, D'Arcy J.M. Cain wrote: > This year, my team is planning on improving the MONEY type. Of course, we can > always make it a user defined type if PostgreSQL doesn't want it. We will at > least put it into contrib. However, if people think that it is useful and > want to leave it in the main tree that's good too. What we want to do is a) > switch to a 64 bit integer from a 32 bit integer in order to hold amounts of > any reasonabe size and b) allow it to be cast to and from more types. > Perhaps we can also add the ability to specify the number of decimal places > on output but I am not sure if that would affect the primary benefit of using > it, speed. A money type needs to specify what currency is held. The current one changes the currency with the locale, which makes nonsense of existing data. -- Oliver Elphick[EMAIL PROTECTED] Isle of Wight, UK http://www.lfix.co.uk/oliver GPG: 1024D/3E1D0C1C: CA12 09E0 E8D5 8870 5839 932A 614D 4C34 3E1D 0C1C "Wash me thoroughly from mine iniquity, and cleanse me from my sin. For I acknowledge my transgressions; and my sin is ever before me. Against thee, thee only, have I sinned, and done this evil in thy sight..." Psalms 51:2-4 ---(end of broadcast)--- TIP 3: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to [EMAIL PROTECTED] so that your message can get through to the mailing list cleanly
Re: [SQL] Scheduling Events?
> > Yes! cron > > > Here is the basic problem w/ using CRON in an accounting situation. > > I can't be sure that cron will always be up when the DB is up, > so lets say crond goes down for some random reason (User, System error, > Etc..) > > And outside adjustment is made to lets say the equipment account and that > adjustment was made on the value of the equipment, BUT it hadn't been > depreciated because crond went down and no one notice. > > Now I have a HUGE issue! > > So I have to be sure that all entries/adjustments are made accurately in > the time frame they were meant to happen in. > It seems that you have a good concern, so I have a suggestion. First, let me say that if you cannot count on cron to run your stuff at a certain time, then you cannot count on anything to run your stuff at a certain time. All of your reasoning for distrusting cron is perfectly valid in distrusting every conceivable automated system. Therefore, you have to design your application with the assumption that your scheduling system is untrustworthy. If you do that, then you have the freedom to use cron (or some other scheduling system) and build checks into your database activities to ensure that invalid data cannot be used if your scheduled processes did not take place. If you don't want to make changes to existing code, then you can create a solution as simple as a rule on your essential table(s) that first checks to make sure the most recent scheduled task was completed successfully and if it hasn't completed return something that the client will understand as invalid. If you're unfamiliar with "rules", they essentially rewrite your query on the fly. To quote Bruce Momjian's book, PostgreSQL: Introduction and Concepts, "Rules allow actions to take place when a table is accessed. In this way, they can modify the effects of SELECT, INSERT, UPDATE, and DELETE." I'm sure that you can think of several acceptable solutions if you learn to distrust your data. -- Matthew Nuzum www.bearfruit.org [EMAIL PROTECTED] ---(end of broadcast)--- TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]
Re: [SQL] PostgreSQL + SSL
Actually, the new 7.3.1 error message is: if (!S_ISREG(buf.st_mode) || (buf.st_mode & 0077) || buf.st_uid != getuid()) { postmaster_error("bad permissions on private key file (%s)\n" "File must be owned by the proper user and must have no permissions for\n" "\"group\" or \"other\".", fnbuf); ExitPostmaster(1); } so that should be clearer for people when it fails. 7.3 had similar restrictions, but reported the failure more concisely. --- Bhuvan A wrote: > > > I?m trying to config PG with SSL, but i got a error. I create the key > > and the certificate and put both in $PGDATA directory. I also enabled > > the ssl option in postgresql.conf. But when i run postmaster i got a > > error saying that server.key has wrong permissions. > > It reports the error in either of the below cases: > > 1. If the file permission is not -r--r--r--. > 2. If the certificate and the private key are invalid. > > The clear advice is available in the documentation itself. Try out > http://developer.postgresql.org/docs/postgres/ssl-tcp.html for details. > > regards, > bhuvaneswaran > > > > > ---(end of broadcast)--- > TIP 2: you can get off all lists at once with the unregister command > (send "unregister YourEmailAddressHere" to [EMAIL PROTECTED]) > -- Bruce Momjian| http://candle.pha.pa.us [EMAIL PROTECTED] | (610) 359-1001 + If your life is a hard drive, | 13 Roberts Road + Christ can be your backup.| Newtown Square, Pennsylvania 19073 ---(end of broadcast)--- TIP 2: you can get off all lists at once with the unregister command (send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])
Re: [SQL] [ADMIN] how sub queries and joins differs funcationally
Hi shreedhar : --- shreedhar <[EMAIL PROTECTED]> wrote: > Can any body tell that how sub queries and joins > differs funcationally. > Because sub queries taking lot of time than joins. > The following could be the probable reasons: a) Your are using correlated queries - Correlated queries always re-evaluate the sub-query for each row processed. b) You have an IN clause - try using EXISTS clause, since it IN clause doesn't utilize the index when your subquery is another SELECT statement. ludwig. __ Do you Yahoo!? New DSL Internet Access from SBC & Yahoo! http://sbc.yahoo.com ---(end of broadcast)--- TIP 6: Have you searched our list archives? http://archives.postgresql.org