Re: [GENERAL] plpgsql/cursor

2001-09-14 Thread cnliou
> can i declare and fetch from a cursor inside a plpgsql function? (pg version 7.0.3) In 7.1, the pl/pgsql document says you can code like this: DECLARE rec record; BEGIN for rec in SELECT * from MyTable LOOP update tableX set tableX=rec.fieldA; END LOOP; END; CN --

Re: [GENERAL] Sequence query

2001-09-14 Thread Stephan Szabo
On Fri, 14 Sep 2001, Tamara D. Blum wrote: > Hi ! > > I need to ask for the following secuence number for a field. I am > connecting PostgreSQL with an ODBC Driver and with ADO. If i ask for > the value of the field after updating the recordset, i get it is null > (and it can't be), so i read

Re: [GENERAL] cache lookup failed

2001-09-14 Thread cnliou
Suppose you create a function function1 and a trigger that calls function1. Then you drop function1 and re-create function1. Now you will find that the trigger can't see function1's existence. trigger (and other object too) refeerences functions using OID, not the function name. I also feel it b

Re: [GENERAL] How to make a REALLY FAST db server?

2001-09-14 Thread Gunnar Rønning
* Ian Linwood <[EMAIL PROTECTED]> wrote: | | I'd recommend Solaris, which has MUCH more mature MP support! | Linux still has a way to go (although it's getting there very | quickly). Maybe the Solaris MP support is more mature, I haven't tested. But I did some performance tests with PostgreSQL

Re: [GENERAL] need help

2001-09-14 Thread Andre Schnabel
Hi Meena, you'll find the answers to your question in the postgres doc's. I'd suggest reading at least the Tutorial (http://www.postgresql.org/idocs/index.php?tutorial.html). Some basic concepts (postmaster, clients, architecture of postgres) are explained there. Answers to your questions about t

Re: [GENERAL] need help

2001-09-14 Thread cnliou
> Once we start a Postmaster process, will it keep running forever? It will if you run it in background like postmaste -i -D /home/mydir/pgsql-database-dir & > How can we restart/stop??(the commands???) The preferred command might be pg_ctl that comes along with postgresql distribution: pg_c

Re: [GENERAL] Working with dates and queries

2001-09-14 Thread Peter Eisentraut
http://www.de.postgresql.org/users-lounge/docs/7.1/postgres/ Krog, Kenneth writes: > > I am attempting to do a query for a specific month based of a response for a > web site using php as the engine. > The syntax of the sql is simple > > "SELECT * FROM table WHERE MONTH(fieldname)=08;" > > note:

Re: [GENERAL] count of occurences

2001-09-14 Thread Eric Ridge
> I tried > > select distinct job_num, (select count(*) from search_records j where > j.job_num=k.job_num) from search_records k can't you just do: select job_num, count(job_num) from search_records group by job_num order by job_num http://www.postgresql.org/idocs/index.php?queries.html#QUERIE

[GENERAL] Diabling constraints

2001-09-14 Thread Linh Luong
Hi, I am wondering is there any way of disabling constraints that was created after the table itself was created. I know I can drop the trigger that the constraint creates. However, I need to make this change in several postgres database and it seems like the the tgname that is required to remo

Re: [GENERAL] get certain # of recs

2001-09-14 Thread Philip Hallstrom
Take a look at the LIMIT part of the SELECT statement. in your case you'd do: select * from tablename limit 21; ALthough you'll want to use an ORDER BY otherwise you could get different results each time.. -philip On Thu, 13 Sep 2001, Mike S. Nowostawsky wrote: > How can one select only a c

Re: [GENERAL] error while generating and EXECUTEing a query dynamically

