Re: [ADMIN] pg_restore --data-only (-a) does not work

2003-06-26 Thread Tom Lane
"Barna, Gary" <[EMAIL PROTECTED]> writes: > bash-2.03$ pg_restore -c -a -d [dbname] ../data/backups/[-Fc Archive] > pg_restore: [archiver (db)] error returned by PQputline Lessee ... you drop all the tables (-c) and then try to restore data without recreating them (-a) ... not too surprising it do

Re: [ADMIN] Newbie question

2003-06-26 Thread Tom Lane
Bruno Wolff III <[EMAIL PROTECTED]> writes: >> I want the column to accept the column value which is absolutely length of two. > A char(2) will always have two characters (unless it is NULL). If you want > to check for two nonblank characters or two letters or something like > that use a check con

Re: [ADMIN] 7.4 Documetation

2003-06-26 Thread Bruce Momjian
My builds are now every 5 minutes now that I have a faster computer. --- Tom Lane wrote: > "Mendola Gaetano" <[EMAIL PROTECTED]> writes: > > on VIII. Appendixes of PostgreSQL 7.4devel Documentation > > is missing the releas

Re: [ADMIN] 7.4 Documetation

2003-06-26 Thread Tom Lane
"Mendola Gaetano" <[EMAIL PROTECTED]> writes: > on VIII. Appendixes of PostgreSQL 7.4devel Documentation > is missing the release note of 7.3.3. The docs build at developer.postgresql.org has been busted for quite some time :-(. I'm hoping to see it fixed soon, but for the moment you are better

Re: [ADMIN] How do I select the last Id in a column???

2003-06-26 Thread Bruno Wolff III
On Thu, Jun 26, 2003 at 17:46:14 -0700, Josh Goldberg <[EMAIL PROTECTED]> wrote: > From what Bruno enlightened us to about read commit mode, it seems this is > the only safe way to go. > > Wouldn't currval (as presented by others) be affected in the same manner as > my example? No because currv

Re: [ADMIN] How do I select the last Id in a column???

2003-06-26 Thread Josh Goldberg
>From what Bruno enlightened us to about read commit mode, it seems this is the only safe way to go. Wouldn't currval (as presented by others) be affected in the same manner as my example? - Original Message - From: "DHS Webmaster" <[EMAIL PROTECTED]> To: "Michael Kovalcik" <[EMAIL PROTEC

[ADMIN] Postgres RoadMap

2003-06-26 Thread Mendola Gaetano
Hi all, Do we have a road map similar to this (MySql): http://www.databasejournal.com/features/mysql/article.php/2210771 ? I heard only about the point in time recovery in version 7.4, that's all, what about, for example, a "multi DB/HOST select" or the nested transactions ? Regards Gaetano --

Re: [ADMIN] How do I select the last Id in a column???

2003-06-26 Thread Bruno Wolff III
On Thu, Jun 26, 2003 at 14:00:33 -0700, Josh Goldberg <[EMAIL PROTECTED]> wrote: > to get the last record inserted just > select * from row order by autoincId desc limit 1; > > if you have several clients doing this you might want to put your insert and > the select inside a transaction. That w

[ADMIN] 7.4 Documetation

2003-06-26 Thread Mendola Gaetano
Hi all, on VIII. Appendixes of PostgreSQL 7.4devel Documentation is missing the release note of 7.3.3. Regards Gaetano. ---(end of broadcast)--- TIP 7: don't forget to increase your free space map settings

Re: [ADMIN] How do I select the last Id in a column???

2003-06-26 Thread DHS Webmaster
What we do since 2 queries are necessary anyway, is to select the NEXTVAL which gives us our 'record id' up front. Then when we do our insert, we include that field with the value we just selected from our sequence and we're all set. Of course if the insert fails for some reason, then you will have

Re: [ADMIN] How do I select the last Id in a column???

2003-06-26 Thread scott.marlowe
The proper way to do this is basically this: begin; insert into table test values ('abc',123); select currval('sequsedbytest'); insert into dependent_table values (keyfromabovecurrval,'moredata',456); commit; On Mon, 23 Jun 2003, Michael Kovalcik wrote: > Hello, > > I'm trying to find out how I

Re: [ADMIN] How do I select the last Id in a column???

2003-06-26 Thread Ericson Smith
To get the ID after the fact: SELECT currval('my_seq') AS id; To get the ID before even inserting it SELECT nextval('my_seq') AS id; - Ericson Smith [EMAIL PROTECTED] Josh Goldberg wrote: to get the last record inserted just select * from row order by autoincId desc limit 1; if you have severa

Re: [ADMIN] How do I select the last Id in a column???

2003-06-26 Thread Josh Goldberg
to get the last record inserted just select * from row order by autoincId desc limit 1; if you have several clients doing this you might want to put your insert and the select inside a transaction. - Original Message - From: "Michael Kovalcik" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> S

[ADMIN] pg_restore --data-only (-a) does not work

2003-06-26 Thread Barna, Gary
I tried countless ways to try to restore data only for all tables using the -a switch. None seem to work. I was able to restore data only for specific tables using the -t switch, but I was expecting that I should be able to invoke a command with -a that checks all tables and restores all data ap

[ADMIN] How do I select the last Id in a column???

2003-06-26 Thread Michael Kovalcik
Hello, I'm trying to find out how I select the last id in a column if I don't know anything else about the row. What i am doing is inserting information into my Orders table and the id is auto-incrementing. The next thing i want to be able to do is grab the the id of the order i just inserted.

Re: [ADMIN] Newbie question

2003-06-26 Thread Bruno Wolff III
On Thu, Jun 26, 2003 at 15:59:55 -0400, Vinay <[EMAIL PROTECTED]> wrote: > I have a very simple question regarding creating columns in a table > > Can we create a column in a table in such a way that it will allow only certain > length, nothing less or nothing more > > here is an example > >

Re: [ADMIN] Newbie question

2003-06-26 Thread scott.marlowe
On Thu, 26 Jun 2003, Vinay wrote: > I have a very simple question regarding creating columns in a table > > Can we create a column in a table in such a way that it will allow only certain > length, nothing less or nothing more > > here is an example > > > create table test(column1 char(2)); >

[ADMIN] Newbie question

2003-06-26 Thread Vinay
I have a very simple question regarding creating columns in a table   Can we create a column in a table in such a way that it will allow only certain length, nothing less or nothing more   here is an example     create table test(column1 char(2));   will create table with column1 which will a

[ADMIN] Object based Query Requirement.

2003-06-26 Thread Anagha Joshi
Title: Object based Query Requirement. Hi, I use Postgres-7.2.4. and my client is in C++ I need to know the following: As I user libpq++ library, I have to pass the query in the string format only. i.e.’const  char *’ Does Postgres support object based query? i.e. User should make the obj