[SQL] Problem on CREATE/ALTER USER

2001-06-05 Thread chard

hello i've got a problem on CREATE USER and ALTER USER when i have many
users connected.
i have prosgresql 7.1 running on Redhat 7.0

is this a bug in postgres?

pls let me know. thanks


richard.


---(end of broadcast)---
TIP 4: Don't 'kill -9' the postmaster



Re: [SQL] Problem on CREATE/ALTER USER

2001-06-05 Thread Tom Lane

chard <[EMAIL PROTECTED]> writes:
> hello i've got a problem on CREATE USER and ALTER USER when i have many
> users connected.
> i have prosgresql 7.1 running on Redhat 7.0
> is this a bug in postgres?

How can we tell?  You'll need to provide a much more specific report
than that.  See
http://www.ca.postgresql.org/users-lounge/docs/7.1/postgres/bug-reporting.html

regards, tom lane

---(end of broadcast)---
TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]



[SQL] Reading array's of integer in plpg/SQL

2001-06-05 Thread Luis Sousa

>From pg_group, it's possible to return the users that are in that group.

How can in put the values in that array of integer to an array ??

Using plpg/SQL, how can i access to the array of integers ???



Best Regards

Luis Sousa


---(end of broadcast)---
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to [EMAIL PROTECTED] so that your
message can get through to the mailing list cleanly



[SQL] Re: START for SERIAL type?

2001-06-05 Thread Frank Contrepois

read the doc section datatype!!!
serial just create a sequence on a standard way, if you dont like it you'll
have to create your sequence.
bye
--
--

"L'idea di base è estremamente semplice..."
©opyright Frank "Pazzooo" Contrepois (schiavista francese del '900)




---(end of broadcast)---
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])



[SQL] Re: SELECT * INTO TABLE is not working for me.

2001-06-05 Thread Sergey E. Volkov

"Roy Souther" <[EMAIL PROTECTED]> ÓÏÏÂÝÉÌ/ÓÏÏÂÝÉÌÁ × ÎÏ×ÏÓÔÑÈ ÓÌÅÄÕÀÝÅÅ:
0105301102010Q.28903@OlympusMons">news:0105301102010Q.28903@OlympusMons...
> I am testing my SQL commands in pgaccess before I put them into my C++
code.
> Trying to copy a table using...
> SELECT * INTO TABLE copy_stuff FROM the_stuff

Works only when 'copy_stuff' table is not exists for now.
If you want to populate existing table, just use ' insert into copy_stuff
select * from the_stuff';

>
> It creates the view but no table called copy_stuff exists after I run it.
Why?
> I can use...
> CREATE TABLE copy_stuff AS SELECT * FROM the_stuff
> that works and makes a new table, but it causes other problems with the
> clients that this app is running from. I would like to make the SELECT *
INTO
> work. Any idea?
>
> --
> Roy Souther <[EMAIL PROTECTED]>
>
> 01100010 10101110 11000110 11010110 0100 10110010 10010110 11000110
> 01001110 0110 11001110 00010110 10010110 00101110 1100 1100
>
>
> ---(end of broadcast)---
> TIP 4: Don't 'kill -9' the postmaster



---(end of broadcast)---
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])



[SQL] Distinct Values

2001-06-05 Thread Nicolas

Hi,

I'm trying to retreive DISTINCT Values from a two colomn table called
"Books". The colomns are named "Author" and "URL".
DISTINCT values should be retieved from the "Author" Colomn , and then I
should be able to retrieve the corresponding URL.
How do I build the SQL Query ?
I tried to use: "SELECT DISTINCT Author FROM Books" But this does not allow
me to fetch the URL value on the other colomn.

Thanks
Nicolas



---(end of broadcast)---
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])



[SQL] Re: How to use the template table in postgresql

2001-06-05 Thread Hans-Jürgen Schönig

stone schrieb:

> Hello:
> I'm new user of postgresql. My problem is that:
> 1. How to create template table? Is it right of ' Create temptable
> test(..)'?
> 2.My application is Client/Server, can  I has some workstations create the
> same template table name on the same time? If I could, How can I do with it?
> Thanks for your help.Stone.

