[SQL] database log

2001-03-22 Thread datactrl
Since "raise exception" in pl/pgSQL will write error message to database log, how can I read database log. If I do "select * from pg_log;", it will show an error message as "pg_log can not be accessed by user". JACK ---(end of broadcast)--- TIP 3

Re: [SQL] Re: psql win32 version

2001-03-22 Thread Jack
Hi, Christopher Thank you for your help, but the URL http://www.zeos.dn.ua/download/ipgsql-1.6.2.zip is a broken link. Would you please check again. Thank you very much. Jack - Original Message - From: "Christopher Sawtell" <[EMAIL PROTECTED]> Newsgroups: comp.databases.postgresql.sql S

[SQL] creating "job numbers"

2001-03-22 Thread postgresql
I have been working with PG for about 2 months now. I am creating a job tracking system for my company. I have written a front end on the workstations (all macintoshes) that seems to be working quite well. However, I have a problem with a concept. In my current setup I have only one workstati

[SQL] Re: creating "job numbers"

2001-03-22 Thread J.H.M. Dassen (Ray)
postgresql <[EMAIL PROTECTED]> wrote: >I can not first ask with the number will be, and asking for the previous >oid after the fact can also lead to the same problem. If you use sequences and the currval() and nextval() functions, you can. See e.g. http://www.postgresql.org/docs/aw_pgsql_book/n

Re: [SQL] creating "job numbers"

2001-03-22 Thread Andrew Perrin
Check out nextval() and currval(). They do exactly what you need. They're also specific to the current backend, so you can guarantee that the same value won't be passed to two different frontend sessions. nextval('sequencename') -> the number that will be assigned next in

[SQL] how to build this string ?

2001-03-22 Thread juerg . rietmann
Hello there Is it possible (and I think it is) to do the following : I have a table with diameters and types. I need to build a comma separated string. typ diam 01800 01840 01870 011120 02760 02780 02800 02900 031200

Re: [SQL] creating "job numbers"

2001-03-22 Thread Richard Huxton
From: "postgresql" <[EMAIL PROTECTED]> > In my current setup I have only one workstation that is actually > inputting new jobs. So, I took the expedient way to create the job > number. Ask PG to count the rows, add a magic number and insert > this data. This all happens in one connection. What

[SQL] Foreign key referencing subclasses.

2001-03-22 Thread Johannes Grødem
Hi, it seems I can't have a foreign key that references some subclass. Postgres says it can't figure out what its primary key is. The primary key is defined in the superclass. I have something like this: CREATE TABLE resource_record( rrid SERIAL -- etc. ); CREATE TABLE soa_record( -- b

[SQL] Birthday search.

2001-03-22 Thread Antti Linno
I have a table with personal data, including date of birth in date format. What i need is a select that searches birthdays in certain range. E.g. I need to find all birthdays starting from 15.april until 20th december. As you all understand, year doesn't matter :P Any simple and elegant solutions

Re: [SQL] how to build this string ?

2001-03-22 Thread Richard Huxton
From: <[EMAIL PROTECTED]> > Hello there Hello again Juerg - I take it you got that monster query working after? > Is it possible (and I think it is) to do the following : > > I have a table with diameters and types. I need to build a comma separated > string. > > typ diam > 01800

Re: [SQL] Foreign key referencing subclasses.

2001-03-22 Thread Christof Glaser
Hi Johannes, On Thursday, 22. March 2001 15:18, Johannes Grødem wrote: > Hi, > > it seems I can't have a foreign key that references some subclass. > Postgres says it can't figure out what its primary key is. The > primary key is defined in the superclass. > > I have something like this: > > CR

Re: [SQL] Birthday search.

2001-03-22 Thread Jason Earl
Here's an example of something that works with some of the data that I have lying around. Replace exit_dt with "birthday" (or whatever you have named the field that holds the birthday information) and replace ticket_no with name (or whatever) and you should be on the right track. SELECT exit_dt,

Re: [SQL] Foreign key referencing subclasses.

2001-03-22 Thread Stephan Szabo
On Thu, 22 Mar 2001, [iso-8859-1] Johannes Grødem wrote: > Hi, > > it seems I can't have a foreign key that references some subclass. Postgres > says it can't figure out what its primary key is. The primary key is defined > in the superclass. Unique/primary key doesn't inherit to subclasses.

Re: [SQL] creating "job numbers"

2001-03-22 Thread Jan Wieck
postgresql wrote: > How are you professionals handling this problem? I like the ability to > insert and have the system give me the number. As I grow into more > workstations inputting the jobs I won't have to worry about chasing > the next highest number. Two possible ways: 1. If you

[SQL] drop table in PL/pgSQL

2001-03-22 Thread datactrl
When I use "drop Table ..." in PL/pgSQL, it always causes an error as "ERROR copyObject: don't know how to copy 614" JACK ---(end of broadcast)--- TIP 3: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to [E

[SQL] trigger output to a file

2001-03-22 Thread pgsql-sql
Hello Everyone, Here's my simple question. I just want to know/get the recent changes made to a table. Deeper? I wanted the Postgresql server to *publish* every changes made to a table (similar to replication, incremental transfer, etc.). What is the best way to go about it? My idea is to creat