[SQL] list & check tables

2000-06-09 Thread psql mail
I know it sounds simple but I'm having trouble finding commands to return all of the tables in a database ... and test if a certain table exists... I know you can use \dt etc but I want to have something I can call from php so it will return an array or some form I can use in the code. are the

[SQL] to convert a statement ...

2000-06-09 Thread Benedykt P. Barszcz
Hi, I would like to convert the following file: http://www.uwindsor.ca/library/leddy/people/art/pycreate.sql so it is acceptable by postgresql. It was written for MySQL. thank you for any help Benedict P. Barszcz

[SQL] Client Logging

2000-06-09 Thread Bryan White
I sometimes need to be able to identify what client application is causing messages that are appering in the backend log file. To do this I want the client to identify itself in the log file. I can see 3 ways this could be implemented: 1) An identification string passed when a connection is esta

Re: [SQL] ORDER BY in definition of views

2000-06-09 Thread Jan Wieck
Niall Smart wrote: > Guys, > > Does anyone know if this is on the radar for 7.1? Yes, it is not. Jan -- #==# # It's easier to get forgiveness for being wrong than for being right. # # Let's break this rule - forgive me.

[SQL] Something I'd like to try...

2000-06-09 Thread Niall Smart
Hi, I just noticed that postgres doesn't totally support column aliases on UPDATE statements, for example UPDATE EMPLOYEES SET OFFICE_PHONE = UU.OFFICE_PHONE, MOBILE_PHONE = UU.MOBILE_PHONE, OFFICE_CD = UU.OFFICE_CD, A

Re: [SQL] Problem with subquery in CHECK constraint.

2000-06-09 Thread Niall Smart
Hiroshi Inoue wrote: > > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On > > Behalf Of Niall Smart > > > > CONSTRAINT TYPE_CD_OK CHECK ( > > EXISTS (SELECT 1 FROM XREF WHERE > > XREF_GROUP = 'CUST_TYPE' AND > > XREF_CD = TYPE_CD) > > ) > > > >

[SQL] Trouble with creating tempoprary tables in plpgsql

2000-06-09 Thread Alexander Stetsenko
Hi I create some temporary tables in plpgsql function: "create temp table as select * ..." all works if I execute this function standalone but if this function is called by another function more then once temp tables can`t be create because ones exists I was trying bypass this first create temp t

RE: [SQL] SQL 'Case When...'

2000-06-09 Thread Oliver Graf
> Don't know if it's possible, but how do I make the following SQL > statments right? > > select attribute[1] > from table > case when attribute[1]='yes' > then select attribute[2] from table > else select attribute[3] from table; > > Basically, I want to compare attr[1], if true then