If you want to find out more about the syntax of a command you can use \h as
shown below:

myodbc=# \h create table
Command: CREATE TABLE
Description: Creates a new table
Syntax:
CREATE [ TEMPORARY | TEMP ] TABLE table_name (
{ column_name type [ column_constraint [ ... ] ]
  | table_constraint }  [, ... ]
) [ INHERITS ( parent_table [, ... ] ) ]


Temporary tables are only visible for the user who created the table - you need
not worry that something evil happens.
A temporary table is killed as soon as the session is closed.

Hans


---(end of broadcast)---
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to [EMAIL PROTECTED] so that your
message can get through to the mailing list cleanly



[SQL] Re: INSERT value of type table

2001-06-05 Thread Frank Contrepois

> exemple:
> CRETAE TABLE Address (Number integer, Street varchar, city varchar, contry
> varchar);
> CREATE TABLE Person (Name varchar, addr Address);
> INSERT INTO addrerss VALUES ( 5, 'rue du pont',  'Lyon', 'France');
> The question is :
> How we can insert a new person whose address is that inserted in the
> table of the addresses.

CREATE TABLE Address (Number integer PRIMARY KEY, Street varchar, City
varchar, Country varchar)
CREATE TABLE Person (Name varchar, addr integer REFERENCES TO Address)

this is called a FOREIGN KEY.. look at some doc for it. this is the way
Relational DB works
bye
--
--

"L'idea di base è estremamente semplice..."
©opyright Frank "Pazzooo" Contrepois (schiavista francese del '900)




---(end of broadcast)---
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to [EMAIL PROTECTED] so that your
message can get through to the mailing list cleanly



[SQL] Re: Is it possible to defer triggers?

2001-06-05 Thread Frank Contrepois

read this:
http://www.postgresql.org/idocs/index.php?sql-createtrigger.html

bye
--
--

"L'idea di base è estremamente semplice..."
©opyright Frank "Pazzooo" Contrepois (schiavista francese del '900)




---(end of broadcast)---
TIP 4: Don't 'kill -9' the postmaster



[SQL] Re: Slow inserts/deletes

2001-06-05 Thread Frank Contrepois

If you use index on this table it's better to:
1) drop all index on the table
2) do the insert
3) (re)create the indexes


--
--

"L'idea di base è estremamente semplice..."
©opyright Frank "Pazzooo" Contrepois (schiavista francese del '900)




---(end of broadcast)---
TIP 4: Don't 'kill -9' the postmaster



[SQL] How to use the template table in postgresql

2001-06-05 Thread stone

Hello:
I'm new user of postgresql. My problem is that:
1. How to create template table? Is it right of ' Create temptable
test(..)'?
2.My application is Client/Server, can  I has some workstations create the
same template table name on the same time? If I could, How can I do with it?
Thanks for your help.Stone.



---(end of broadcast)---
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to [EMAIL PROTECTED] so that your
message can get through to the mailing list cleanly



[SQL] Re: Date manipulation

2001-06-05 Thread Reinoud van Leeuwen

On Thu, 31 May 2001 17:24:54 + (UTC), [EMAIL PROTECTED] (Mark)
wrote:

>
>How does one perform date manipulation within SQL?  For example, SQL
>Server has a dateadd() function that takes a date part, scalar, and the
>date to manipulate.
>
>I have a query that determines the number of days that are between now
>and a particular date that looks something like this:
>
>select datediff (dd, now (), column) as difference_in_days from ...
>
>Anything available short of coding my own function?

Yes: see 
http://www.postgresql.bit.nl/devel-corner/docs/user/functions-formatting.html
and
http://www.postgresql.bit.nl/devel-corner/docs/user/functions-datetime.html
-- 
__
"Nothing is as subjective as reality"
Reinoud van Leeuwen   [EMAIL PROTECTED]
http://www.xs4all.nl/~reinoud
__

---(end of broadcast)---
TIP 4: Don't 'kill -9' the postmaster



[SQL] 7.1 LOCK TABLE changes

2001-06-05 Thread Brian Powell

Greetings,

I am investigating whether our application will run on 7.1.1 (from 
7.0.3), and our client software only accesses the database through views 
for security and convenience.

In our client app, we lock our table before doing something to it.  
Fortunately, in 7.0.3, a view looked like a table and we could perform:

lock v_whatever in share row exclusive mode;

However, in 7.1.1, it comes back and tells me that:

ERROR:  LOCK TABLE: v_whatever is not a table

The HUGE advantage in 7.0.3 was that we could present our db through 
views and the client didn't have to know.

So, in 7.1.1, do I need to move the LOCK TABLE statements from the 
client software and into the rules of the views?

Thanks,

--Brian

---(end of broadcast)---
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to [EMAIL PROTECTED] so that your
message can get through to the mailing list cleanly



[SQL] sql hard question

2001-06-05 Thread limlim

i am trying to build a query in sql that compares between 2 tables one
hold to field and the other hold the 2 fields in one
example:
table1:EN,12
table2:EN.12
how can i compare between the tables throw that field
i try with this query but it doesnt work:

SELECT * FROM dbo.CNT_DOC_LANGS x INNER JOIN dbo.CNT_DOCS2QUEST y ON
(CAST(x.DOC_ID AS varchar) + '.' + RTRIM(x.LANG)) t = y.SRC_ID

please help

---(end of broadcast)---
TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]



