[GENERAL] functions list
Hi, is there a detailed discription of postgresql functions which I get with \df. Or a detailed document about them. thanks... Murat
Re: [GENERAL] functions list
Hi, is there a detailed discription of postgresql functions which I get with \df. Or a detailed document about them. What more info do you need? Maybe the documenation in docs? -- Bruce Momjian| http://www.op.net/~candle [EMAIL PROTECTED]| (610) 853-3000 + If your life is a hard drive, | 830 Blythe Avenue + Christ can be your backup.| Drexel Hill, Pennsylvania 19026
Re: [GENERAL] functions list
Some detailed discription, some examples, bu at least the list of them. I can't put the output of \df command to a file. Try: echo "\\df" | psql test file There is a short one-line description of each one. Do you need more? -- Bruce Momjian| http://www.op.net/~candle [EMAIL PROTECTED]| (610) 853-3000 + If your life is a hard drive, | 830 Blythe Avenue + Christ can be your backup.| Drexel Hill, Pennsylvania 19026
Re: [GENERAL] select using date
Try: select current_date, CURRENT_DATE - INTERVAL '1 DAY'; ?column?|?column? --+-- 1999-01-08|1999-01-07 00:00:00+01 (1 row) PostgreSQL has a syntax sligth different than SQL92. You have to enclose '1 DAY' instead of '1' DAY. -Jose'- Kevin Heflin wrote: Trying to use select statement using CURRENT_DATE Which works fine like so: select * from headlines where dateof = CURRENT_DATE order by dateof desc But I'm also wanting to do something similar to: select * from headlines where dateof = CURRENT_DATE - INTERVAL '1' DAY order by dateof desc Basically just trying to subtract 1 day from the CURRENT_DATE When I try the above I get ERROR: parser: parse error at or near "day" Any suggestions would be appreciated. Kevin Kevin Heflin | ShreveNet, Inc. | Ph:318.222.2638 x103 VP/Mac Tech | 333 Texas St #619| FAX:318.221.6612 [EMAIL PROTECTED]| Shreveport, LA 71101 | http://www.shreve.net
Re: [GENERAL] select using date
On Fri, 8 Jan 1999, Jose' Soares wrote: Try: select current_date, CURRENT_DATE - INTERVAL '1 DAY'; ?column?|?column? --+-- 1999-01-08|1999-01-07 00:00:00+01 (1 row) PostgreSQL has a syntax sligth different than SQL92. You have to enclose '1 DAY' instead of '1' DAY. Well, I tried: select current_date, CURRENT_DATE - INTERVAL '1 DAY'; but receive the following: ERROR: There is no operator '-' for types 'date' and 'timespan' You will either have to retype this query using an explicit cast, or you will have to define the operator using CREATE OPERATOR After trying somethings, I was able to get this to work: select CURRENT_DATE -1; will subtract 1 day from the current date... which gives me what I need for now. Thanks Kevin Kevin Heflin | ShreveNet, Inc. | Ph:318.222.2638 x103 VP/Mac Tech | 333 Texas St #619| FAX:318.221.6612 [EMAIL PROTECTED]| Shreveport, LA 71101 | http://www.shreve.net
[GENERAL] Callable Statement in JDBC
Hi, I'm using Postgre in my Java program. The Java bean (JCDatasource from KL group) require callable statement when saving to the DB. But Postgre report Callable statement is not supported. Anybody knows if 6.4 support callable statement? Or anyother ways to work around? Thank you very much. Sze Wong _ DO YOU YAHOO!? Get your free @yahoo.com address at http://mail.yahoo.com
Re: [GENERAL] Patch 6.4.1 to 6.4.2
The Hermit Hacker [EMAIL PROTECTED] writes: On Wed, 6 Jan 1999, Silvio Emanuel Barbosa de Macedo wrote: Hi! Where can I find the required patch to upgrade 6.4.1 to 6.4.2 ? There is no patch for this...we've tried in the past to create "clean" patches, and each time so problem arose from it... You make jokes ? Nearly any Open Source developer has managed that. Where's the problem ? tar -xfz postgres-VERS1.tar.gz tar -xfz postgres-VERS2.tar.gz diff -u --recursive --new-file postgres-VERS1 postgres-VERS2 That's all Ciao Racke -- Racke's Package and Resource Database (http://www.han.de/~racke/pard/) 486 packages, 60 resources, 10 distributions covered
[GENERAL] postgresql v6.4.2 c funcs and null text pointers...
I wrote a c func (ATTACHED BELOW) which takes 2 pointers to type text, and a bool field. When a field in a row passed to the func is null, espically the 'first' field, Postgresql does not return the value that my code produced. For example: First lastco nocompany -- NULLWalt BigelowTrue the above data is contained in the database, and when passed to my c func like: SELECT lastfirst(first, lastco, nocompany) as name from tbladdress where agencyid = 691; I get: name (1 row) Not the expected output of 'Walt Bigelow, '. When I update that row with first = '', the result is correct, but the value is no null, so it works. What am I missing?? Any help is appricated, Walt - name.c: #include string.h #include "postgres.h" #define COMMA ", " text *lastfirst (text *first, text *last, bool nocompany) { /* this function will take in the first name, and last name * and based on nocompany set the output to either return * 'last, first' or just the company name. */ int32 ret_size; text*return_text; if (nocompany) { if (first == NULL) { ret_size = VARSIZE(last) + sizeof(COMMA); return_text = (text *) palloc(ret_size); memset(return_text, 0, ret_size); VARSIZE(return_text) = ret_size; strncpy (VARDATA(return_text), VARDATA(last), VARSIZE(last)-VARHDRSZ); strncat (VARDATA(return_text), COMMA, sizeof(COMMA)); return (return_text); } else { ret_size = VARSIZE(first) + VARSIZE(last) + sizeof(COMMA) - VARHDRSZ; return_text = (text *) palloc(ret_size); memset(return_text, 0, ret_size); VARSIZE(return_text) = ret_size; strncpy (VARDATA(return_text), VARDATA(last), VARSIZE(last)-VARHDRSZ); strncat (VARDATA(return_text), COMMA, sizeof(COMMA)); strncat (VARDATA(return_text), VARDATA(first), VARSIZE(first)-VARHDRSZ); return (return_text); } } else { /* Just the company name is returned here */ ret_size = VARSIZE(last); return_text = (text *) palloc(ret_size); VARSIZE(return_text) = ret_size; strncpy(VARDATA(return_text), VARDATA(last), VARSIZE(last)-VARHDRSZ); return (return_text); } }
[GENERAL] Benchmarking PGSQL against Microsoft SQL 7.0?
Please forgive my newbieness but I am extremely new to both Postgresql AND Linux. I've been a consultant for 6 years working mostly on Microsoft platforms (NT, MSSQL). I have developed many data-driven websites using WinNT/IIS/ASP/MSSQL. Now, getting sick of MS and being enamored with the whole Open Source movement, I wish to learn (and develop a project or two) on Linux/Apache/PHP/PGSQL. I was wondering if anyone has done any benchmarking (even roughly), comparing PGSQL to Microsoft SQL Server 7.0 or even the older MSSQL 6.5. Specifically I just want the reassurance that the two products are in the same ballpark as far as performance goes. Has anyone done this recently? Thank you, Bryan
RE: [GENERAL] postgresql v6.4.2 c funcs and null text pointers...
Very observant of you. The postgres function system doesn't have a way to tell which parameter is null, so the function just returns null. I don't like it and we hope to get it changed for PGv6.5 (at least I do). Is it on the TODO guys? Jan, do you think you'll have the time to get to it by beta? *** Blatant flattery start *** I'm still willing and looking for that backend mentor to truly get me started, and I want you, Jan and Bruce, because I want the best. BTW don't give me license to bug you unless you mean it. *** Blatant flattery end *** -DEJ -Original Message- I wrote a c func (ATTACHED BELOW) which takes 2 pointers to type text, and a bool field. When a field in a row passed to the func is null, espically the 'first' field, Postgresql does not return the value that my code produced. For example: First lastco nocompany -- NULLWalt BigelowTrue the above data is contained in the database, and when passed to my c func like: SELECT lastfirst(first, lastco, nocompany) as name from tbladdress where agencyid = 691; I get: name (1 row) Not the expected output of 'Walt Bigelow, '. When I update that row with first = '', the result is correct, but the value is no null, so it works. What am I missing?? Any help is appricated, Walt - name.c: #include string.h #include "postgres.h" #define COMMA ", " text *lastfirst (text *first, text *last, bool nocompany) { /* this function will take in the first name, and last name * and based on nocompany set the output to either return * 'last, first' or just the company name. */ int32 ret_size; text *return_text; if (nocompany) { if (first == NULL) { ret_size = VARSIZE(last) + sizeof(COMMA); return_text = (text *) palloc(ret_size); memset(return_text, 0, ret_size); VARSIZE(return_text) = ret_size; strncpy (VARDATA(return_text), VARDATA(last), VARSIZE(last)-VARHDRSZ); strncat (VARDATA(return_text), COMMA, sizeof(COMMA)); return (return_text); } else { ret_size = VARSIZE(first) + VARSIZE(last) + sizeof(COMMA) - VARHDRSZ; return_text = (text *) palloc(ret_size); memset(return_text, 0, ret_size); VARSIZE(return_text) = ret_size; strncpy (VARDATA(return_text), VARDATA(last), VARSIZE(last)-VARHDRSZ); strncat (VARDATA(return_text), COMMA, sizeof(COMMA)); strncat (VARDATA(return_text), VARDATA(first), VARSIZE(first)-VARHDRSZ); return (return_text); } } else { /* Just the company name is returned here */ ret_size = VARSIZE(last); return_text = (text *) palloc(ret_size); VARSIZE(return_text) = ret_size; strncpy(VARDATA(return_text), VARDATA(last), VARSIZE(last)-VARHDRSZ); return (return_text); } }
RE: [GENERAL] Benchmarking PGSQL against Microsoft SQL 7.0?
There has been a discussion in the HACKERS list (check the archives on the website [http:\\www.postgresql.org\]) about PostgreSQL vs MS SQL 6.5 for the last 2 days or so. I think these ideas must come in threes, so where is that other person? I can't really give a feature comparison of MS SQL 7.0 as I've never used it. as for a benchmarking, although it is out of date, check http://www.tcx.se/benchmark.html. There is no direct comparison of PostgreSQL and MS SQL but it might give you some idea of something (hey I can't make heads or tails of it all, but remember a smaller bar is better). Oh well, hope this helps somebody somehow, -DEJ -Original Message- Please forgive my newbieness but I am extremely new to both Postgresql AND Linux. I've been a consultant for 6 years working mostly on Microsoft platforms (NT, MSSQL). I have developed many data-driven websites using WinNT/IIS/ASP/MSSQL. Now, getting sick of MS and being enamored with the whole Open Source movement, I wish to learn (and develop a project or two) on Linux/Apache/PHP/PGSQL. I was wondering if anyone has done any benchmarking (even roughly), comparing PGSQL to Microsoft SQL Server 7.0 or even the older MSSQL 6.5. Specifically I just want the reassurance that the two products are in the same ballpark as far as performance goes. Has anyone done this recently? Thank you, Bryan
Re: [GENERAL] Callable Statement in JDBC
On Fri, 8 Jan 1999, Sze Yuen Wong wrote: Hi, I'm using Postgre in my Java program. The Java bean (JCDatasource from KL group) require callable statement when saving to the DB. But Postgre report Callable statement is not supported. Anybody knows if 6.4 support callable statement? Nope. CallableStatement is still unsupported, mainly because I haven't been able to figure out how CallableStatement works. -- Peter T Mount [EMAIL PROTECTED] Main Homepage: http://www.retep.org.uk PostgreSQL JDBC Faq: http://www.retep.org.uk/postgres Java PDF Generator: http://www.retep.org.uk/pdf