[SQL] Connecting to different DataBase In PlPgsql Function

2001-10-25 Thread Bhuvan A
hello all, How can we connect to different database using plpgsql function? Can we? Thankx in advance. == A beer delayed is a beer denied.

Re: [SQL] URGENT: restoring a database

2001-10-25 Thread David Stanaway
On Friday, October 26, 2001, at 11:22 AM, Oleg Lebedev wrote: > Hi, > I think I got a problem here. > I tried to restore my database from dump.bac file, which was created > with > pg_dumpall -o > dump.bac > This is what I did: >> createdb replica >> psql -d replica -f dump.bac > Sounds like yo

[SQL] URGENT: restoring a database

2001-10-25 Thread Oleg Lebedev
Hi, I think I got a problem here. I tried to restore my database from dump.bac file, which was created with pg_dumpall -o > dump.bac This is what I did: > createdb replica > psql -d replica -f dump.bac Notice that I have two different databases stored in this file. This is what I got: You are no

[SQL] rollback

2001-10-25 Thread Oleg Lebedev
Hi everybody, I was playing with psql and accidently deleted a couple of records from my database. I am wondering if there is any way to restore them. I know that in Oracle you can do 'rollback work' from SQLPlus interface and it would rollback all the updates done to the database. I am pretty sur

Re: [SQL] [LONGINT] Problem

2001-10-25 Thread Stephan Szabo
On Thu, 25 Oct 2001, Alexey Prohorenko wrote: > I am new to PostgreSQL -- (I am migrating from MySQL), so I have > some, may be "stupid", but still interesting questions. > Interesting for me. :-) > > In MySQL there was type called INT UNSIGNED, where I used > to k

Re: [SQL] autoincrement

2001-10-25 Thread Aasmund Midttun Godal
SERIAL type (look it up in the docs). Regards, Aasmund PS. I may not be good at counting, but I have counted your two words 3 times and I still get 6. On Thu, 25 Oct 2001 23:09:32 +0300, Alexey Prohorenko <[EMAIL PROTECTED]> wrote: > How can I reproduce in PostgreSQL type structure fr

Re: [SQL] autoincrement

2001-10-25 Thread Bruce Momjian
Use SERIAL instead of AUTO_INCREMENT. > How can I reproduce in PostgreSQL type structure from MySQL: > INT NOT NULL PRIMARY KEY AUTO_INCREMENT > > ? > > To be more exact -- in two words: "how can I create autoincrement > field?" > > Thanks a lot. > > -- >

[SQL] autoincrement

2001-10-25 Thread Alexey Prohorenko
How can I reproduce in PostgreSQL type structure from MySQL: INT NOT NULL PRIMARY KEY AUTO_INCREMENT ? To be more exact -- in two words: "how can I create autoincrement field?" Thanks a lot. -- green [http://www.extrasy.net] --

[SQL] [LONGINT] Problem

2001-10-25 Thread Alexey Prohorenko
Hi, Guys, I am new to PostgreSQL -- (I am migrating from MySQL), so I have some, may be "stupid", but still interesting questions. Interesting for me. :-) In MySQL there was type called INT UNSIGNED, where I used to keep values from 1 to 4

[SQL] [Q] External join

2001-10-25 Thread Max Buvry
Hi, I wish to have the confirmation that external join is not possible with postgresql (v 7.0). In advance, thanks mb ---(end of broadcast)--- TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]

Re: [SQL] GUID in postgres

2001-10-25 Thread Josh Berkus
Horst, > What we are using is the following: > - All tables in need of a global ID _within_ a database inherit a > globid > table which contains nothing but an ID of type serial. > - When we need cross-database unique IDs within the same system, the > globid > table contains a database identifi

Re: [SQL] Lock full database

2001-10-25 Thread Haller Christoph
> > I want lock full tables,how to write SQL command? > thanks > BEGIN ; LOCK TABLE ; /* done, locked until "commit;" */ Refer to the SQL-LOCK-command for further information. Regards, Christoph ---(end of broadcast)--- TIP 5: Have you ch

Re: [HACKERS] [SQL] Index of a table is not used (in any case)

2001-10-25 Thread Reiner Dassing
Hello Tom! Tom Lane wrote: > > Reiner Dassing <[EMAIL PROTECTED]> writes: > > explain select * from wetter order by epoche desc; > > NOTICE: QUERY PLAN: > > > Index Scan Backward using wetter_epoche_idx on wetter > > (cost=0.00..3216018.59 rows=2034 width=16) > > > explain select * from w

Re: [SQL] GUID in postgres

2001-10-25 Thread John Hasler
I wrote: > Globally Unique IDentifier, probably. Just hash a 128 bit random number > with the current date. Horst writes: > That gives you no gurantee it will be unique. There is no such guarantee. The probability of a collision due to errors and bugs using a "deterministic" system is sure to

Re: [SQL] How to find primary keys by querying system tables

2001-10-25 Thread Haller Christoph
> > Is there a way of testing for membership in an int2vector-field? For > example: > select column, "prim.key" from ... where pg_attribute.attnum in > pg_index.indkey > ?? > I think so. Refer to the array section of the documentation. Extract: To search for a value in an array, you must check

[SQL] Question regarding Function & Return table

2001-10-25 Thread Suyam
All, I am a beginner to learn Pl/ SQL. How can I return either " Return Pl/SQL table" or "Return VARCHAR2" simultaneously? The result is dependable on Count(Last_name) condition. Thanks, The below is incomplete because I cannot understand the above question. ===