[SQL] php-nuke

2001-06-05 Thread Sharmad Naik

hi,
I wanted to know that does postgresql database support php-nuke
-- 
Donot rely on the Operating System which don't have any sources for.
-Seen somewhere on the Net
___  _  _  _
|_|_||_||_||\/||_|| \
_|| || || \|  || ||_/

---(end of broadcast)---
TIP 4: Don't 'kill -9' the postmaster



[SQL] query on two databases ..

2001-06-05 Thread Muhammed Yazici

hi,
i'am really new to postgresql and i try it with php ..

Now i have following question :

is it possible to make one query on two databases. I have a database calles
db1 and one db2 and i want to get :


select * from ":db1:table1"  where ":db1:table1:col1" in (select "col1" from
":db2:table1" );

(this query will work in interbase dbs)

how is the right syntax in postgresql ??

can anybody help my .. i looked in diffent manuals but i couldnt find the
syntax ..

thanks a lot for your help in forward ..

m. Yazici
[EMAIL PROTECTED]



---(end of broadcast)---
TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]



Re: [SQL] Case Insensitive Queries

2001-06-05 Thread ANDREW PERRIN

Try:

- The ILIKE operator, for example,

SELECT * FROM account WHERE username ILIKE "test";

- upper() or lower(), for example,

SELECT * FROM accont WHERE lower(username) = "test";

-
   Andrew J. Perrin - Assistant Professor of Sociology
University of North Carolina, Chapel Hill
269 Hamilton Hall CB#3210, Chapel Hill, NC 27599-3210 USA
   [EMAIL PROTECTED] - http://www.unc.edu/~aperrin

On 29 May 2001, Mark wrote:

> Is it possible to execute a query using a where clause that allows case
> insensitive comparison between a field and text.
> 
> For example:
> 
> select * from account where username = 'test'
> 
> where username could be 'Test', which would be a match.  As is, this
> compare is case sensitive.
> 
> grep'd the source, but stricmp is only used for keywords and not actual
> column data.
> 
> Any help would be greatly appreciated.
> 
> Thanks,
> 
> Mark
> 
> 
> ---(end of broadcast)---
> TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]
> 


---(end of broadcast)---
TIP 6: Have you searched our list archives?

http://www.postgresql.org/search.mpl



[SQL] Re: query on two databases ..

2001-06-05 Thread Nils Zonneveld



