Re: [SQL] "Flattening" query result into columns

2005-03-27 Thread Thomas Borg Salling
Thanks to all for the useful replies. I chose this approach from Scott Marlowe, which can meet the requirements I work against. Arrays seemed to have some issues with element with null elements. /Thomas. -Oprindelig meddelelse- Fra: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] På vegne af

Re: [SQL] (non)zero function

2005-03-27 Thread Bruno Wolff III
On Sun, Mar 27, 2005 at 17:58:07 +0200, Enrico Weigelt <[EMAIL PROTECTED]> wrote: > > Hi folks, > > > is there an function returning true if the argument is null or > zero (just to make some queries more concise). Of course its > trivial to implement as SQL function, but if postgresql alread

Re: [SQL] detaching triggers

2005-03-27 Thread Mike Rylander
On Sun, 27 Mar 2005 17:41:02 +0200, Enrico Weigelt <[EMAIL PROTECTED]> wrote: > > Hi folks, > > is it somehow possible to detach trigger, so the calling transaction > can return immediately, even before the trigger function has > returned. No, but see below. > The only solution I currently know

Re: [SQL] Foreign key

2005-03-27 Thread Bruno Wolff III
On Fri, Mar 25, 2005 at 16:31:16 +0100, [EMAIL PROTECTED] wrote: > > When i add table with foreign key in my database, this error return : < > number of referencing and referenced colums for foreign key disagree>. > > How resolve this problem ? Besides what Mike said, one other thing to rememb

[SQL] (non)zero function

2005-03-27 Thread Enrico Weigelt
Hi folks, is there an function returning true if the argument is null or zero (just to make some queries more concise). Of course its trivial to implement as SQL function, but if postgresql already provides such a function, I would prefer using it. cu -- ---

Re: [SQL] Postgre: 8.0.1 Create Table insde a function gives strange error at execution time

2005-03-27 Thread Tom Lane
"Franz Stuetzle" <[EMAIL PROTECTED]> writes: > ERROR: syntax error at or near "$1" bei Zeichen 87 > ANFRAGE: CREATE TEMPORARY TABLE globals_pac_adressarten (INT_ALIAS_NAME > VARCHAR(12) NOT NULL , $1 SMALLINT NOT NULL , > $2 SMALLINT NOT NULL ) WITHOUT OIDS ON COMMIT PRESERVE ROWS > Would anyb

[SQL] detaching triggers

2005-03-27 Thread Enrico Weigelt
Hi folks, is it somehow possible to detach trigger, so the calling transaction can return immediately, even before the trigger function has returned. I've got to do some quite complex things which may need some time, when some clients fill in some data, but the results are quite uninteresting

[SQL] Postgre: 8.0.1 Create Table insde a function gives strange error at execution time

2005-03-27 Thread Franz Stuetzle
Title: Postgre: 8.0.1 Create Table insde a function gives strange error at execution time Code within a function is like this: SELECT 1   INTO   x FROM   pg_tables where tablename = 'globals_pac_adressarten' and   tableowner = us

Re: [SQL] Is there a way to find a schema name

2005-03-27 Thread Michael Fuhr
On Thu, Mar 24, 2005 at 08:03:48AM -0800, Kalyani Chennupati wrote: > Would like to know if there is a way to find a schema > name (when in the schema through a application or > through psql). See "System Information Functions" (or "Miscellaneous Functions") in the "Functions and Operators" chapt

Re: [SQL] Accessing other Databases

2005-03-27 Thread Michael Fuhr
On Mon, Mar 21, 2005 at 11:11:26AM -0300, [EMAIL PROTECTED] wrote: > > Anybody knows some way to access other database inside of a different > database(under the same instalation of postgres)? See the contrib/dblink module. -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---

Re: [SQL] How to make update statement to work

2005-03-27 Thread Tom Lane
"Andrus Moor" <[EMAIL PROTECTED]> writes: > UPDATE demo.toode > SET "liik"=NULL,"grupp"=NULL >WHERE ("grupp","liik") NOT IN > (SELECT ("grupp", "liik") FROM "artliik") > ERROR: operator does not exist: character = record > How to write

Re: [SQL] select a list of schema names

2005-03-27 Thread Michael Fuhr
On Fri, Mar 25, 2005 at 09:50:18PM +0200, Andrus Moor wrote: > > How to select a list of schema names which current user is authorized to > access ? See "System Catalogs" and "System Information Functions" (or "Miscellaneous Functions") in the documentation. Here are links to documentation for