[GENERAL] referring to a different database from a trigger

2008-11-21 Thread pw
Hello, Is there a syntax for querying another database from a trigger in the current database? Thanks for any info, P -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general

Re: [GENERAL] referring to a different database from a trigger

2008-11-21 Thread pw
Scott Marlowe wrote: On Fri, Nov 21, 2008 at 3:31 PM, ries van Twisk [EMAIL PROTECTED] wrote: Note that there are no built in transactional symantics in such situations. You got to roll your own. And they may not work. Yeah, that was what I was hoping for. ie:(query between databases)

[GENERAL] Compiling C Trigger function

2008-09-03 Thread pw
Hello, I am attempting to compile a C trigger function for use with Postgresql. The function uses SPI and I am comiling in linux using gcc. The compiler is finding all the correct headers but complains that it can't find the SPI functions. I am compiling with -lpq . Do I need to compile with

[GENERAL] Querying Headers

2008-02-29 Thread pw
Hello, I am curious if there is a postgresql function that will return a list of header names based on an input query text. ie: select return_headers(SELECT name, date, shape FROM some_table;) as headers; returning: headers --- name date shape Thanks for any help. Pw

Re: [GENERAL] Querying Headers

2008-02-29 Thread pw
pw wrote: Hello, I am curious if there is a postgresql function that will return a list of header names based on an input query text. ie: select return_headers(SELECT name, date, shape FROM some_table;) as headers; returning: headers --- name date shape Thanks for any help. Pw

Re: [GENERAL] How do I recover from pg_xlog/0000000000000000 (log

2004-10-19 Thread pw
Tom Lane wrote: peter Willis [EMAIL PROTECTED] writes: [EMAIL PROTECTED] /]$ LOG: database system shutdown was interrupted at 2004-10-18 11:41:55 PDT LOG: open of /web2-disk1/grip/database/pg_xlog/ (log file 0, segment 0) failed: No such file or directory LOG: invalid

Re: [GENERAL] How do I recover from pg_xlog/0000000000000000 (log

2004-10-19 Thread pw
Mike Nolan wrote: On Tue, Oct 19, 2004 at 03:49:04PM -0700, pw wrote: I set up a cron job to pg_dump and gzip every hour and dump any backup gz files older than 1 week. Huh ... be sure to keep some older backup anyway! There was just someone on a list (this one?) whose last two weeks of backups

[GENERAL] How Do I Change The 'Owner' of a Database?

2004-10-12 Thread pw
Hello, I used a user to create a database but postgreSQL insists that the 'postgres' user is the owner. It's a bit annoying to have to change users to link sequences to counter values. How can I cahnge the owner of the database to the proper user? Peter ---(end of

Re: [GENERAL] How Do I Change The 'Owner' of a Database?

2004-10-12 Thread pw
Thanks for your help, I was looking at ALTER DATABASE but the docs don't disclose any attributes so *what the heck does one ALTER?* I'll try the query that you offered. Peter Steven Klassen wrote: There might be something you can do with 'alter database' as well. ---(end

[GENERAL] query of database to get permitted users list

2004-05-10 Thread pw
Hello, I have a query of pg_database to find the owners of each available database. How can I query to get the users that have permissions on any particular database? pg_user always contains *all* database users regardless of whether they have granted permissions to the current db. Thanks for

[GENERAL] What is the syntax for UPDATE from one table to another?

2004-03-12 Thread pw
Hello, What is the proper syntax for updating a column inone table from a column in another? I have tried this: UPDATE destination_table FROM source_table SET destination_table.column_one = source_table.column_b WHERE constraint; This fails, so I must have the syntax incorrect. Thanks for any

Re: [GENERAL](THE_ANSWER) What is the syntax for UPDATE from one

2004-03-12 Thread pw
Thanks to everyone who helped. I found the solution just by tooling with the SQL syntax. FYI, the correct syntax is: UPDATE destination_table SET dest_column=A FROM (SELECT src_column as A, src_link_col FROM src_table) AS J WHERE src_link_col=dst_link_col; Pete pw wrote: Hello, What

[GENERAL] problem running postmaster

2003-11-18 Thread pw
Hello, I am having problems running postmaster. I get the following error: DEBUG: invoking IpcMemoryCreate(size=1466368) PANIC: invalid checksum in control file The postmaster then exits. What control file is it talking about? Is this a common error? Thanks for any help Peter

[GENERAL] converting varchar date strings to date

2003-10-14 Thread pw
Hello, How can I typecast a date generated from VARCHAR fields into a date field ie: UPDATE inventory SET date_field = vc_year||'-'||vc_month||'-'||vc_day; where the date string is built up from varchar fields? Thanks for any help. Peter ---(end of

Re: [GENERAL] converting varchar date strings to date

2003-10-14 Thread pw
Hello, This has been resolved. As I told a previous poster, CAST() wasn't working. I have no idea why. I finally used: UPDATE inventory SET date_field=date(vc_year||'-'||vc_month||'-'||vc_day ); Peter pw writes: How can I typecast a date generated from VARCHAR fields into a date field