Muhammed Yazici wrote:
> 
> hi,
> i'am really new to postgresql and i try it with php ..
> 
> Now i have following question :
> 
> is it possible to make one query on two databases. I have a database calles
> db1 and one db2 and i want to get :
> 
> select * from ":db1:table1"  where ":db1:table1:col1" in (select "col1" from
> ":db2:table1" );
> 
> (this query will work in interbase dbs)
> 
> how is the right syntax in postgresql ??
> 
> can anybody help my .. i looked in diffent manuals but i couldnt find the
> syntax ..
> 
> thanks a lot for your help in forward ..
> 
> m. Yazici
> [EMAIL PROTECTED]

While schema's have not (yet) been implemented, it's not possible to
refer to two database in one SQL statement in PostgreSQL.

Regards,

Nils

---(end of broadcast)---
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to [EMAIL PROTECTED] so that your
message can get through to the mailing list cleanly



[SQL] Re: [PHP] PHP-PostgreSQL - install

2001-06-05 Thread Chris Ruprecht

find libpq.so.2.1 in the tree from the compile (find . -name
libpq.so.2.1 -print)
then copy it to /usr/libexec manually.
you might also want to check the permissions on the library, it should be
755 (rwxr-xr-x).

Best regards,
Chris

- Original Message -
From: "Dorin Grunberg" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, June 05, 2001 1:34 PM
Subject: [PHP] PHP-PostgreSQL - install


> Hi,
>
> I have a fresh install on OpenBSD 2.8. I did install PostgreSQL7.1.2 and
> PHP 4.0.5.
>
> When I try to start Apache I get this error:
>
> /usr/libexec/ld.so: httpd: libpq.so.2.1: No such file or directory
> /usr/sbin/apachectl start: httpd could not be started
>
> TIA
>
> Dorin
>
>
>
> ---(end of broadcast)---
> TIP 4: Don't 'kill -9' the postmaster


_
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


---(end of broadcast)---
TIP 4: Don't 'kill -9' the postmaster



[SQL] Re: query on two databases ..

2001-06-05 Thread Muhammed Yazici

...sh*

But thanx ..
i'll try another solution ..


"Nils Zonneveld" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
>
>
> Muhammed Yazici wrote:
> >
> > hi,
> > i'am really new to postgresql and i try it with php ..
> >
> > Now i have following question :
> >
> > is it possible to make one query on two databases. I have a database
calles
> > db1 and one db2 and i want to get :
> >
> > select * from ":db1:table1"  where ":db1:table1:col1" in (select "col1"
from
> > ":db2:table1" );
> >
> > (this query will work in interbase dbs)
> >
> > how is the right syntax in postgresql ??
> >
> > can anybody help my .. i looked in diffent manuals but i couldnt find
the
> > syntax ..
> >
> > thanks a lot for your help in forward ..
> >
> > m. Yazici
> > [EMAIL PROTECTED]
>
> While schema's have not (yet) been implemented, it's not possible to
> refer to two database in one SQL statement in PostgreSQL.
>
> Regards,
>
> Nils



---(end of broadcast)---
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to [EMAIL PROTECTED] so that your
message can get through to the mailing list cleanly



Re: [SQL] query on two databases ..

2001-06-05 Thread Stephan Szabo


There is currently no ability to span databases in a single
query.

On Wed, 30 May 2001, Muhammed Yazici wrote:

> hi,
> i'am really new to postgresql and i try it with php ..
> 
> Now i have following question :
> 
> is it possible to make one query on two databases. I have a database calles
> db1 and one db2 and i want to get :
> 
> 
> select * from ":db1:table1"  where ":db1:table1:col1" in (select "col1" from
> ":db2:table1" );
> 
> (this query will work in interbase dbs)
> 
> how is the right syntax in postgresql ??
> 
> can anybody help my .. i looked in diffent manuals but i couldnt find the
> syntax ..
> 
> thanks a lot for your help in forward ..


---(end of broadcast)---
TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]



[SQL] plperl

2001-06-05 Thread clayton cottingham

hello:

how does one execute an sql statement from inside a plperl function?

---(end of broadcast)---
TIP 4: Don't 'kill -9' the postmaster



Re: [SQL] Distinct Values

2001-06-05 Thread Stephan Szabo

On Wed, 30 May 2001, Nicolas wrote:

