Re: [SQL] COMMENT ON CONSTRAINT

2004-08-15 Thread Andreas Seltenreich
Sascha Ziemann writes: > it is defined in this way: [...] > CONSTRAINT constraint_name ON table_name | Well then... > comment on constraint uni on table tab3 is 'unique pair'; ^ ...why do you insert "table" when it is defined without? :-) regards Andreas --

[SQL] CROSS-TAB query help? I have read it cant be done in one SQL, pro ve them wrong!

2004-08-15 Thread Theo Galanakis
Title: CROSS-TAB query help? I have read it cant be done in one SQL, prove them wrong! Does anyone know how to perform a cross-tab query in ONE SQL without having to write a SP? The SQL at the end of this email attempts to display the subquery result-set in a cross-tab format, it does not grou

Re: [SQL] Getting points from polygon

2004-08-15 Thread Tom Lane
[EMAIL PROTECTED] (Sebastian Albrecht) writes: > how can I get single xy-points from a polygon like for example: [ looks through pg_proc... ] Hmm, this seems to be an oversight in the polygon datatype. I don't think it'd be real practical to support an array-subscript-like notation, but certainl

Re: [SQL] LIKE '%%' does not return NULL

2004-08-15 Thread Frank Finner
Hi, you should additionally check with IS NULL: SELECT * FROM mytable where myfield like '%%' OR myfield IS NULL if you want to get fields containing NULL as well. A field containing "NULL" in fact contains nothing, not even an empty string, so you cannot catch it with "%". BTW, this holds true

Re: [SQL] LIKE '%%' does not return NULL

2004-08-15 Thread Stephan Szabo
On Wed, 11 Aug 2004, Traci Sumpter wrote: > A team developer has chosen the lazy way of not checking if a variable > exists on his PHP page and has code which produces the following SQL > > SELECT * FROM mytable where myfield ilike '%%' > > I have noticed that this statement does not return null o

[SQL] tablefunc's in 8.0 Beta Win32 - where?

2004-08-15 Thread Thomas Wegner
Whera are tablefunc's like connectby in 8.0? - Thomas Wegner Cabrio Meter - The Weather Plugin for Trillian http://trillian.wegner24.de/cabriometer ---(end of broadcast)--- TIP 2: you can get off all list

Re: [SQL] tablefunc's in 8.0 Beta Win32 - where?

2004-08-15 Thread Thomas Wegner
Sorry, i found it. I'm Win32 user and use installation from pgInstaller. I compile it and it run fine :-) ! - Thomas Wegner Cabrio Meter - The Weather Plugin for Trillian http://trillian.wegner24.de/cabriometer "Thomas Wegner" <[EMAIL PROTECTED]> schrieb

Re: [SQL] Suggestions on storing re-occurring calendar events

2004-08-15 Thread --CELKO--
>> I'd like to figure out a way to add simple re-occurrances of events. I can think of two ways, [a] Using application logic, create a finite number of future occurrences --for example, for 10 occurrences, 10 entries into ftr_cal_events will be created. This seems like an ugly hack. << No, not r

Re: [SQL] Wierd Error on update

2004-08-15 Thread Pentilian
> Original 7.3 release, or (I hope) 7.3.something? 7.3 > > I am getting two errors which are a bit confounding. > > ERROR: pg_class_aclcheck:relation 474653086 not found > > Are there any views involved? No views. Is the statement invoking any functions? The statement is not invoking any fu

[SQL] Getting points from polygon

2004-08-15 Thread Sebastian Albrecht
Hello, how can I get single xy-points from a polygon like for example: CREATE TABLE "public"."country" ( "country_id" INTEGER NOT NULL, "geo" polygon NOT NULL ) SELECT geo.x, geo.y FROM country WHERE geo.x=5 or SELECT geo[24th point].x FROM country ... Thanks in advance

[SQL] Performance Problem With Postgresql!

2004-08-15 Thread Arash Zaryoun
Hi All, We are having a performance problem with our database. The problem exists when we include a constraint in GCTBALLOT. The constraint is as follows: alter table GCTBALLOT add constraint FK_GCTBALLOT_GCTWEBU foreign key (GCTWEBU_SRL) references GCTWEBU (SRL) on delete restrict

Re: [SQL] Sending errors from psql to error file

2004-08-15 Thread Oliver Elphick
On Thu, 2004-08-12 at 16:09, Oliver Elphick wrote: > "2>" redirects standard error I forgot to say "&1" means the file open on file descriptor 1, which is always standard output. So "2>&1" means send standard error to standard output, so that a pipe (which just takes standard output) can see the

[SQL] duplicate table in two databases

2004-08-15 Thread Fabio Ferrero
I use postgres 7.2.1 (debian woody) and PHP. I've two databases (foo and bar for example) with the same table (ie. stamps). It's possible with a single query transfer the data from the stamps table in db foo to the stamps table in db bar? Or I need a row by row copy? Or maybe a dump on temp fil

[SQL] Returning A Varchar From A Function

2004-08-15 Thread Richard Hurst
Hi this has been puzzling me for a few days now I have created a function that I want to use in a database to select a value from a table based on the value passed in. The table is fairly simple CREATE TABLE public.feeder_next_status ( status varchar NOT NULL, previous_status varchar, next

[SQL] COMMENT ON CONSTRAINT

2004-08-15 Thread Sascha Ziemann
Hi, I have a problem with the COMMENT command. Here: http://www.postgresql.org/docs/7.4/static/sql-comment.html it is defined in this way: COMMENT ON { TABLE object_name | COLUMN table_name.column_name | AGGREGATE agg_name (agg_type) | CONSTRAINT constraint_name ON table_name | DATAB

Re: [SQL] Sum and count weird results

2004-08-15 Thread Michalis Kabrianis
Christoph Haller wrote: Michalis Kabrianis wrote: Hi all, I have these tables a ( id integer, email varchar); b ( seat varchar, transactionid varchar); c ( transactionid varchar, totalprice numeric(8.2)); ---(end of broadcast)--- TIP 8: explain analy

[SQL] LIKE '%%' does not return NULL

2004-08-15 Thread Traci Sumpter
A team developer has chosen the lazy way of not checking if a variable exists on his PHP page and has code which produces the following SQL SELECT * FROM mytable where myfield ilike '%%' I have noticed that this statement does not return null or empty myfield records. Is this the way (SQL) to do

Re: [SQL] UNIQUE constraint

2004-08-15 Thread Sascha Ziemann
Michael Glaesemann <[EMAIL PROTECTED]> writes: > On Aug 7, 2004, at 3:25 AM, Sascha Ziemann wrote: > > CREATE TABLE example ( > > a integer, > > b integer, > > c integer, > > UNIQUE (a, c) > > ); > > > > But it is not clean to me. Does the above example mean that the list > > of p