On Tue, 19 Nov 2002, Giannis wrote:
> when I do :
>
> select count(column_name) from table_name
>
> should I get the count for all columns or just those which are not null?
&Ggr;&igr;&aacgr;&ngr;&ngr;&eegr;,
&thgr;&agr; &pgr;&aacgr;&rgr;&egr;&igr;&sfgr; &tgr;&ogr; &pgr;&lgr;&eeacgr;&thgr;&ogr;&sf
"Rison, Stuart" <[EMAIL PROTECTED]> writes:
> The first SELECT returns a 'timestamp', but the next two return a
> 'timestamptz' (presumably with timezone); is this inconsitent behaviour?
Yes. It's a transitional behavior in 7.2: timestamp without any quotes
is translated by the parser to timestam
Kenneth Evans writes:
> On the other hand the COPY FROM file command has it the other way round - if the
>separators are semi-colons then the source file
> London;12;15.7
> Paris;13;22.2
> will work
>
> but
> 'London'; '12'; '15.7'
> 'Paris';'13';'22.2'
> will not!
The COPY input data is a separ
Hi All.
Having perused all the online docs I can find it appears there is no
SQL solution for casting the dread money type to numeric.
Is this true?
select rent::numeric(9,2) from x;
ERROR: Cannot cast type 'money' to 'numeric'
I guess my cash ain't nothing but trash... ;-)
TIA!
--
Hi Robert;
The math actually works either way; if it goes negative, the offset is
positive, which is okay. Your selects are way more elegant. I guess I
was just raising the point that using a key other than lft (which tends
to move around in an active tree), is probably safer. The table lock
On Wed, 27 Nov 2002 [EMAIL PROTECTED] wrote:
> Why dont' you use prepare and execute in case you are using DBI
> same program is like this.
>
> $dbh = DBI -> connect ( "..");
> $sth = $dbh -> prepare("insert into tab (a,b) values (?,?)");
> $sth -> execute($a , $b );
> $sth -> finish();
> $db
On Wed, 27 Nov 2002 [EMAIL PROTECTED] wrote:
> Why dont' you use prepare and execute in case you are using DBI
> same program is like this.
>
> $dbh = DBI -> connect ( "..");
> $sth = $dbh -> prepare("insert into tab (a,b) values (?,?)");
> $sth -> execute($a , $b );
> $sth -> finish();
> $db
On 27 Nov 2002 at 0:01, [EMAIL PROTECTED] wrote:
> > Hi Group -
> >
> > I have a perl application for a registration form.
>
> Same Here,
>
> Why dont' you use prepare and execute in case you are using DBI
> same program is like this.
>
> $dbh = DBI -> connect ( "..");
> $sth = $dbh -> pre
> Hi Group -
>
> I have a perl application for a registration form.
Same Here,
Why dont' you use prepare and execute in case you are using DBI
same program is like this.
$dbh = DBI -> connect ( "..");
$sth = $dbh -> prepare("insert into tab (a,b) values (?,?)");
$sth -> execute($a , $b );
$
On Tue, 26 Nov 2002 [EMAIL PROTECTED] wrote:
> > On Tue, 26 Nov 2002, Richard Huxton wrote:
> >
> >> On Tuesday 26 Nov 2002 9:43 am, patrick wrote:
> >> > Greetings,
> >> >
> >> > I'm not sure what the correct behavior is here but the observed
> >> > behavior seems "wrong" (or at least undesirable
Hi,
On 25 Nov 2002 at 4:57, javaholic wrote:
Your problem is really a JSP one rather than a postgres problem, and probably doesn't
really belong on this list. That said, I know much more java/jsp than I do postgres,
so I'll
try and help.
> I have some jsp code that should insert a user name
> On Tue, 26 Nov 2002, Richard Huxton wrote:
>
>> On Tuesday 26 Nov 2002 9:43 am, patrick wrote:
>> > Greetings,
>> >
>> > I'm not sure what the correct behavior is here but the observed
>> > behavior seems "wrong" (or at least undesirable).
>> Don't look right to me, and I still see it here in 7.
On Fri, 22 Nov 2002, Nathan Young wrote:
> Hi all.
>
> I have a table with members and a table with payments. Each payment is
> related to a member by memberID and each payment has (among other things) a
> year paid.
>
> I can create a join to find a list of members who have paid for a given yea
Actually, we use JDBC Prepared Statements for this type of work. You
put a query with '?' in as placeholders and then add in the values and
the library takes care of the encoding issues. This avoids the double
encoding of (encode X as String, decode string and encode as SQL X on
the line). T
On Wed, 20 Nov 2002, Justin Georgeson wrote:
> I'm pretty new to databases in general, and would like to find a spiffy
> way to do something. I want to use two columns from one table to
> populate three columns in two other tables. Assuming t1 is the table I
> want to take the values from, here is
I think you should take a closer look at Greg's function. It is uses
lfts as parameters in the function mainly just to make the function
implementation independent; I was able to easily adapt it to my schema
which uses unique id's for each object in the tree hierarchy.
After looking your function
Sridhar
such questions shud be posted to pgsql-admin list.
generally in case of power failure pgsql is unable to remove its
pid file., if u are using RPM based installation the file shud be in
/var/lib/pgsql/ in the name of postmaster.pid
If such a file exists postmaster will refuse to start. in
On 20 Nov 2002, [EMAIL PROTECTED] wrote:
> i created index already. how can i decrease the query time more.
>
> number of record is over 1 million.
> the following is the query plan.
>
> Group (cost=34082.59..34085.62 rows=61 width=112)
> -> Sort (cost=34082.59..34082.59 rows=607 width=112)
> -> N
On Tue, 26 Nov 2002, Richard Huxton wrote:
> On Tuesday 26 Nov 2002 9:43 am, patrick wrote:
> > Greetings,
> >
> > I'm not sure what the correct behavior is here but the observed
> > behavior seems "wrong" (or at least undesirable).
> >
> > I have a few tables and a view on one of the tables selec
On Monday 25 Nov 2002 12:57 pm, javaholic wrote:
> Hi All,
>
> I have some jsp code that should insert a user name and password into
> a table called login.
>
> Instead of inserting the values given by the client, it insert the
> literal string 'username' and 'password. The problem is somewhere in
On Tuesday 19 Nov 2002 5:06 pm, Giannis wrote:
> when I do :
>
> select count(column_name) from table_name
>
> should I get the count for all columns or just those which are not null?
Just "not null" - use count(*) or count(0) for a count of rows.
--
Richard Huxton
---
On Tuesday 26 Nov 2002 1:14 pm, Zuev Dmitry wrote:
> Suppose you have a table T:
>
> A B
> 1 '111'
> 2 '222'
>
> How do you select A and B of the record with A maximum?
> 1) SELECT A, B FROM T ORDER BY A DESC LIMIT 1
>
> 2) SELECT A, B FROM T WHERE A IN (SELECT MAX(A) FROM T)
>
> What
On Tuesday 26 Nov 2002 1:54 pm, Rison, Stuart wrote:
> Hi,
>
> I'm trying to time a pl/sql function using a rougn and ready method,
> basically: print a TIMESTAMP at the begining of the function, print a
> TIMESTAMP at the end of the function.
[snip]
> Gives me:
>
> testdb2=# select timer();
> NOTI
On 26 Nov 2002 at 0:29, Tom Lane wrote:
> "Dan Langille" <[EMAIL PROTECTED]> writes:
> > SELECT E.name, EP.pathname, E.id, EP2.pathname, CL.id
> > ...
> > and EP2.pathname like EP.pathname || '/%'
>
> > I am still suspicous of that like. It seems to be the performance
> > killer here. The
Title: RE: [SQL] How does postgres handle non literal string values
I'm guessing it would have to be more like:
<%
String insertString =
"INSERT INTO \"login\" (\'user\', \'password\')
VALUES ('"+username+"', '"+password+"')";
%>
to actually con
when I do :
select count(column_name) from table_name
should I get the count for all columns or just those which are not null?
__
Do you Yahoo!?
Yahoo! Web Hosting - Let the expert host your site
http://webhosting.yahoo.com
> Here are the results from reversing the arguments.
>
> >hesco@biko:~$ su postgres
> >Password:
> >postgres@biko:/home/hesco$ cd
> >postgres@biko:~$ cd /usr/bin
> >postgres@biko:/usr/bin$ psql tempate1 -U postgres
> >Could not execv /usr/lib/postgresql/bin/psql
> >postgres@biko:/usr/bin$ psql tem
Hi All,
I have some jsp code that should insert a user name and password into
a table called login.
Instead of inserting the values given by the client, it insert the
literal string 'username' and 'password. The problem is somewhere in
the INSERT statement.
Here is the code:
<%@page contentType
I had a m/c with Postgres 7.2 and huge amount of data. on Power
failure and restart of the m/c pgsql refused connect to any of the
database. Being an invoice i took a tar of the data dir.
I tried reinstalling PGSQL and copied the data dir to the same dir
where the new data is being stored. ie
cp /b
Hello!
I hope that someone here could help.
I'm using PostgreSQL7.1.3
I have 3 tables: entry, subcategory and category.
The table "entry" has a foreign key "subcategoryid" with reference to the
table "subcategory", and the "subcategory" table has a foreign key
"categoryid" with reference to th
a) First an observation about populating
tables.
The standard syntax for literal values is to put
single quotes around all the strings and not around the numbers eg
insert into table values ('London', 12,
15.7);
However when bulk loading from files it needs an
extra step to find out which f
Hello!
I hope that someone here could help.
I'm using PostgreSQL7.1.3
I have 3 tables in my DB: the tables are defined in the following way:
CREATE TABLE category(
id SERIAL NOT NULL PRIMARY KEY,
// etc etc
)
;
CREATE TABLE subcategory(
id SERIAL NOT NULL PRIMARY KEY,
categoryid int CONSTRAI
Suppose you have a table T:
--
A B
--
1 '111'
2 '222'
--
How do you select A and B of the record with A maximum?
The desirable result therefore is (2, '222')
The two variants I could grow with are:
1) SELECT A, B FR
Hi all.
I have a table with members and a table with payments. Each payment is
related to a member by memberID and each payment has (among other things) a
year paid.
I can create a join to find a list of members who have paid for a given year
(2002 in this case):
select member.memberID,membe
Woops should have been masquerading
---(end of broadcast)---
TIP 4: Don't 'kill -9' the postmaster
Hi Group -
I have a perl application for a registration form. I'd like to put
escape characters in my insert command to accommodate for '
(i.e. O'Brien, O'Malley, etc). I've tired double quotes, single
quotes, back tick, forward ticks, curly bracket, round brackets - no
success.
Thanks, dave
-
Hi Hunter,
From my xbase++ program suite, sqlcontext class.
*
cValue := strtran(cValue,['],[\'])
*
Its called masquarading, simply replace the single quote with back_slash
+ single quote.
Regards
Mark Carew
Brisbane Australia
On 21 Nov 2002, Rod Taylor wrote:
> On Thu, 2002-11-21 at 15:09, scott.marlowe wrote:
> > On 21 Nov 2002, Rod Taylor wrote:
> >
> > > On Thu, 2002-11-21 at 14:11, Bruce Momjian wrote:
> > > > Of course, those would be SQL purists who _don't_ understand
> > > > concurrency issues. ;-)
> > >
> >
On 21 Nov 2002, Rod Taylor wrote:
> On Thu, 2002-11-21 at 14:11, Bruce Momjian wrote:
> > Of course, those would be SQL purists who _don't_ understand
> > concurrency issues. ;-)
>
> Or they're the kind that locks the entire table for any given insert.
Isn't that what Bruce just said? ;^)
--
On Thu, 2002-11-21 at 14:11, Bruce Momjian wrote:
> Of course, those would be SQL purists who _don't_ understand
> concurrency issues. ;-)
Or they're the kind that locks the entire table for any given insert.
--
Rod Taylor <[EMAIL PROTECTED]>
---(end of broadcast)-
I'm trying to retrieve some info from one column and
put it in another. I have a column that has a bunch
of information in it called 'Route'. I don't need to
show all of that information. Instead I need divide
that single column into two seperate columns called
'Sender' and 'Receiver'. How do I
I'm pretty new to databases in general, and would like to find a spiffy
way to do something. I want to use two columns from one table to
populate three columns in two other tables. Assuming t1 is the table I
want to take the values from, here is the structure of what I want to
insert into t2 an
i created index already. how can i decrease the query time more.
number of record is over 1 million.
the following is the query plan.
Group (cost=34082.59..34085.62 rows=61 width=112)
-> Sort (cost=34082.59..34082.59 rows=607 width=112)
-> Nested Loop (cost=0.00..34054.51 rows=607 width=112)
->
Thank you Tom Lane and Oliver Elphick.
Here is the latest shell dialogue.
postgres@biko:/home/hesco$ ./usr/lib/postgresql/bin/psql -d template1
sh: ./usr/lib/postgresql/bin/psql: No such file or directory
postgres@biko:/home/hesco$ /usr/lib/postgresql/bin/psql -d template1
sh: /usr/lib/postgresq
Hi Richard
Ok, I'll do my best to explain clearer ;)
I have to make some monthly reports about some service requests
activity. So, I'm keeping in a table the monthly traffic.
TABLE traffic
+-+++
| service | month | visits |
+-+---
Hi,
I'm trying to time a pl/sql function using a rougn and ready method,
basically: print a TIMESTAMP at the begining of the function, print a
TIMESTAMP at the end of the function.
So...:
CREATE OR REPLACE FUNCTION timer() RETURNS INTEGER AS '
DECLARE
timer1 TIMESTAMP;
timer2 T
Here's an "interesting" timestamp related postgreSQL quirk:
testdb2=# select "timestamp"('now');
timestamp
2002-11-26 13:47:12.454157
(1 row)
testdb2=# select 'now'::timestamp;
timestamptz
--
2002-11-26 13:47:34.88358+00
Hello,
is the inheritance of tables specified in the SQL99 standard,
or is this a postgresql "add-on" ?
Does anybody know when the primary key bug, which is
documented in the docs, of this feature will be fixed ?
Thx
berger
---(end of broadcast)-
> I really don't understand following PostgreSQL 7.2.3 behaviour:
>
> $ psql mydb
> mydb=> CREATE FUNCTION MONDAY(timestamp) RETURNS DATE AS '
> DECLARE
> var1 date;
> BEGIN
> select into var1 to_date($1::date-(case when extract(DOW from
> timestamp $1) = 0 then 6 else (extract(DOW from times
On Tuesday 26 Nov 2002 8:56 am, Ferruccio Zamuner wrote:
> CREATE FUNCTION MONDAY(timestamp) RETURNS DATE AS '
> DECLARE
> var1 date;
> BEGIN
> select into var1 to_date($1::date-(case when extract(DOW from
> timestamp $1) = 0 then 6 else (extract(DOW from timestamp $1)-1) end));
> RETURN va
On Tuesday 26 Nov 2002 9:43 am, patrick wrote:
> Greetings,
>
> I'm not sure what the correct behavior is here but the observed
> behavior seems "wrong" (or at least undesirable).
>
> I have a few tables and a view on one of the tables selecting
> entries that may be purged.
>
> My delete statement
Greetings,
I'm not sure what the correct behavior is here but the observed
behavior seems "wrong" (or at least undesirable).
I have a few tables and a view on one of the tables selecting
entries that may be purged.
My delete statement uses the view to delete data from one of the
tables. Like so
Hi,
I really don't understand following PostgreSQL 7.2.3 behaviour:
$ psql mydb
mydb=> CREATE FUNCTION MONDAY(timestamp) RETURNS DATE AS '
DECLARE
var1 date;
BEGIN
select into var1 to_date($1::date-(case when extract(DOW from
timestamp $1) = 0 then 6 else (extract(DOW from timestamp $1)-1)
53 matches
Mail list logo