You were so right, it appears to be pgadmin. I ran the sql in psql and I got my spacing correctly. Sometimes we become so deeply entrenched in the code that we forget where we are! I will definitely look into the rpad and lpad functions as well. Thanks
I tried the case statement as you suggested. I did need to change each single quote to 2 single quotes in that case statement. I still did not get the excess spaces. Is it possible that since I am running it via PGAdmin under windows (versus Unix) that the extra spaces are not being interpreted...
I have not been able to figure out howto return a string of spaces from a postgres PLpgSQL function. For example I have a finalresult field defined as varchar. As I LOOP thru a section of code I set
finalresult := finalresult || '' '' || field1 || '',''|| field2;
and then I issue...
Thanks for everyone's feedback. Unfortunately I am on Postgres 7.2 which limits me regarding the use of a stored procedure, which would have supported my variability of the 'top n' and the number of problem groups, so I am forced to use the view method. I did learn alot based on your direction...
Thanks for the feedback! I was hoping I would not have to go the route you suggest since I wanted to be able to have the top 'n' be a variable and not a set value (passed from the reporting program). And I also didn't want to have views for each problem category, since new categories come up all...
The informationr resides in just one table where the key is
problem id (number) and fields type (varchar) is the problem category (ie. email problem) and the requestor (varchar) is the name (ie. bob).
My undestanding of limit is that in my case I will get just 3 items from the total result...
I am trying to write a select statement using Postgres to get the top 3 users in each problem category with the most problem incidents.
For example:
email problems:
mary 5
jason 3
amy 2
beth 1
riley 1
network problems:
bob 7
john 6
fred 4
howard 2
amy 1
sue 1
The results would produce:
email...
In response to Leland's point, I have found that a unique set of catalog system tables exist for each database in a cluster. Catalog creation for each is defined using template1 unless otherwise overridden. However there are global catalog objects that exists across all databases and exist in a...
1) I am testing out phpPgAdmin version 2.4.2 on a new linux server. We previously have been using 2.4-1 our current production server. With this new release I have found that on my left pane, the drop down entries for System Tables, All Databases open up with their entries already expanded, but...
I have a table (ABC) that has:
pro varchar2(12) not null (primary key)
pat varchar2(12) not null (primary key)
ic1 varchar2(1)
ic2 varchar2(1)
ic3 varchar2(1)
ic4 varchar2(1)
If I want to create a view that will return a row for each ic type i could specify:
create or replace view as
select...
The number of columns are fixed, in that I know the maximum number of row values that could occur. So I can interpret them using the decode function to flip the result set. However I am not sure how to handle the numeric/varchar2 value in the result set.
I have a table that looks something like this:
protocol varchar2(12) not null - pk
patient varchar2(12) not null - pk
coldate date not null - pk
testname varchar2(32) not null- pk
testresult_num number(11,5)
testresult_text varchar2(20)
I would like to produce results that for each unique...
I am trying to find our where the information goes in the system catalog when you issue a command 'Grant select on table1 to user1'; I have been searching thru the pg_ catalog tables but have not been able to find it.......Thanks in advance for your help!
I have a postgres database on 2 different linux servers. the PHP application code resides on one of the servers. I am trying to use pg_connect like this:
****
$conn = pg_connect ("hostaddr=$InServer port=5432 dbname=sag0s01 user=$InUser password=$InPassword");
****
where I pass in the...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.