> Hi,
> 
> I'm trying to retreive DISTINCT Values from a two colomn table called
> "Books". The colomns are named "Author" and "URL".
> DISTINCT values should be retieved from the "Author" Colomn , and then I
> should be able to retrieve the corresponding URL.
> How do I build the SQL Query ?
> I tried to use: "SELECT DISTINCT Author FROM Books" But this does not allow
> me to fetch the URL value on the other colomn.

If there is only one distinct url for each author then:
select distinct author, url from books;

If not, *which* url do you want to get?
If it doesn't matter, you can use a non-standard structure:
select distinct on (author) author, url;

If you wanted (for example) the url that could be considered
the minimum, you could do something like:
select author, min(url) from books group by author;




---(end of broadcast)---
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])



Re: [SQL] plperl

2001-06-05 Thread Tom Lane

clayton cottingham <[EMAIL PROTECTED]> writes:
> how does one execute an sql statement from inside a plperl function?

At the moment, one doesn't.

This is one of a number of features that have to be finished before
plperl can be classed as more than a proof-of-concept exercise.
However, Mark Hollomon seems to have lost interest or time to work on
it, and no one else has picked up the ball.  Any volunteers out there?

regards, tom lane

---(end of broadcast)---
TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]



Re: [SQL] plperl

2001-06-05 Thread Jie Liang

As I know, plperl doesn't support that yet.
plpgsql does, so does pltcl.

Jie LIANG

St. Bernard Software

10350 Science Center Drive
Suite 100, San Diego, CA 92121
Office:(858)320-4873

[EMAIL PROTECTED]
www.stbernard.com
www.ipinc.com

On Tue, 5 Jun 2001, clayton cottingham wrote:

> hello:
> 
> how does one execute an sql statement from inside a plperl function?
> 
> ---(end of broadcast)---
> TIP 4: Don't 'kill -9' the postmaster
> 


---(end of broadcast)---
TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]



Re: [SQL] sql hard question

2001-06-05 Thread Josh Berkus

Limlim,

Please post table definitions and some sample data.  Your problem does
not look that challenging and there is probably a simple reason that
you're having trouble with it.

> i am trying to build a query in sql that compares between 2 tables
> one
> hold to field and the other hold the 2 fields in one
> example:
> table1:EN,12
> table2:EN.12
> how can i compare between the tables throw that field
> i try with this query but it doesnt work:
> 
> SELECT * FROM dbo.CNT_DOC_LANGS x INNER JOIN dbo.CNT_DOCS2QUEST y ON
> (CAST(x.DOC_ID AS varchar) + '.' + RTRIM(x.LANG)) t = y.SRC_ID


__AGLIO DATABASE SOLUTIONS___
   Josh Berkus
  Complete information technology  [EMAIL PROTECTED]
   and data management solutions   (415) 565-7293
  for law firms, small businessesfax 621-2533
and non-profit organizations.  San Francisco

---(end of broadcast)---
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/users-lounge/docs/faq.html



[SQL] "Day" from 8am to 3am

2001-06-05 Thread Judd Maltin

Hi folks,

I have a special application that considers a playday to be from 8am to
3pm the next morning.  The system then does maintenance from 3am till 8am
(if necessary).

I'd like to ease application development by creating a new kind of
"playDay" to query from.  For example:

SELECT * FROM table WHERE timestamp IN date_trunc('playDay', timestamp);

Any ideas?
 
Where should I begin?  Or is this all just wrongheaded and should I put it
on the application level?

-judd


---(end of broadcast)---
TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]



[SQL] How to use the type int2vector ?

2001-06-05 Thread David BOURIAUD

Hi the list !
How can I make a test on a int2vector ? If I have a vector that contains
(1, 2, 5, 9), how can I check these values incivicually ? Thanks by
advance for your help. 
-- 
David BOURIAUD
--
In a world without walls or fences, what use do we have 
for windows or gates ?
--
ICQ#102562021

---(end of broadcast)---
TIP 6: Have you searched our list archives?

http://www.postgresql.org/search.mpl