2001-09-14 Thread Jeff Eckermann
Your function worked fine for me (I copied and pasted). What PostgeSQL version are you running? EXECUTE is a new feature for version 7.1. - Original Message - From: "Gaurav Priyolkar" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, September 12, 2001 1:15 PM Subject: [GENERA

Re: [GENERAL] Numerical DB/Table Names

2001-09-14 Thread Joe Conway
> upgrading to 7.1.3 but have run into a problem. All of the databases > are stored with numerical names in the /$prefix/base directory. They > seem to be stored as binaries so I am unable to open any files under > that directory. I know that in our 7.0 version of PostgreSQL all > databases hav

Re: [GENERAL] pg_dump error - LOCALIZATION PROBLEM

2001-09-14 Thread Peter Eisentraut
Erol Öz writes: > I think Tom Lane is right as always. My postgresql server was > configured with --enable-locale option and it works perfect with > Turkish stuff. However I could not find a solution to the problem > below. Untested, but try this: Edit src/backend/commands/variable.c, look for

Re: [GENERAL] Numerical DB/Table Names

2001-09-14 Thread Peter Eisentraut
Jeff Brickley writes: > I've just recently started working with PostgreSQL. We have a 7.0 > insallation and everything seems to work fine. I am embarking on > upgrading to 7.1.3 but have run into a problem. All of the databases > are stored with numerical names in the /$prefix/base directory.

Re: [GENERAL] joinning tables

2001-09-14 Thread Jeff Eckermann
Outer joins are supported in PostgreSQL, but not before version 7.1. If you are using version 7.1, please post your failing query, and someone will be able to help you. "Emmanuel SARACCO" <[EMAIL PROTECTED]> wrote in message 9nnjc3$68p$[EMAIL PROTECTED]">news:9nnjc3$68p$[EMAIL PROTECTED]... > hi,

Re: [GENERAL] How to implement transaction in plpgsql?

2001-09-14 Thread cnliou
If I remember correctly, the document in "function" section sas that people can not use transaction statements (begin, commit, rollback) IN any function. Instead, we should use these transaction statements OUTSIDE function. Good luck. CN

[GENERAL] problems using COPY

2001-09-14 Thread roypgsqlgen
Hey guys, I'm trying to copy in data from a file generated by SQL Server's bcp and for most of my tables I'm not having any problems. But every once in a while, it doesn't like the datetime values from SQL Server, such as this: 2001-02-16 23:32:51.420 Is there anything wrong with this? Oh, d

Re: [GENERAL] Numerical DB/Table Names

2001-09-14 Thread Stephan Szabo
On Fri, 14 Sep 2001, Jeff Brickley wrote: > I've just recently started working with PostgreSQL. We have a 7.0 > insallation and everything seems to work fine. I am embarking on > upgrading to 7.1.3 but have run into a problem. All of the databases > are stored with numerical names in the /$pre

Re: [GENERAL] How to implement transaction in plpgsql?

2001-09-14 Thread Oliver Elphick
"Corn" wrote: >Dear all, > >How to implement transaction in plpgsql? >I have try to use it but fail. And I don't know the reason. Check the documentation again. It is not supported. (There are no nested transactions in PostgreSQL.) -- Oliver Elphick[EMA

Re: [GENERAL] Case sensitivity issue

2001-09-14 Thread Matthew Rice
Szabo Zoltan <[EMAIL PROTECTED]> writes: > Use: ILIKE > > > If I am doing a command such as > > select * from Apples where color like '%red%'; > > how do I make it case insensitive? I was trying to solve a similar problem where I wanted an exact match to work in PostgreSQL and MySQL and ended up

Re: [GENERAL] joinning tables

2001-09-14 Thread Stephan Szabo
On Wed, 12 Sep 2001, Emmanuel SARACCO wrote: > hi, > > it seems like postgresql does not interpret a LEFT JOIN instruction like > other sql engines. for exemple, if it have some null values on keys, data > tables are not joinned... same has if it was a INNER JOIN instruction. Can you give an ex

Re: [GENERAL] Case sensitivity issue

2001-09-14 Thread Patrik Kudo
select * from Apples where lower(color) like '%red%'; ech`echo xiun|tr nu oc|sed 'sx\([sx]\)\([xoi]\)xo un\2\1 is xg'`ol Känns det oklart? Fråga på! On 9 Sep 2001, Michael Gay wrote: > If I am doing a command such as > > select * from Apples where color like '%red%'; > > how do I make it case i

Re: [GENERAL] Case sensitivity issue

2001-09-14 Thread Jeff Eckermann
use "ILIKE" instead of "LIKE" or use a regular expression match: ~* 'red' - Original Message - From: "Michael Gay" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Sunday, September 09, 2001 11:02 PM Subject: [GENERAL] Case sensitivity issue > If I am doing a command such as > > sele

Re: [GENERAL] count of occurences

2001-09-14 Thread Andrew Gould
You're just missing 'group by', and a little simplicity. Try this: select job_num, count(job_num) as frequency from search_records group by job_num order by frequency desc limit 10; Have fun, Andrew Gould --- Adam <[EMAIL PROTECTED]> wrote: > I help run a job database and have a table of se

Re: [GENERAL] Case sensitivity issue

2001-09-14 Thread Mitch Vincent
SELECT * FROM apples WHERE lower(color) LIKE '%red%'; Make sure that what ever 'red' might be is always lower case (you can pass it through lower() too, of course).. -Mitch - Original Message - From: "Michael Gay" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, September 10,

Re: [GENERAL] How to implement transaction in plpgsql?

2001-09-14 Thread Doug McNaught
"Corn" <[EMAIL PROTECTED]> writes: > Dear all, > > How to implement transaction in plpgsql? > I have try to use it but fail. And I don't know the reason. > Here is my function... You can't use transactions inside a function. The reason is that when a function executes you are already inside a

[GENERAL] Sequence query

2001-09-14 Thread Tamara D. Blum
Hi !   I need to ask for the following secuence number for a field. I am connecting PostgreSQL with an ODBC Driver and with ADO. If i ask for the value of the field after updating the recordset, i get it is null (and it can't be), so i read how to ask for information about sequen

Ynt: [GENERAL] pg_dump error - LOCALIZATION PROBLEM

2001-09-14 Thread Erol Öz
Hi, It worked. Thanks a lot. Regards Erol -Özgün Ýleti- Kimden: Peter Eisentraut <[EMAIL PROTECTED]> Kime: Erol Öz <[EMAIL PROTECTED]> Bilgi: PostgreSQL General List <[EMAIL PROTECTED]> Tarih: 14 Eylül 2001 Cuma 18:03 Konu: Re: [GENERAL] pg_dump error - LOCALIZATION PROBLEM Erol Öz writ

Re: [GENERAL] get certain # of recs

2001-09-14 Thread Stephan Szabo
On Thu, 13 Sep 2001, Mike S. Nowostawsky wrote: > How can one select only a certain number of records in Postgres? > > In other SQL langs we can use, say, for the first 20 recs: > > select * from tablename where rownum < 21; > > WHAT should 'rownum' be to make this select work... OR is there

[GENERAL] chunk size problem

2001-09-14 Thread Martín Marqués
I started getting these error messages webunl=> \dt NOTICE: AllocSetFree: detected write past chunk end in TransactionCommandContext 3a4608 pqReadData() -- backend closed the channel unexpectedly. This probably means the backend terminated abnormally before or while processi

Re: [GENERAL] Postgresql data backup

2001-09-14 Thread Stephan Szabo
On Thu, 13 Sep 2001, [iso-8859-1] Rajkumar Selvaraj wrote: > Please mail me ur replies on the following : > 1).I would like to know how to stop users who have > already opened up sessions with my database without > stopping the postmaster > service. Well, the problem is that if you stop them, an

Re: [GENERAL] get certain # of recs

2001-09-14 Thread Andrew Gould
You might also want to look at the SQL command CLUSTER, which physically reorders the table rows based upon an existing index. Andrew Gould --- Ian Barwick <[EMAIL PROTECTED]> wrote: > Mike S. Nowostawsky wrote: > > > How can one select only a certain number of > records in Postgres? > > > > I

Re: [GENERAL] Where do they find the time??? Great Bridge closed now!!!??

2001-09-14 Thread Matthew Rice
peace_flower <"alavoor[AT]"@yahoo.com> writes: > I hope the MySQL team will drop the development and Jump into PostgreSQL > development. Pgsql going to be the only sql server to > run the WORLD ECONOMY smoothly.. There is no time support and develop > two duplicate products!! PostgreSQL is very a

Re: [GENERAL] returning value from inside a transaction

2001-09-14 Thread Stephan Szabo
On Wed, 12 Sep 2001, Matt wrote: > create table tez (i int); > insert into tez values(3); > > create function tezt0(int) returns int as ' > begin work; > lock table tez; > select * from tez as r; > commit work; > > select tez.i; > ' language 'sql'; It looks to me from testing r

[GENERAL] pgdumpall

2001-09-14 Thread Lalo Castro
Hello, I suddenly am required to move databases from one server to another. I have read some things on pg_dumpall and feel fairly confident that I can move it over with a minimum of sweat. However, given the importance of the databases to our organization and my own inexperience with pg

Re: [GENERAL] get certain # of recs

2001-09-14 Thread Patrik Kudo
On Thu, 13 Sep 2001, Mike S. Nowostawsky wrote: > How can one select only a certain number of records in Postgres? > > In other SQL langs we can use, say, for the first 20 recs: > > select * from tablename where rownum < 21; You could use select * from tablename limit 20 If you need to sort i

Re: [GENERAL] maintaining sequences

2001-09-14 Thread roypgsqlgen
Oh, great! So I'm going to do this: select setval('sequencename', ( select max(someid) from sometable ) ); Thanx! Roy. > -Original Message- > From: Jeff Eckermann [mailto:[EMAIL PROTECTED]] > Sent: Thursday, September 13, 2001 5:45 PM > To: [EMAIL PROTECTED] > Cc: [EMAIL PROTECTED] >

[GENERAL] Problem with database: FATAL 1: cannot find attribute 24 of relation

2001-09-14 Thread Tauren Mills
Sorry for cross-posting this to both admin and general. I first posted to admin, but as I'm desperate here and there is more activity in the general list, I'm now posting it here as well. --- Help! One of my customers is having a problem with their database causing all of their sites to be dow

Re: [GENERAL] How to make a REALLY FAST db server?

2001-09-14 Thread Steve Wolfe
> > (As an aside, one person was in a heated argument about how much cheaper > > IDE was than SCSI. I got on pricewatch, found some prices, and would have > > been able to put together a very fast SCSI system for the same price as > > his IDE array.) > > That's nuts: SCSI disks cost a lot more

[GENERAL] Make switches from gcc to cc Java is failing

2001-09-14 Thread Joe
I am running Solairs 2.7 and I am trying to compile postgresql-7.1.2. When I first try to compile I only have the gcc compiler in the path. The make gives me the following errors. make[3]: cc: Command not found make[3]: *** [pltcl.o] Error 127 make[3]: Leaving directory `/ufs/gnu/postgresql-7.1.

[GENERAL] Case sensitivity issue

2001-09-14 Thread Michael Gay
If I am doing a command such as select * from Apples where color like '%red%'; how do I make it case insensitive? Thanks. mike ---(end of broadcast)--- TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]

[GENERAL] joinning tables

2001-09-14 Thread Emmanuel SARACCO
hi, it seems like postgresql does not interpret a LEFT JOIN instruction like other sql engines. for exemple, if it have some null values on keys, data tables are not joinned... same has if it was a INNER JOIN instruction. any idea? thanks => send me your answer on [EMAIL PROTECTED] -

Re: [GENERAL] Questions about tuning on FreeBSD...

2001-09-14 Thread Christian MEUNIER
What about WAL buffer parameter ? i thought if this buffer is too small, un necessary I/O will occur and slow down performance <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > On Monday 10 September 2001 18:52, Philip Hallstrom wrote: > > Hi all - > > I have so

[GENERAL] postgres + odbc + delphi + largeobjects

2001-09-14 Thread Marek Wróbel
hi, I don't know how insert binary file to table, and how get it from tabel. Do you now how do it or where I found any info about it ? In PHP a have function pg_loopen, pg_loread, pg_lowrite... NETim [EMAIL PROTECTED] ---(end of broadcast)--- TI

[GENERAL] Transactions <-> Connections and Userrights

2001-09-14 Thread Ravi Ahluwalia
hi over there, how am i able to let a transaction exist among several connections, or is just one possible ? cause my phpskript cuts connection from db bevor reloading itself ofcourse :-) -how can i get information about the group which a user belongs to and its rights ? Thanx a lot Ravi -

Re: [GENERAL] Does pgsql supports full text search?

2001-09-14 Thread Lee Harr
On Fri, 7 Sep 2001 14:22:22 +0800, Corn <[EMAIL PROTECTED]> wrote: > Does pgsql supports full text keyword index? > The one like M$SQL / Oracle text index. > I do not use this, but I think you will find some interesting things in the contrib directory of the postgres sources. -

[GENERAL] is it support table partitioning?

2001-09-14 Thread Corn
Is pgsql support table partitioning? e.g. There is a customers table that keeps customers record but for two company: A & B. can I store A's customers & B's customers record into two different directory? That is the mean I know for table partitioning. Is that right? thx, Corn

Re: [GENERAL] query help

2001-09-14 Thread Ian Barwick
Jeff Patterson wrote: > This seems like such a basic function that I'm sure I am missing something > fundamental. I have a table, say xref, whose columns are primary key > values for other tables. Some of theses keys may be NULL for a given row > in xref. I want to create a query that returns the

Re: [GENERAL] How to make a REALLY FAST db server?

2001-09-14 Thread Marshall Spight
""Steve Wolfe"" <[EMAIL PROTECTED]> wrote in message 002801c13a3f$15f34660$[EMAIL PROTECTED]">news:002801c13a3f$15f34660$[EMAIL PROTECTED]... > (As an aside, one person was in a heated argument about how much cheaper > IDE was than SCSI. I got on pricewatch, found some prices, and would have >

[GENERAL] returning value from inside a transaction

2001-09-14 Thread Matt
create table tez (i int); insert into tez values(3); create function tezt0(int) returns int as ' begin work; lock table tez; select * from tez as r; commit work; select tez.i; ' language 'sql'; select tezt0(1); tezt0 --- 3 (1 row) create function tezt1(int) returns ti

Re: [GENERAL] Help: Postgres, Java and Extended Characters? Solved

2001-09-14 Thread rjb26
On Sat, 08 Sep 2001 13:34:44 +0200, [EMAIL PROTECTED] wrote: >Help, > >I have moved an application from one Linux box to another, running >Java > >Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.1-b24) >Java HotSpot(TM) Client VM (build 1.3.1-b24, mixed mode) >Redhat7.1 >Apache JServ

Re: [GENERAL] Printable report generation

2001-09-14 Thread Robert Sell
Heck as far as that goes you can use access thru odbc and pull up your tables and use accesses report generation. Rob "SMJ" <[EMAIL PROTECTED]> wrote in message Pine.LNX.4.10.10108141753440.260-10@stark">news:Pine.LNX.4.10.10108141753440.260-10@stark... > Hi all, > > I'm currently in the p

[GENERAL] Any function to let me know how many rows that I updated after UPDATE SQL statment?

2001-09-14 Thread Corn
Any function to let me know how many rows that I updated after UPDATE SQL statment? Just like @@rowcount (MS SQL). I always compare with MS SQL becuase I used MS SQL most. ---(end of broadcast)--- TIP 1: subscribe and unsubscribe commands go to [

[GENERAL] Can I insert two different variables from form into different tables using one SQL query ?

2001-09-14 Thread Sapenov
Can I insert two different variables from form into different tables using one SQL query ? -- Regards, Sapenov Khazretgali System Engineer CMS 20 Eglinton Ave West Toronto, ON M4R 1K8 [EMAIL PROTECTED] tel. 416 487-0290 fax. 416 487-5771 toll free :1-888-244-1340 ---

Re: [GENERAL] is it support table partitioning?

2001-09-14 Thread Corn
I saw it on to-do list. But will not release on next version 7.2... : ( (_ _) : Corn ---(end of broadcast)--- TIP 5: Have you checked our extensive FAQ? http://www.postgresql.org/users-lounge/docs/faq.html

Re: [GENERAL] Two diffrent data path

2001-09-14 Thread Ian Linwood
On Wed, 5 Sep 2001 09:38:59 +0200, "Jean Sébastien Andujar" <[EMAIL PROTECTED]> wrote: >Dear All, > >Is there anybody, knows how to parameter Postgres with to diffrent path for >the db storage? [pg_ctrl | postmaster] -D ---(end of broadcast)---

[GENERAL] count of occurences

2001-09-14 Thread Adam
I help run a job database and have a table of search records. I want a query that will return the top 10 jobs by search frequency. I'm familiar with ORDER BY and LIMIT, so I basically need this: Given a table search_records: job_num --- 1 2 2 3 4 4 4 I want a query that will return: job_nu

Re: [GENERAL] [ANNOUNCE] Great Bridge ceases operations

2001-09-14 Thread Brook Milligan
Great Bridge .org, http://greatbridge.org/, will remain in place until projects are migrated to a new site. Are there any plans to migrate things like the information on their benchmarks against other databases? Those are valuable pieces of information in the broader PostgreSQL context and

[GENERAL] How to implement transaction in plpgsql?

2001-09-14 Thread Corn
Dear all, How to implement transaction in plpgsql? I have try to use it but fail. And I don't know the reason. Here is my function... CREATE FUNCTION sp_templatetouser(INTEGER, INTEGER) RETURNS INTEGER AS ' DECLARE puserid ALIAS FOR $1; pplateid ALIAS FOR $2; rec_affected INTEGER; BEGIN

[GENERAL] Error: No Buffer Space Available

2001-09-14 Thread Cole Shelton
I'm running postgres under WINNT Server 4.0 with CYGWIN. The postmaster starts no problem, but I get the following error when trying to start psql or issue a command: postmaster: StreamConnection: setsockopt(TCP_NODELAY): No buffer space available; the socket cannot be connected psql: pgReadData

[GENERAL] postmaster dies - what is output-meta?

2001-09-14 Thread Kurt Miller
When I try to start the backend it fails. Here is the server log entry: postmaster successfully started /usr/bin/postmaster: invalid argument -- output-meta Try '/usr/bin/postmaster --help' for more information. Please help! -km ---(end of broadcast)-

Re: [GENERAL] How to make a REALLY FAST db server?

2001-09-14 Thread Marshall Spight
"Shaun Thomas" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED]... > On Mon, 10 Sep 2001, Steve Wolfe wrote: > > > So, why did I say that I don't use IDE for high-performance machines? > > IDE has limitations. > > Mainly, the fact that IDE controllers require far more CPU involvement

[GENERAL] enumeration datatype in postgresql?

2001-09-14 Thread Marc Lambrichs
Is there an enumeration datatype in postgresql like the enum in mysql? Cheers, Marc ---(end of broadcast)--- TIP 5: Have you checked our extensive FAQ? http://www.postgresql.org/users-lounge/docs/faq.html

Re: [GENERAL] problem with selects based on dates

2001-09-14 Thread Szabo Zoltan
Hi, "J.H.M. Dassen (Ray)" wrote: > Mike Withers <[EMAIL PROTECTED]> wrote: > > db2001=# SELECT * FROM emp WHERE hiredate > 1981-01-01; > ^^ > > > It is not clear to me why in the last query the 1980-12-17 hiredate record > > is selected as we

[GENERAL] Where do they find the time??? Great Bridge closed now!!!??

2001-09-14 Thread peace_flower
Great Bridge ceased operation and not going to support postgreSQL (because of lack of investor) In these days of economic downturn, recession and world-wide economic depression...(and even the looming war) I am wondering how the MySQL team is finding time to support and develop duplicate SQL ser

Re: [GENERAL] get certain # of recs

2001-09-14 Thread Ian Barwick
Mike S. Nowostawsky wrote: > How can one select only a certain number of records in Postgres? > > In other SQL langs we can use, say, for the first 20 recs: > > select * from tablename where rownum < 21; > > WHAT should 'rownum' be to make this select work... OR is there a diff > syntax? use

Re: [GENERAL] count of occurences PLUS optimisation

2001-09-14 Thread Thurstan R. McDougle
Sorry about the size of this message!, it covers several optimisation areas. Yes we are talking about a limited situation of ORDER BY (that does not match the GROUP BY order) plus LIMIT, but one that is easy to identify. It also has the advantage that the number to be LIMITed will 9 times out of