Re: [SQL] Test if a table is present

2008-07-25 Thread Volkan YAZICI
On Sat, 26 Jul 2008, "Ole Ekerhovd" <[EMAIL PROTECTED]> writes: > How can I test if a table is present in database? SELECT TRUE FROM information_schema.tables WHERE table_name = '' AND table_schema = '' BTW, this query is portable across database systems supporting information

Re: [SQL] Test if a table is present

2008-07-25 Thread Anoop G
you can find it throuh a query like this select tablename from pg_tables where tablename = 'tbl_updated_status_master'; regards: Anoop

[SQL] Test if a table is present

2008-07-25 Thread Ole Ekerhovd
How can I test if a table is present in database? Regards, Ole

Re: [SQL] PERSISTANT PREPARE (another point of view)

2008-07-25 Thread chester c young
1. like the idea because right now I'm having to track which prepared statement (sets) are in which session. using xcache to track this, but little bit dangerous. could query the database first but the whole idea is to take a load off the db. 2. perhaps "global" could mean simply that the def

Re: [SQL] PERSISTANT PREPARE (another point of view)

2008-07-25 Thread Pavel Stehule
Hello this is near my implemenation of stored procedures - it's not far from your view on prepared statements. There result of any unbound select is directly forwarded to client - there is little bit different syntax, but idea is same create procedure foo(params) as $$ begin select a, b, c fr

Re: [SQL] PERSISTANT PREPARE (another point of view)

2008-07-25 Thread Milan Oparnica
Jeff Williams wrote: You can do this with cursors, but I'm not sure if you still get the query caching? I can do it with cursors, I don't get query cache but that is for now not an issue. Issue is performance. Although using cursors show better performance over using SET OF user defined

Re: [SQL] Query prepared plan

2008-07-25 Thread Tom Lane
Emi Lu <[EMAIL PROTECTED]> writes: > Somebody know about how to find prepared query plan through command line? PREPARE fooplan(...) EXPLAIN EXECUTE fooplan(...) regards, tom lane -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make change

Re: [SQL] A table with two names or table alias

2008-07-25 Thread Igor Neyman
There are no synonyms in Postgres (like in Oracle). To implement what you want, you need to use views and rules. From Postgres docs: "Currently, views are read only: the system will not allow an insert, update, or delete on a view. You can get the effect of an updatable view by creating rules that

Re: [SQL] Query prepared plan

2008-07-25 Thread Emi Lu
Good morning, May I know the "commands" to . show current session's prepared plans . see the definition of a prepared plan E.g., psql> PREPARE fooplan (int, text, bool, numeric) AS INSERT INTO foo VALUES($1, $2, $3, $4); (1) Similar to "\dt", I want to see "fooplan" (2) Similar to "\d table

Re: [SQL] PERSISTANT PREPARE (another point of view)

2008-07-25 Thread Milan Oparnica
Craig Ringer wrote: Milan Oparnica wrote: I found this link from IBM DB2 developers showing why PERSISTENT PREPARE is a good idea and how could it be implemented. [snip] NONE OF POPULAR SQL DBMS (Oracle, MS SQL, MySQL, Postgre, INTERBASE, FIREBIRD) HAVE THIS FEATURE. WHY ? I suspect that

Re: [SQL] A table with two names or table alias

2008-07-25 Thread A. Kretschmer
am Fri, dem 25.07.2008, um 14:12:47 +0200 mailte Tk421 folgendes: >Can I create a table name alias? > >What i want is to access the same table with two different names. An > example: > >I've the table CITY with fields code and name. I want to know if i > can create an alternative n

[SQL] A table with two names or table alias

2008-07-25 Thread Tk421
Can I create a table name alias? What i want is to access the same table with two different names. An example: I've the table CITY with fields code and name. I want to know if i can create an alternative name to table CITY, like LOCATION, to make possible these two sentences:

Re: [SQL] postgres time zone settings(time difference in Server and client)

2008-07-25 Thread Anoop G
Hai all, my postgres version is PostgreSQL 8.1.8 didn't support clock_timestamp() regards: Anoop

Re: [SQL] postgres time zone settings(time difference in Server and client)

2008-07-25 Thread Pawel Socha
2008/7/25 Anoop G <[EMAIL PROTECTED]>: > > Hai all, > >I have database running on server. I am using python to run my > application.postgres client is running on the clients .All clients are > connected to a single database running on server. Each time application > starts ,the login time is

Re: [SQL] postgres time zone settings(time difference in Server and client)

2008-07-25 Thread Richard Huxton
Anoop G wrote: Hai all, I have database running on server. I am using python to run my application.postgres client is running on the clients .All clients are connected to a single database running on server. Each time application starts ,the login time is taken from server using the query "

Re: [SQL] postgres time zone settings(time difference in Server and client)

2008-07-25 Thread Anoop G
Hai all, I have database running on server. I am using python to run my application.postgres client is running on the clients .All clients are connected to a single database running on server. Each time application starts ,the login time is taken from server using the query """select CAST ( t

Re: [SQL] Arrays, types and prodedures

2008-07-25 Thread Pavel Stehule
hello 2008/7/25 Chris Hoy <[EMAIL PROTECTED]>: > > > Hi > > I am having trouble passing arrays of types to a store procedure > I have the following type > >CREATE TYPE IndexElement AS ( >keyname text, >keytype integer >); > > and the header for the

[SQL] Arrays, types and prodedures

2008-07-25 Thread Chris Hoy
Hi I am having trouble passing arrays of types to a store procedure I have the following type CREATE TYPE IndexElement AS ( keyname text, keytype integer ); and the header for the store prodedure is as follows: CREATE OR REPLACE FUNCTION doIndex