[SQL] Re: [NOVICE] protected ON DELETE CASCADE

2001-08-30 Thread Albert Reiner
On Thu, 23 Aug 2001, Murray Hobbs wrote: > A <- B > A <- C <- D > > i want to maintain integrity so that if A is deleted from then so is > anything referencing from B and C - no problem ON DELETE CASCADE > > but if there are any D's that point back to A (through composite key in > C) i don't wa

Re: [SQL] How to execute a system file in procedure?

2001-08-22 Thread Albert REINER
On Mon, Aug 20, 2001 at 10:08:36AM -0400, Raymond Chui wrote: > I would like execute a system command or my program or my shell > script in procedure. How do I do that? use . Albert. ---(end of broadcast)---

Re: [SQL] create table

2001-05-06 Thread Albert REINER
On Sun, Apr 29, 2001 at 09:34:29PM +0200, LeoDeBeo wrote: > can anybody explain me the syntax of Create Table documentation?? ... > i also don't understand what the [ ... ] and [, ... ] means. I do know that > brackets denote options and | alternatives. I guess: ``[ ... ]'' means that you may

[SQL] '13 months ago'::reltime

2001-05-03 Thread Albert REINER
Saluton, I do not quite understand the following: , | albert=> select '13 months ago'::reltime; | ?column? | - | 1 year 25 00:00 ago | (1 row) | | albert=> select '13 months ago'::interval; | ?column? | | 1 year 1 mon 00:00 ago |

[SQL] RULE ... TO table.column

2001-04-16 Thread Albert REINER
Saluton, I am using , | SELECT version(); | version | | PostgreSQL 7.0.2 on i586-pc-linux-gnulibc1, compiled by gcc 2.95.1 | (1 row) ` , and upgrading to 7.1 is not possible (it was hard

Re: [SQL] RE: Re: select substr???

2001-04-12 Thread Albert REINER
from i for 1); > if c ~ ''[a-zA-Z0-9]'' > then > r = r || c; > end if; > end loop; > return r; > end; > ' language 'plpgsql' with (IsCachable); > > >

Re: [SQL] Re: select substr???

2001-04-10 Thread Albert REINER
On Mon, Apr 09, 2001 at 06:05:55PM +0100, Tim Johnson wrote: > Hi, > > I have postgres 6.x (where x is something). > > I have the following list of data > > data > > ABC* > ABC > ABC- ... > what I want to do is 'select distinct(data) [ignoring non alphanumeric > characters] order by da

[SQL] Historical dates in Timestamp

2001-04-04 Thread Albert REINER
Saluton, I have a database with dates, some of which are historical dates. When I wanted to enter May 28th, 812 I got an error message, had to use 0812 for the year instead: albert=> CREATE DATABASE test; CREATE DATABASE albert=> \c test You are now connected to database test. test=> CREATE TABL

Re: [SQL] fetching the id of a new row

2001-02-10 Thread Albert REINER
ich must be set to nextval()) will be used; to obtain the id, if indeed you need it, you can than select currval(), which is guaranteed to work on a per-backend basis. Albert. -- ---------- Albert Reiner

Re: [SQL] Re: SQL Join - MySQL/PostgreSQL difference?

2001-02-08 Thread Albert REINER
re is a command dos2unix, which is actually an alias for `recode ibmpc:`. But that will take care of more than just CR, e.g. umlauts, diacritics, etc.. Albert. -- ------ Albert Reiner &l

Re: [SQL] How to modify type in table?

2001-02-05 Thread Albert REINER
one. Albert. -- ------ Albert Reiner <[EMAIL PROTECTED]> Deutsch * English * Esperanto * Latine --

Re: [SQL] Suggestion for psql: --file -

2001-02-03 Thread Albert REINER
On Fri, Feb 02, 2001 at 04:16:05PM +0100, Peter Eisentraut wrote: > Albert REINER writes: ... > > P.S: BTW, the man page (7.0.2) of psql is not very clear: it took me > > some experimentation to find out that you have to do "\set VARIABLE" > > interactively or

Re: [SQL] how to create this trigger?

2001-02-01 Thread Albert REINER
t;WHERE id = code; > RETURN NEW; > END;' LANGUAGE 'plpgsql'; > > CREATE TRIGGER insert_on_table2 BEFORE INSERT ON table2 > FOR EACH ROW EXECUTE PROCEDURE increment_value(); > > > Can you help me? > > &

[SQL] PL/pgSQL: possible parsing or documentation bug?

2001-02-01 Thread Albert REINER
iable names (the full extent of which I do not know) in the documentation (7.0.2). Albert. -- -- Albert Reiner <[EMAIL PROTECTED]> Deutsch * English * Esperanto * Latine --

Re: [SQL] Automated scripting...

2001-01-31 Thread Albert REINER
script will be handled via psql, right? Then you can use \set and interpolation, as described in `man psql`. Albert. -- ------ Albert Reiner <[EMAIL PROTECTED]> Deutsch

[SQL] Suggestion for psql: --file -

2001-01-31 Thread Albert REINER
Saluton, wouldn't it be a good idea (and if it is, I am not sure what list to post it to) to have psql's option -f / --file take "-" for stdin, as many programs do? In shell scripts this would facilitate using here-documents: cat <

[SQL] 7.0.2-docs: textpos -> strpos

2001-01-31 Thread Albert REINER
positionsel | oid oid int2 - int4 | int4 | strpos | text text | (4 rows) ` Maybe this should be fixed in the docs. Albert. -- -- Albert Reiner <[EMAIL PROTECTED]> Deutsch * English * Esperanto * Latine --

