postgresql

access a column aliases in the where clause in postgresql

僤鯓⒐⒋嵵緔 提交于 2021-02-05 12:08:37
问题 I understand that I may need to do grouping to accomplish this, but I can't quite get it. Postgresql 8.1 I am needing to limit my result set to Origination > 2017-01-01. Origination is set in line 11. It is being returned as a column in Excel and is a date. Currently it returns results with data going back years and we don't need that. select distribution_stop_information.customer_no, distribution_line_items.item_number, distribution_line_items.container_id, distribution_line_items.item

access a column aliases in the where clause in postgresql

只愿长相守 提交于 2021-02-05 12:08:11
问题 I understand that I may need to do grouping to accomplish this, but I can't quite get it. Postgresql 8.1 I am needing to limit my result set to Origination > 2017-01-01. Origination is set in line 11. It is being returned as a column in Excel and is a date. Currently it returns results with data going back years and we don't need that. select distribution_stop_information.customer_no, distribution_line_items.item_number, distribution_line_items.container_id, distribution_line_items.item

access a column aliases in the where clause in postgresql

牧云@^-^@ 提交于 2021-02-05 12:07:03
问题 I understand that I may need to do grouping to accomplish this, but I can't quite get it. Postgresql 8.1 I am needing to limit my result set to Origination > 2017-01-01. Origination is set in line 11. It is being returned as a column in Excel and is a date. Currently it returns results with data going back years and we don't need that. select distribution_stop_information.customer_no, distribution_line_items.item_number, distribution_line_items.container_id, distribution_line_items.item

PostgreSQL privilege grant not visible

陌路散爱 提交于 2021-02-05 11:54:45
问题 On PostgreSQL 10, I've a schema called tn_schema and a database called tn_beta_db . I think so, although I do have to be connected to the relevant database to see the schema: [T] jeff@nantes-4:~ $ sudo su postgres -c psql psql (10.10 (Ubuntu 10.10-0ubuntu0.18.04.1)) Type "help" for help. postgres=# \l List of databases Name | Owner | Encoding | Collate | Ctype | Access privileges ------------+----------+----------+-------------+-------------+----------------------- postgres | postgres | UTF8

merge all rows columns into single column from joined table

穿精又带淫゛_ 提交于 2021-02-05 11:33:26
问题 I want to join a table which has multiple rows and need to merge one of the column from all the rows into single column. select a.parent_id,a.parent_name,concat(b.child_name) from parent a join children b on (a.parent_id=b.parent_id); This should return all the parent rows and each parent row should have all its children's. i am thinking to group with parent_id but getting multiple records (one record per child). What logic i can implement here apart from grouping to get all child's for a

PostgreSQL with SQLalchemy database is not found

巧了我就是萌 提交于 2021-02-05 11:31:05
问题 I am using the following code to create postgresql database using sqlalchemy: engine=create_engine('postgresql+psycopg2://postgres@localhost/testData') Base.metadata.create_all(engine) But it gives me the following error even though I manually created the database in psql: File "/home/ubuntu/venve/local/lib/python2.7/site-packages/sqlalchemy/engine/default.py", line 376, in connect return self.dbapi.connect(*cargs, **cparams) File "/home/ubuntu/venve/local/lib/python2.7/site-packages/psycopg2

PostgreSQL: command is already in progress

北城以北 提交于 2021-02-05 11:12:39
问题 My asynchronous function tries to select a single record from a table. This function accepts a few arguments passed from another function. So, some processes (6 at least) can use it simultaneously. Often I get an error with the message "command is already in progress" . I know that the problem hides in the reader, because the reader is busy when another process tries to access it. Let me publish the full code below: async private void InsertToLog(List<Printer> APrinter, List

PostgreSQL: command is already in progress

我是研究僧i 提交于 2021-02-05 11:12:35
问题 My asynchronous function tries to select a single record from a table. This function accepts a few arguments passed from another function. So, some processes (6 at least) can use it simultaneously. Often I get an error with the message "command is already in progress" . I know that the problem hides in the reader, because the reader is busy when another process tries to access it. Let me publish the full code below: async private void InsertToLog(List<Printer> APrinter, List

Postgresql initial configuration: How to access as the postgres user?

拜拜、爱过 提交于 2021-02-05 11:02:41
问题 After installing postgresql, I tried it out, typing createdb mydb, like it's written in the documentation. Then the following error occured: createdb: could not connect to database postgres: FATAL: role "xxx" does not exist I studied the documentation, where is said: You will need to become the operating system user under which PostgreSQL was installed (usually postgres) to create the first user account I tried this by accessing psql (in my case with sudo -u postgres psql, using Ubuntu 12.10)

PostgreSQL database reverse engineering from shell level

拈花ヽ惹草 提交于 2021-02-05 10:40:20
问题 I happened to do some moderating stuff with large database but I am not so experienced in it so i guess the smart thing is to create similar database on my localhost to not mess up with original one. And here is my question, is it possible to generete SQL script which will create exact table as i want? I mean on MySQL GUI tool there is option like this, reverse engineering which generate SQL script which will create exact database as I used function on, is it possible in PostgreSQL in shell