Re: [GENERAL] pl/pgsql frustration

2005-08-13 Thread Michael Fuhr
On Sat, Aug 13, 2005 at 11:19:25PM -0400, John Wells wrote: > I'm trying to write a simple function that will return a table's actual > row count on PostgreSQL 7.4. I've tried two different versions (see > below), both with the same result: > > "ERROR: syntax error at or near "select" at charact

Re: [GENERAL] pl/pgsql frustration

2005-08-13 Thread John Wells
Guys, Sorry...never mind. I had accidentally pulled up 8.0 documentation and confused the syntax (single quotes being ok with you're using the $$ quoting, which I'm not). Thanks, John ---(end of broadcast)--- TIP 4: Have you searched our list arc

[GENERAL] pl/pgsql frustration

2005-08-13 Thread John Wells
Guys, I'm trying to write a simple function that will return a table's actual row count on PostgreSQL 7.4. I've tried two different versions (see below), both with the same result: "ERROR: syntax error at or near "select" at character 127" I've also tried a cursor example found in the interact

Re: [GENERAL] Removing tsearch2 from a database

2005-08-13 Thread Andrew J. Kopciuch
On Saturday 13 August 2005 16:10, CSN wrote: > Greetings- > > How can I remove tsearch2 (all its tables, types, > functions, etc.) from a database? > Wherever the contrib files are installed (where tsearch2.sql is), there should also be an untsearch2.sql file. Just run that on the database. And

[GENERAL] Removing tsearch2 from a database

2005-08-13 Thread CSN
Greetings- How can I remove tsearch2 (all its tables, types, functions, etc.) from a database? Thanks, CSN Start your day with Yahoo! - make it your home page http://www.yahoo.com/r/hs ---(end of

Re: [GENERAL] Access NEW and OLD from function called by a rule

2005-08-13 Thread Frodo Larik
Frodo Larik wrote: That means I have to create functions like insert_person(workers) , insert_person(othertable) and function insert_person(anothertable). I found the solution to this "problem". Create a function with a Polymorphic Type (notice the anyelement): CREATE OR REPLACE FUNCTION i

Re: [GENERAL] query optimization

2005-08-13 Thread marcelo Cortez
hi guys , Richad you are right!, my apologies profile data: postgres: "PostgreSQL 7.4.3 on i386-pc-linux-gnu, compiled by GCC 2.95.4" HP proliant processor: Dual Xeon 3.40 Ghz. HD:250 Gigabytes hard disk storage. responses: > Comment 4 - you apply a LIMIT without an ORDER BY. > Are

Re: [GENERAL] Sorting by related tables

2005-08-13 Thread Andreas Seltenreich
Bill Moseley schrob: > create table region { > id SERIAL PRIMARY KEY, > nametext, > -- order this table should be sorted in > -- a "1" is the top sort level > sort_order integer > ); > > create table city { > id SERIAL PRIMARY KEY, > nametext,

[GENERAL] Sorting by related tables

2005-08-13 Thread Bill Moseley
I have a few beginner questions about using related tables for sorting. create table region { id SERIAL PRIMARY KEY, nametext, -- order this table should be sorted in -- a "1" is the top sort level sort_order integer ); create table city { id SERIAL

Re: [GENERAL] Where can I download HTML manual?

2005-08-13 Thread William ZHANG
> My question: where in the FTP area is the HTML manual for version 8.0? ftp://ftp.postgresql.org/pub/v8.0.3/ ---(end of broadcast)--- TIP 4: Have you searched our list archives? http://archives.postgresql.org

Re: [GENERAL] Seeking PL/PGSQL example

2005-08-13 Thread John DeSoi
On Aug 12, 2005, at 5:26 PM, John Wells wrote: I'm getting started with PL/PGSQL but want to understand if the following is even possible: With PL/PGSQL, how would I roll through all tables in my database and print the table name, along with the row count of that table? Sorry if this is too