Re: [SQL] "'" in SQL INSERT statement

2001-01-26 Thread Albert REINER
" and % are needed, but I certainly did have some reason then. Albert. -- ------ Albert Reiner <[EMAIL PROTECTED]> Deutsch * English * Esperanto * Latine --

Re: [SQL] unreferenced primary keys: garbage collection

2001-01-25 Thread Albert REINER
address record goes away, the record is not removed > > >> > from the address table. Over time, my database will fill up with > > >> > abandoned address records. -- -- Albert Reiner <[EMAIL PROTECTED]> Deutsch * English * Esperanto * Latine --

Re: [SQL] plpgsql language

2001-01-24 Thread Albert REINER
hy is > that? man createlang -- ---------- Albert Reiner <[EMAIL PROTECTED]> Deutsch * English * Esperanto * Latine --

[SQL] Support for arrays in PL/pgSQL

2001-01-03 Thread Albert REINER
Saluton, does anyone know whether there is any support at all for arrays in PL/pgSQL? Thanks in advance, Albert. -- -- Albert Reiner <[EMAIL PROTECTED]> Deutsch * E

[SQL] Ensuring primary key is referenced at least once upon commit

2001-01-03 Thread Albert REINER
lbert. -- -- Albert Reiner <[EMAIL PROTECTED]> Deutsch * English * Esperanto * Latine --

[SQL] PL/pgSQL: recursion?

2001-01-03 Thread Albert REINER
| The connection to the server was lost. Attempting reset: Failed. ` I'm running Postgres 7.0.2. Thanks in advance, Albert. -- ---------- Albert Reiner <[EMAIL PROTECTED]> De

[SQL] Arrays

2000-12-31 Thread Albert REINER
- 1| joe 2| fred 3| mark , a call to select thread('||', t, {1,2,3}) should produce 'joefredmark'. Thanks in advance, Albert. -- ------ Albert Reiner

[SQL] configure: what was used?

2000-12-30 Thread Albert REINER
and multibyte settings. Thanks in advance, Albert (who always compiles from source and does not like nor trust YaST at all). -- -- Albert Reiner <[EMAIL PROTECTED]> D

[SQL] PL/pgSQL: returning array?

2000-12-30 Thread Albert REINER
x-gnulibc1, compiled by gcc 2.95.1 | (1 row) ` I hope you can help me; thanks in advance - Albert. -- -- Albert Reiner <[EMAIL PROTECTED]> Deutsch * English * Esperanto * Latine --

[SQL] Changing owner of tables, functions, etc.

2000-12-30 Thread Albert REINER
Thanks in advance, Albert. -- ------ Albert Reiner <[EMAIL PROTECTED]> Deutsch * English * Esperanto * Latine --

Re: [SQL] Documentation for CASE

2000-12-17 Thread Albert REINER
On Sat, Dec 16, 2000 at 06:39:14PM +0100, Peter Eisentraut wrote: > Albert REINER writes: > > > I think that the documentation for CASE is not very clear: > > Maybe you will like this better (from upcoming 7.1): > > http://www.postgresql.org/devel-corner/docs/postgres/f

[SQL] Documentation for CASE

2000-12-16 Thread Albert REINER
version | | PostgreSQL 7.0.2 on i586-pc-linux-gnulibc1, compiled by gcc 2.95.1 | (1 row) ` Bye, Albert. -- ------ Albert Reiner

Re: [SQL] Create tables in one query

2000-11-24 Thread Albert REINER
what you are trying to do here. You can put statements like ... > in a single file and load the file into psql via \i. That's I build all > of my databases. Or, if you are concerned with possible failures: enclose the series of CREATEs in a transaction. Alber

Re: [SQL] help on creating table

2000-10-25 Thread Albert REINER
will probably want to use a serial for id, etc.) The idea is to store each node in a row, and to store both the row's id and the id of the parent node in it. When there is no parent node (your node NODE_1), parent is NULLL. HTH, Albert. -- ------

Re: [SQL] Tree structure

2000-09-12 Thread Albert REINER
x27;b'); insert into tree (id, parentid, data) values (3, 1, 'c'); Probably you'll also want to use a sequence for the ids, and to declare indices on id, parentid etc. > > Any help would be appreciated. > > Ben. -- -----