[SQL] quote in function

2000-10-24 Thread Carolyn Lu Wong
I'd like to create a function which deals with string manipulation. How do you specify a string as 'abc' in a function?

Re: [SQL] Help: Using a regular expression match as a value

2000-10-24 Thread [EMAIL PROTECTED]
Richard, Please correct me if I am wrong. You want to do something like: select $1 from captives where firstname ~ '^(R[^ \t,]*d)$'; And get as result: lastname Richard Richard Richard Ricard Richard Rolland Richard In this case, the above query is same as: select firstname from captives whe

Re: [SQL] Re: NULL

2000-10-24 Thread Mark Volpe
\N is normally used to represent NULL in a text file, however you can change that to another string (or an empty string) using COPY FROM ... WITH NULL AS Mark Sandis Jerics wrote: > > Hello, > > how must i write a NULL value in a text file for the \copy command to > understand it? > NULL, \0 d

[SQL] Help on Union Query

2000-10-24 Thread Craig May
Hi, I have an Index table with the following structure: | Node_ID (int) | Word (varchar)| and attempting to perform a query that returns the distinct Node_ID for an occurence of [word] in addition to a count of that [word] within the Node_ID. Here is the query I have atm: select distinct on

[SQL] Permission and users

2000-10-24 Thread Ferruccio Zamuner
Hi, PostgreSQL superuser (named A) create two different users: B: able to create db C: able to create db B creates db B_DB C creates db C_DB C is able to add tables at C_DB as well as at B_DB. B is able to add tables at B_DB as well ad at C_DB. How can I limit C to operate only to C_DB and B o

Re: [SQL] Help on Union Query

2000-10-24 Thread Josh Berkus
Mr. May, The reason you're having trouble is that the problem you've described does not call for a union query at all. What you want is a simple GROUP BY query: SELECT Node_ID, Word, Count(*) FROM NodeIndex GROUP BY Node_ID, Word -Josh Berkus -- __AGLIO DATABASE SOLUTIONS___

[SQL] Alternate Database Locations

2000-10-24 Thread Brian C. Doyle
Hello, I am working on seting up alternate database locations for my users. I have done % initlocation /home/userid % createdb -D /home/userid userid and i always get ERROR: The database path '/home/httpd/jbbent' is invalid. This may be due to a character that is not allowed or because the c

[SQL] Error in Extrack Database

2000-10-24 Thread Tubagus Nizomi
i have file Dump > 500 MB when i execute " gunzip -c data.dump.gz | psql internal " some error message emerged as follows : FATAL 1: copy: line 2516273, Memory exhausted in AllocSetAlloc() what might be happen with the process ?? how to solve the problem ?? i use sparc sun solaris 2.6, postgre

[SQL] knowing which columns have beend UPDATEd inside a TRIGGER?

2000-10-24 Thread Louis-David Mitterrand
Hello, Is there a way to know which columns are being UPDATEd or INSERTEd from inside a trigger, either in C or pl/pgsql? Thanks in advance, -- Louis-David Mitterrand - [EMAIL PROTECTED] - http://www.apartia.org If at first you don't succeed, redefine success.

Re: [SQL] help on createing table

2000-10-24 Thread Josh Berkus
Sherwin, I've done this before for one project. Here's what you do: CREATE TABLE sample_heirarchy ( unique_id SERIAL CONSTRAINT PRIMARY KEY, node_linkup INT4, node_level INT2, label VARCHAR(30) datawhatever

Re: [SQL] Error in Extrack Database

2000-10-24 Thread Poul L. Christiansen
My guess is that you don't have enough RAM. Maybe it can work if you first unzip the file, then log into database internal and use the command "\i data.dump" to load the data. If that doesn't work, try splitting up the file and load the files separatly. Poul L. Christiansen Tubagus Nizomi wrot

Re: [SQL] knowing which columns have beend UPDATEd inside a TRIGGER?

2000-10-24 Thread Tom Lane
Louis-David Mitterrand <[EMAIL PROTECTED]> writes: > Is there a way to know which columns are being UPDATEd or INSERTEd from > inside a trigger, either in C or pl/pgsql? Huh? An INSERT always inserts all columns, by definition. Some of them might be null and/or equal to their default values, bu

Re: [SQL] Alternate Database Locations

2000-10-24 Thread Brian C. Doyle
Never mind... I got it working At 02:40 PM 10/24/00 -0400, Brian C. Doyle wrote: >Hello, > >I am working on seting up alternate database locations for my users. >I have done > >% initlocation /home/userid >% createdb -D /home/userid userid > >and i always get > >ERROR: The database path '/home/h

[SQL] Re: NULL

2000-10-24 Thread Sandis Jerics
Hello, how must i write a NULL value in a text file for the \copy command to understand it? NULL, \0 doesnt work.. how must i write a boolean value in a text file for the \copy command to understand it? t doesnt work, however in a file written by /copy command it looks as t or f .. tried to sea