[SQL] HELP: can i have a trigger before postgres tries to check data types?

2000-12-12 Thread Bruno Boettcher
hello, now that i finally managed to write some functions and triggers in perl, i get the following error: insert into journal (plus,minus,description,currency,amount) VALUES (101,420,'a test','EUR','1.000.000'); ERROR: pg_atoi: error in "1.000.000": can't parse ".000.000" normal since the

Re: [SQL] Help with Procedures in pgsql

2000-11-30 Thread Robert B. Easter
On Monday 27 November 2000 15:01, Nelio Alves Pereira Filho wrote: I have the folowing procedure in PL/pgsql: CREATE FUNCTION set_counter () RETURNS INT AS ' DECLARE nivel_rec record; new_count integer; I always used the syntax like: nivel_rec nivel%ROWTYPE; Not sure

Re: [SQL] Help with displaying data types.

2000-11-23 Thread Tom Lane
"Rob Burne" [EMAIL PROTECTED] writes: I am trying to perform a query that will: 1. Return all user defined attributes from a relation. 2. Also return the datatypes of each relation. So far I can only achieve part 1 with the following: select attname from pg_class,pg_attribute where

Re: [SQL] Help! Storing trees in Postgres

2000-11-08 Thread kovacsz
Is there any way to implement a query in Postgres that would be in some way analogues to Oracle's START WITH/CONNECT BY structure? Unfortunately, no such statements. Instead, you should write your own functions which can operate on your own defined table. The table represents the edges of the

[SQL] Help with GROUP BY

2000-11-08 Thread Jean-Christophe Boggio
Hi, I have a (quite) big table with ~3M rows. Every row has a NBPOINTS (int4) and a REASON (int4) select sum(nbpoints) from points; it takes about 10s select sum(nbpoints) from points group by reason it takes about 210s Same table structure, same data on Oracle gives respectively 8 and

[SQL] Help! Storing trees in Postgres

2000-11-02 Thread Sergei O . Naumov
Hi! I just subscribed myself to this list and sent a message but I am not sure that it reached the list. So, I am asking one more time. :-) Is there any way to implement a query in Postgres that would be in some way analogues to Oracle's START WITH/CONNECT BY structure? I'd very much

Re: [SQL] HELP! ... pg_locale ???

2000-10-27 Thread Tom Lane
Sandis Jerics [EMAIL PROTECTED] writes: As result, now all queries, written inside the php code on multiply lines, returns the following: ERROR: parser: parse error at or near " " At a guess, you're having trouble with newline representations (Unix convention is \n only, DOS/Windows

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] 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

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

[SQL] help on creating table

2000-10-23 Thread pgsql-sql
Hi All, I'm planning to have data in a tree structure when fetched. e.g. NODE1 + --- NODE1_1 + --- NODE1_2 |+ --- NODE1_2_1 + --- NODE1_3 Is this possible? How? I would really appreciate any help. Sherwin

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

2000-10-23 Thread Richard DeVenezia
I am just getting started with pgsql and have read available docs I can find. I know I can match a row in a where clause using a regular expression. How can I use what was regexp matched (e.g. perl $1,$2, etc...) as a column assignment ? I'm looking for something like this? select ... ... $1

[SQL] HELP pg_proc is corrupted!

2000-09-05 Thread Timothy Covell
OK, I before any starts on my about backups...I have one a week old, but I want to fix this the right way! (and I want this past week's worth of data. What happened: o downloaded ip and macaddr type programs written by Paul Vixie et al., scrapped the ip stuff, and compiled the macaddr stuff.

Re: [SQL] Help on some SQL command...

2000-08-17 Thread Guo Bin
Hi, You can specify a default value for the create_date column like: create_date timestamp default 'now' In the insert statement just ommit that field and you will get the default, as insert into test1 (id, name) values (1, 'xxx'); Regards, -- Guo Bin --- Ang Sei Heng [EMAIL

Re: [SQL] Help on some SQL command...

2000-08-17 Thread Jesus Aneiros
Use default now() -- Jesus Aneiros Sosa mailto:[EMAIL PROTECTED] http://jagua.cfg.sld.cu/~aneiros On Wed, 16 Aug 2000, Ang Sei Heng wrote: Hello to all the SQL gurus... I have this little table: test1 ( id char(8) primary key, name char(20), create_date

[SQL] Help on some SQL command...

2000-08-16 Thread Ang Sei Heng
Hello to all the SQL gurus... I have this little table: test1 ( id char(8) primary key, name char(20), create_date timestamp ); Now, the create_date need to be updated to date and time whenever id is being inserted or updated. Is there a way in SQL that I can do this

[SQL] Help with inserts into Views

2000-06-08 Thread Brian Powell
Greetings, I am having difficulty creating a way to insert into a view which joins multiple tables (specifically a view which joins multiple records from a single table to a record in another table). Please see the enclosed simple example for how I am currently inserting (updating, etc.) on

<    1   2   3   4   5