Re: [SQL] problem with date/time constants

2001-07-03 Thread Bhuvan A
Hi, 'now' is a function... so try 'select now();' On Tue, 3 Jul 2001, datactrl wrote: > Hi, > server:PostgreSQl 7.1 > why doesn't following statement work? > "select now;" > > THANK YOU! > JACK LIU > > > > ---(end of broadcast)--- > TIP 6:

Re: [SQL] count(*)

2001-07-03 Thread Tom Lane
>> You probably mean: >> select car, tit, (select count(*) from auto) from auto I think he probably wants select car, tit, count(*) from auto group by car, tit regards, tom lane ---(end of broadcast)--- TIP 6: Have

Re: [SQL] simple function crashes my postmaster

2001-07-03 Thread Tom Lane
Meggus <[EMAIL PROTECTED]> writes: > there is a mystic problem with a simple C function which creates a table. > I minimized the code to reproduce the error. It crashes on two different > Linux systems (SuSE) and with pg 7.0/7.1. I found that the crash occurrs > as soon as I use a SERIAL type i

[SQL] Re: drop table if exists

2001-07-03 Thread Philip Hallstrom
Just drop the table using "DROP TABLE mytable;" and ignore the error... I'm sure there are fancy ways of doing it by accessing system tables, but the above works for me. On Tue, 3 Jul 2001, Jason Watkins wrote: > How can I duplicate the behavior of: > > DROP TABLE IF EXISTS mytable; > > CREATE T

[SQL] Re: drop table if exists

2001-07-03 Thread Jason Watkins
Doesn't work. I like wrapping up the entire file in a transaction so that if I make a stupid syntax error or the like, I can just do a rollback. Because of that, the transaction enters abort state. I suppose I can just stop using transactions and use this method. ---(end

[SQL] drop table if exists

2001-07-03 Thread Jason Watkins
How can I duplicate the behavior of: DROP TABLE IF EXISTS mytable; CREATE TABLE mytable ( blah, blah ); INSERT INTO mytable (blah) VALUES (blah); in other words, so that I have a single sql file that restores the database to a known state. ---(end of broadcast)---

[SQL] simple function crashes my postmaster

2001-07-03 Thread Meggus
Hi, there is a mystic problem with a simple C function which creates a table. I minimized the code to reproduce the error. It crashes on two different Linux systems (SuSE) and with pg 7.0/7.1. I found that the crash occurrs as soon as I use a SERIAL type in the table creation command. Please

[SQL] ConnecDB() -- couldn't send SSL negotiation packet:

2001-07-03 Thread Bhuvan A
hi, While i am trying to connect pgsql from a perl program, i am getting the error message as ConnectDB() -- couldn't send SSL negotiation packet: errno=9 Bad file descriptor Why i am getting this error? How can i rectify this problem? Remember, i am socksifying my application for some neces

[SQL] Re: pls Help us... (sql question)

2001-07-03 Thread Ross J. Reedstrom
Best to ask your questions on the list, so others may find them, with (hopefully) helpful answers in the archives in the future. so, you've got a table with indistinguishable rows. I'm afraid you've got to use an non ANSI extension. Every DB I've ever used has something equivelant. In PostgreSQL,

Re: [SQL] indexing arrays in pgaccess's query interface is failing

2001-07-03 Thread Tom Lane
[ redirected to pgsql-interfaces, which seems a more appropriate venue ] David Stanaway <[EMAIL PROTECTED]> writes: > --.. And now the query that I am having problems with. > > SELECT itID, itProperties[akID], akName > FROM items, arraykeys; > > In pgaccess, > when I try to execute the same query

[SQL] problem with date/time constants

2001-07-03 Thread datactrl
Hi, server:PostgreSQl 7.1 why doesn't following statement work? "select now;" THANK YOU! JACK LIU ---(end of broadcast)--- TIP 6: Have you searched our list archives? http://www.postgresql.org/search.mpl

[SQL] indexing arrays in pgaccess's query interface is failing

2001-07-03 Thread David Stanaway
Hi there, I am having some difficulties with using arrays in pgaccess relating to arrays. Here is an example schema: CREATE TABLE arraykeys ( akID int, akName varchar(12), PRIMARY KEY(akID) ); CREATE TABLE items ( itID serial, itProperties bool[], PRIMARY KEY(itID) );

[SQL] traversing foreign key relationships between tables

2001-07-03 Thread Markus Wagner
Hi, I have the following problem. There is a trigger event on a table T. Table t is linked through n intermediate tables (mostly n = 0) to a primary master Table M. What I need to do is find the entry in M which corresponds to the triggered entry in T. I think in pseudocode it would be like th